Skip to content

feat(hub): show what a long sandbox command is doing while it runs - #70

Closed
brianjfox wants to merge 2 commits into
fix/agent-sandboxes-in-composefrom
feat/command-progress
Closed

brianjfox wants to merge 2 commits into
fix/agent-sandboxes-in-composefrom
feat/command-progress

Conversation

@brianjfox

Copy link
Copy Markdown
Contributor

Second of two changes toward showing what is happening at least every 10 seconds during long steps. Stacked on #66, since both change the sandbox command runner; its base should move to main once #66 merges.

What changed

  • packages/schemas/src/activity.ts: AgentActivity gains an optional command ({ line, at }), and COMMAND_PROGRESS_FILE names the file the sandbox and hub share.
  • apps/hub/src/builds/posix-sandbox.ts: a command the hub runs may print progress: <line> on stderr. The runner relays each such line (at most once a second) to command-progress.json beside the workspace, outside the sandbox's reach, and removes it when the command ends. Those lines stay out of the command's output; the rest of stderr is still kept for a failure. Only commands the hub runs get SB_PROGRESS=1, so a command an agent runs itself prints no such lines into what the agent reads.
  • apps/hub/src/builds/sidecar-tools.ts: the workspace install prints nothing the hub can relay, so it is noted as "installing the app's packages" for its whole length, up to the 115 s timeout.
  • apps/hub/src/artifacts/service.ts: the activity read attaches the line to a run when its sidecar is on the hub's machine and the line is under five minutes old, so a command that died leaves nothing stale on screen.
  • apps/web/src/pages/workspace/agent-activity.tsx: the live phrase shows the command's own line in place of the reading of the tool call that started it. Every surface that uses activityPhrase picks it up: the specialist's live line, the app pane during setup, and the activity strip.
  • workflows/coder/check/check-app.ts: reports starting the app and each page it opens, with how many it has still to open.

Why

A command the hub ran in the sandbox said nothing until it ended, so the person watched a fixed phrase and a clock for up to two minutes at a time, and for the whole of the first workspace install. On 2026-11-02 that read "Running a quick check 11m" and, during setup, nothing at all.

How it was verified

  • tsc --noEmit -p . and -p apps/web pass; oxlint --deny-warnings and Prettier pass on the changed files.
  • bun --conditions=intx-src test passes for apps/web/src/pages/workspace, apps/hub/src/builds and apps/hub/src/artifacts (28 tests, 1 new).
  • End to end, in a throwaway hub container with these files in place, through the hub's own createPosixBuildExecutor: a probe command's two progress lines reached the file while a real stderr line stayed in its failure output; check-app on a filed design emitted 30 page lines, none of which appeared in its checklist; the file was gone after each command.

A command the hub runs in the sandbox said nothing until it ended, so
the person watched a fixed phrase and a clock for up to two minutes at
a time, and for the whole of the first workspace install.

A command may now print "progress: <line>" on stderr; the sandbox
relays each such line to a small file beside the workspace, out of the
sandbox's reach, and removes the file when the command ends. The hub's
activity read attaches the line to the run when the sidecar is on its
own machine and the line is fresh, and the page shows it in place of its
reading of the tool call. The workspace install, which prints nothing
the hub can relay, is noted as "installing the app's packages" for its
whole length. Lines meant for the person stay out of the command's
output, and only commands the hub runs are asked for them.
check-app printed nothing until its checklist was complete, up to 100 s
after it started. It now reports starting the app and each page it
opens, with how many it has still to open, as progress lines the hub
relays to the person; an agent running it itself sees no such lines.

@corbits-triage corbits-triage Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Triage requests changes:

  • Conventions: added code matches a code pattern
  • Errors kept: added code matches a code pattern
  • Invented fallbacks: added code matches a code pattern

@brianjfox

Copy link
Copy Markdown
Contributor Author

Continued, rebased onto main, with the triage findings fixed, in a replacement pull request from branch feat/command-progress-main.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant