Repository navigation
feat(core): yield slow top-level tools to the background after 10s - #60706
Open
kitlangton wants to merge 1 commit into
Open
kitlangton wants to merge 1 commit into
kitlangton wants to merge 1 commit into
Conversation
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.
Slow top-level plugin and MCP tools now move to the background after 10 seconds instead of blocking the turn.
Long tool calls no longer stall the agent loop: after
yield_after(10 s by default, orCtrl+B),Tool.executereturns partial progress immediately and delivers the bounded result later as a<tool>notice. Fast local file, search, and interactive tools opt out withbackground: false.💡 Why
🆕 Now you can
background: falseauto-background after 10 s (or onCtrl+B), preservingToolOutputtruncation and saving returned file attachments for background notices.yield_afterautomatically whenever the session has a pending permission or form prompt.📊 Numbers
Ctrl+B)<tool>noticeyield_aftertimerToolOutput+ files savedNew tests in
tool-auto-background.test.tsfail without this change; 58 tests pass acrossjob.test.ts,tool-auto-background.test.ts, andsession-execution.test.ts.👀 Read:
packages/core/src/job.ts(blockresolvingisBackgroundedvsconsumeJobatomically in oneSynchronizedRef.modify) andpackages/core/src/tool.ts(executeTopLevel+renderResultText). The rest is routine (background: falseone-liners on synchronous built-ins).🔍 Split 3 of 6 from #60495 · no user reports
Checks run
bun run --cwd packages/core typecheckbun --cwd packages/core test test/job.test.ts test/tool-auto-background.test.ts test/tool-todo.test.ts test/session-execution.test.ts: 59 pass