Repository navigation
feat(core): let long shell commands yield and follow them with command_status - #488
Merged
Merged
Conversation
…d_status A shell or exec call still running after yield_after_seconds (default 30 s) returns a command id and keeps running; command_status waits on, reads, or cancels it. Yielded commands stop when the run ends. A command now ends when its leader exits, so a background child holding the pipe no longer blocks the turn. Output is captured up to the spill item cap, so read_tool_result reaches the middle of a long log. Commands get TERM=dumb and, unless set, NO_COLOR=1, PAGER=cat and GIT_PAGER=cat. Timeouts name their limit and suggest a larger timeout or yield mode. Tool arguments over 64 KiB become a tool error naming the limit instead of failing the run.
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: efc018f13b
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…r call - command_status cancel=true now waits a bounded time; a command task that never finishes can no longer hold the turn. - A full table of yielded commands forgets its oldest finished, unread result instead of refusing to yield. - Command ids carry the call id prefix, so an id from an earlier run never names a command of a later one. - A command whose leader already exited no longer reports as running. - A yielded command's final result moves to command_status, not copied. - Drop StopYieldedOnDrop: it lived in initialization and fired before any command existed; the run's own cancellation already stops them.
This was referenced Oct 29, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Change
Long shell commands no longer block or fail a turn (plan section C).
shellandexectakeyield_after_seconds(default 30 s). A command still running then returnsexit=running id=c<call8>with its output so far and keeps running.command_status(id, wait_seconds ≤ 600, cancel)waits for a yielded command and returns its normal result, or its output so far;cancel=truekills it. It is offered exactly whenshellorexecis. A run keeps at most 16 yielded commands, and they stop when the run ends.sleep 600 &no longer holds the turn until the timeout.read_tool_resultcan search the middle of a long build log.TERM=dumb, andNO_COLOR=1,PAGER=cat,GIT_PAGER=catunless already set.timeout_secondslimit and suggests a larger timeout or yield mode.Verification
command_status; cancel and teardown stop yielded commands; a full run yields, follows up, and ends with a command still running that teardown stops;sleep 600 &returns; a 1 MiB log is searchable viaread_tool_result; a 70 KiBwrite_filegets a tool error and the run continues; the timeout text; the env defaults.origin/main(the yield tests need the new API to compile).cargo xtask check: passed on this tree.Known impact
command_statusfor the result.xtask/src/legacy-sleeps.txtline numbers shifted for six existing sleeps; no new sleeps.