Skip to content

Stop triage agents from stalling on git auto-gc and unbounded commands - #50

Merged
matthewp merged 1 commit into
mainfrom
fix/sandbox-git-gc-and-bash-timeout
Sep 29, 2026
Merged

matthewp merged 1 commit into
mainfrom
fix/sandbox-git-gc-and-bash-timeout

Conversation

@matthewp

Copy link
Copy Markdown
Contributor

Changes

  • Disables git auto-gc (gc.auto=0, maintenance.auto=false) in every triage checkout. Public checkouts are blobless, so history commands like git blame fetch blobs on demand and each batch could trigger a foreground auto-pack. In the triage of astro@7.3.5: experimental_AstroContainer output now includes data-astro-source-* dev annotations (regression from #17736) astro#18162, a single git blame spent 26 minutes auto-packing.
  • Bounds every command the triage pipeline agent runs. Flue's bash tool only sets a deadline when the model passes timeout, so a stuck command could consume the whole submission. Commands now run under timeout -k 5 N bash -c: 600s by default, and up to 1800s (the existing build budget) when the agent asks for more. A killed command returns exit 124 with a note explaining the default and how to request a longer timeout.
  • Uses bash -c rather than sh -c, because Cloudflare Sandbox runs agent commands in bash and /bin/sh is dash in the image. Commands were already independent (enableDefaultSession: false), so no shell state is lost.

Testing

  • tests/sandbox.test.ts: checkout config disables gc/maintenance and still removes origin for private repos; command bounds use the default timeout, honor requested timeouts, and clamp to the ceiling; the agent sandbox wraps commands and passes a trailing adapter deadline; a timed-out command gets the explanatory note.
  • tests/author-push.test.ts mocks @flue/runtime/cloudflare, which src/triage/sandbox.ts now imports.

Docs

  • No docs update needed: sandbox internals only.

A single `git blame` in a triage run on withastro/astro#18162 took 26
minutes: the public checkout is blobless, so blame fetched blobs on demand
and git kept auto-packing the growing object store in the foreground. The
pipeline agent's bash tool had no deadline, so nothing stopped it.

- Configure every triage checkout with gc.auto=0 and maintenance.auto=false.
- Wrap the pipeline agent's sandbox so each command runs under
  `timeout -k 5 N bash -c`: 600s by default, up to 1800s when the agent
  requests a longer timeout. A killed command returns exit 124 with a note
  telling the agent how to request more time.
@matthewp
matthewp merged commit f4dbdcc into main Sep 29, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant