Repository navigation
feat(core): let Code Mode scripts block for 2 minutes before moving to the background - #64957
Merged
Merged
Conversation
…o the background User decisions: - Move a Code Mode script to the background after 2 minutes instead of 10 seconds
Contributor
There was a problem hiding this comment.
Looks good. A Code Mode script now stays in the foreground until the 2-minute mark and moves to the background right at it. I checked this by temporarily changing the e2e test to stop at 119s (script still running) and then 120s (receipt returned and the result delivered later). All 11 tests in subagent-idle-e2e.test.ts pass locally, including the flag-off test the description says fails, and typecheck:tsc is clean. Interrupting the turn during the longer wait still cancels the job as before.
Public API is unchanged.
3 of 6 tasks
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.
Issue for this PR
Closes #
Type of change
What does this PR do?
A Code Mode script now blocks the turn for up to 2 minutes (was 10 seconds) before moving to the background. Only affects
full_codemode, since scripts only run as jobs with it on. The window is now a namedBLOCK_TIMEOUTconstant; the e2e tests advance the TestClock to match.How did you verify your code works?
bun run typecheck:tscand oxlint pass.bun test test/subagent-idle-e2e.test.ts: 10 pass, 1 fail ("a slow script stays in the foreground with the flag off"). That test fails the same way ondevwithout this change.Checklist