Repository navigation
fix(server): reject waits on foreground subagent background work #25036
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
base: main
Are you sure you want to change the base?
Changes from all commits
6080a60
c367f8c
ad750f8
20e3bcf
f98ce51
b8ccd0c
470adae
1e5030f
ec268f1
38b69d2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -13354,7 +13354,17 @@ export const makeClaudeAdapterV2 = Effect.fn("makeClaudeAdapterV2")(function* ( | |
| yield* Ref.get(pendingBackgroundTasksByNativeThread), | ||
| nativeThreadId, | ||
| ); | ||
| const matched = [...new Set(taskIds)].filter((taskId) => roster.has(taskId)); | ||
| const backgroundedSubagents = yield* Ref.get(backgroundedSubagentTaskIds); | ||
| // A foreground subagent's background work dies with its turn and never wakes the root. | ||
| const matched = [...new Set(taskIds)].filter((taskId) => { | ||
| const task = roster.get(taskId); | ||
| if (task === undefined) return false; | ||
| return ( | ||
| !awaited || | ||
| task.parentTaskId === undefined || | ||
| backgroundedSubagents.has(task.parentTaskId) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Preserve waits for nested background subagents. If a subagent starts with Track background ownership separately from root-wake eligibility. Include nested background owners in the ownership check without changing their completion routing.
|
||
| ); | ||
| }); | ||
| if (matched.length === 0) return { matched }; | ||
| if (awaited) { | ||
| yield* addTaskIdsToNativeThreadSet( | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.