Repository navigation
feat(core): auto-background slow shell commands via the job service - #60707
Open
kitlangton wants to merge 1 commit into
Open
kitlangton wants to merge 1 commit into
kitlangton wants to merge 1 commit into
Conversation
1 task done
1 task done
This branch has not been deployed
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.
Shell commands now yield to the background after 10 seconds with partial output, deleting
ShellTool.notifyWhenDone.Instead of blocking foreground turns for up to two minutes or losing completion notices on location reload,
shellnow blocks withyield_after(10 s default), returns captured output so far on yield, and letsJobdeliver the final<shell>notice. Net production code shrinks by 24 lines.💡 Why
background: true.ShellToolmaintained its ownDeferred+notifyWhenDonefiber duplicatingJobnotice delivery.🆕 Now you can
yield_afteronshell(default 10 s,0for immediate background) and receive partialShell.snapshotoutput when a command moves to the background.📊 Numbers
packages/core/src/tool/plugin/shell.tsnotifyWhenDone+Deferred+37 −61)Jobwith full outputNew reload + auto-yield test in
tool-auto-background.test.tsfails without this change; 8 pass acrosstool-auto-background.test.tsandtool-shell.test.ts -t background.👀 Read:
packages/core/src/tool/plugin/shell.tsaroundresult.reason === "signal" || input.timeout === undefined: auto-yield clears the default 2-minute foreground timeout while keeping an explicit callertimeoutarmed. The rest is routine.🔍 Split 4 of 6 from #60495 · shrinks production code by 24 lines
Checks run
bun run --cwd packages/core typecheckbun --cwd packages/core test test/tool-auto-background.test.ts: 5 passbun --cwd packages/core test test/tool-shell.test.ts -t background: 4 pass