Skip to content

fix: route child session events to parent ACP session (#21802)#25165

Closed
only21mil wants to merge 1 commit intoanomalyco:devfrom
only21mil:fix/acp-child-session-events
Closed

fix: route child session events to parent ACP session (#21802)#25165
only21mil wants to merge 1 commit intoanomalyco:devfrom
only21mil:fix/acp-child-session-events

Conversation

@only21mil
Copy link
Copy Markdown

Summary

Root Cause

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, and permission requests.

Changes

  • packages/opencode/src/acp/session.ts (+22,-1): Added childToRoot map, registerChild(), unregisterChild(), and updated tryGet() to check the child→root mapping
  • packages/opencode/src/acp/agent.ts (+13): Added session.created handler to register child sessions, and session.deleted handler for cleanup

Test Results

  • Typecheck: 13/13 packages pass
  • ACP tests: 11/11 pass
  • Session tests: 319/319 pass (0 fail)

Closes #21802

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.

Closes anomalyco#21802
@github-actions
Copy link
Copy Markdown
Contributor

This PR doesn't fully meet our contributing guidelines and PR template.

What needs to be fixed:

  • PR description is missing required template sections. Please use the PR template.

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.

@github-actions github-actions Bot added the needs:compliance This means the issue will auto-close after 2 hours. label Apr 30, 2026
@github-actions
Copy link
Copy Markdown
Contributor

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).

@github-actions
Copy link
Copy Markdown
Contributor

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.

@github-actions github-actions Bot removed the needs:compliance This means the issue will auto-close after 2 hours. label Apr 30, 2026
@github-actions github-actions Bot closed this Apr 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ACP clients cannot see subagent activity from Task tool

1 participant