Repository navigation
fix(server): background subagents can delegate after their parent's turn ends #38869
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Yash-Singh1
merged 5 commits into
pingdotgg:main
from
Bil0000:t3/mobile-subagent-visibility
Nov 20, 2026
+127
−15
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
709170a
fix(server): a background subagent can delegate after its parent's tu…
Bil0000 25bbf79
fix(web): a late subagent card no longer stretches a steer's "Continu…
Bil0000 a939eaf
Merge origin/main into t3/mobile-subagent-visibility
juliusmarminge 317d227
test(server): share the fake Claude adapter across native subagent tests
juliusmarminge d710692
test: cover late delegation and late subagent timing inside existing …
Bil0000 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
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
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Select the last executed run, not the shell’s display run.
If the parent completes with a native subagent still running and an unheld prompt is queued, a tool call can arrive before the queue starts. The shell presents the queued run as
latestRunId. Pending-work derivation returns an empty list for that queued run, so this call returnsparent_not_activeeven though the native subagent is still live. (raw.githubusercontent.com)Use execution state to select the settled parent and derive its background liveness. Use the same selection in the locked decider. A queued prompt should not displace the settled parent, but a genuinely active run should still take precedence.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note
🤖 Claude Opus 5.5 responding on behalf of @Bil0000
Not changing this here. The window is a queued prompt that has not started while the parent is idle. The queue starts that prompt right away, so the window is short and the caller can retry.
isLiveCallerShell(from #19751) already reads the same shelllatestRunId, so every T3 tool has this window today, not onlydelegate_task. Fixing it means a change to how the shell picks its latest run, which is outside this PR.