Uh oh!
There was an error while loading. Please reload this page.
fix: route child session events to parent ACP session (#21802) - #25165
fix: route child session events to parent ACP session (#21802)#25165only21mil wants to merge 1 commit into
Conversation
ACPSessionManager only tracked sessions created via session/new or
session/load. Child sessions spawned by the Task tool via
Session.create({ parentID: ... }) were never registered, causing
handleEvent() to silently drop all sub-agent events (tool calls,
text streaming, permission requests).
Added childToRoot map in ACPSessionManager to resolve child session
IDs to their root ACP session. Added session.created handler in
agent.ts to register child sessions when the Task tool spawns them,
and session.deleted handler for cleanup.
Closesanomalyco#21802This PR doesn't fully meet our contributing guidelines and PR template. What needs to be fixed:
Please edit this PR description to address the above within 2 hours, or it will be automatically closed. If you believe this was flagged incorrectly, please let a maintainer know. |
The following comment was made by an LLM, it may be inaccurate: Potential duplicate found:
You should check if #21801 has already been merged or if it was abandoned, as they appear to be addressing the same underlying issue (#21802). |
This pull request has been automatically closed because it was not updated to meet our contributing guidelines within the 2-hour window. Feel free to open a new pull request that follows our guidelines. |
Summary
Root Cause
ACPSessionManageronly tracked sessions created viasession/neworsession/load. Child sessions spawned by the Task tool viaSession.create({ parentID: ... })were never registered, causinghandleEvent()to silently drop all sub-agent events — tool calls, text streaming, and permission requests.Changes
packages/opencode/src/acp/session.ts(+22,-1): AddedchildToRootmap,registerChild(),unregisterChild(), and updatedtryGet()to check the child→root mappingpackages/opencode/src/acp/agent.ts(+13): Addedsession.createdhandler to register child sessions, andsession.deletedhandler for cleanupTest Results
Closes#21802