Repository navigation
feat(core): auto-background slow tools after 10s through Tool.execute - #60495
Closed
kitlangton wants to merge 1 commit into
Closed
kitlangton wants to merge 1 commit into
kitlangton wants to merge 1 commit into
Conversation
kitlangton
force-pushed
the
t902-tool-seam
branch
from
October 30, 2026 06:11
a4f13f3 to
25840d0
Compare
kitlangton
force-pushed
the
t902-tool-seam
branch
from
October 30, 2026 06:38
25840d0 to
0ac00be
Compare
kitlangton
force-pushed
the
t902-job-sql
branch
from
October 30, 2026 13:55
06c03ae to
3532e25
Compare
kitlangton
force-pushed
the
t902-tool-seam
branch
from
October 30, 2026 13:56
0ac00be to
5ecadd0
Compare
kitlangton
force-pushed
the
t902-tool-seam
branch
from
October 30, 2026 14:52
5ecadd0 to
f141fff
Compare
This was referenced Oct 30, 2026
Contributor
Author
|
Closing in favor of the split stack (in merge order), keeping the
|
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 shell commands, Code Mode scripts, MCP calls, and custom plugin tools now move to the background automatically after 10 seconds instead of blocking the turn or getting killed at 2 minutes.
Fast calls (< 10 seconds) and instant local mutators or prompts (
edit,write,patch,question,todowrite,read,grep,glob) behave identically to before. Targetsdevdirectly (#60491 is merged).🔍 Origin: reported in #50278, #54221, #49216, and #56729
💡 Why: Previously only
shell,subagent, andexperimental_image_generatehand-rolled background jobs — each forking its own plugin-scopednotifyWhenDonewatcher that dropped completions on plugin reload (#56729) — whileexecute(Code Mode), MCP tools, and custom plugins blocked the turn with no way to background them (#54221, #49216).🆕 Now you can: Run long builds, servers, Code Mode scripts, or slow MCP/plugin calls and have them automatically yield
status: "running"with ajobIDand live output/logs after 10 seconds (yield_afteroverrides per call;0orbackground: truebackgrounds immediately), or move any active tool to the background withCtrl+B.📊 Proof
shellorexecute(Code Mode) runs past 10 s (#50278, #54221)shellSIGTERMs at 2 m)jobID+ live output/logs so far; explicittimeoutpreserved@opencode/pluginor MCP tool runs long / user pressesCtrl+B(#49216)jobID+ latestprogresstitle, wakes session on finishJobscope delivers notice onceyield_afterdeferYieldpauses yield timer until user repliesNew integration tests in
packages/core/test/tool-auto-background.test.tsfail without the change; 136 tests across 6codemodeandcoresuites pass.👀 Read:
packages/core/src/tool.tsinexecuteTopLevelandpackages/core/src/job.tsinblock—executeTopLevelwraps only top-levelSnapshot.executecalls so nestedtools.*calls inside Code Mode keep their declared JS return types, andblockresolves foreground vs background ownership under thestate.jobslock so boundary completions never double-deliver. The rest is routine.Checks run
bun test test/codemode.test.ts(packages/codemode): 54 pass, 0 failbun run script/test.ts test/tool-auto-background.test.ts test/job.test.ts test/tool-image-generate.test.ts test/tool-execute.test.ts test/session-execution.test.ts(packages/core): 82 pass, 0 failbun run typecheck && bun run typecheck:tsc(packages/schema,packages/codemode,packages/plugin,packages/core): 0 errors