feat(agentic): add explicit background subagent result waiting - #1635
Merged
Conversation
wsp1911
marked this pull request as ready for review
July 19, 2026 14:33
- add AgentWait for collecting parent-owned background task outcomes - stop automatically delivering background subagent results to parent sessions - return background task IDs from Task and remove allow_review_follow_up - expose AgentWait in agent modes and the web delegation tool group
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.
Summary
Replace automatic background-subagent result delivery with explicit
AgentWaitcollection.AgentWaittool.Taskcalls returnbackground_task_id; completed results no longer wake or inject into the parent session automatically.allow_review_follow_upcontrol and exposeAgentWaitin applicable agent modes and the Web UI delegation group.Type and Areas
Type:
Feature / regression fix
Areas:
Rust core, agent runtime, web UI
Motivation / Impact
Automatic result delivery could wake a parent session after it had independently completed its work, while parents that depended on a result could appear to stop prematurely. Background work is now collected only when the parent explicitly calls
AgentWait.A background
Taskresponse now includesbackground_task_id. Agents whose final answer depends on background work must callAgentWait; otherwise they can finish without being reactivated by a late result.Verification
pnpm run fmt:rspassed.cargo check -p bitfun-core --tests -j 1passed.bitfun-corelib tests passed foragent_wait_tool, one-time outcome consumption, timeout retention, and Task schema removal ofallow_review_follow_up.pnpm --dir src/web-ui run test:run src/app/scenes/agents/components/toolGroups.test.tspassed (6 tests).pnpm run type-check:webpassed.git diff --cached --checkpassed.Reviewer Notes
AgentWaitcan target explicit task IDs or collect unconsumed background outcomes from the current parent turn.AgentWait; a timeout leaves unfinished tasks available for a later wait.Checklist