Skip to content

feat: add native ACP subagent sessions - #419

Open
nikita-ashihmin wants to merge 10 commits into
agentclientprotocol:mainfrom
nikita-ashihmin:codex/acp-subagent-sessions
Open

feat: add native ACP subagent sessions#419
nikita-ashihmin wants to merge 10 commits into
agentclientprotocol:mainfrom
nikita-ashihmin:codex/acp-subagent-sessions

Conversation

@nikita-ashihmin

@nikita-ashihmin nikita-ashihmin commented Aug 20, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • negotiate the ACP subagents capability
  • expose Codex collaborators as independent child session streams
  • route nested messages, tools, approvals, and elicitations to the correct child
  • emit exactly-once terminal lifecycle updates and keep the parent prompt open until announced children finish
  • preserve legacy tool-call representation for clients without the capability

Compatibility

The published ACP SDK does not yet contain PR #1992 types, so the change isolates the temporary structural types in src/subagents/AcpSubagents.ts. Codex aggregate app-server notifications currently omit collaborator nickname/role; the adapter therefore uses a stable synthetic display name until that transport exposes them.

Async task scope

Codex app-server V2 currently exposes no independent background-task instance lifecycle with a stable task ID, progress, and terminal state. Legacy task_started / task_complete events represent the foreground turn, command executions remain ACP tool calls, and scheduled-task summaries describe plugin configuration rather than running work. This PR therefore does not advertise or synthesize AIR asyncTasks; support can be added when app-server exposes a real task lifecycle.

Validation

  • npm run typecheck
  • npm run build
  • npm test (447 passed, 28 skipped)

Keep spawn and terminal lifecycle retryable when ACP delivery fails, and ensure prompt cleanup continues when the client disconnects.
Negotiate native sessions through AIR metadata while released ACP SDKs strip the draft canonical field. Normalize provider activity into child sessions, preserve nested routing, and exclude the root participant from subagent lifecycle.
Match Codex's sentence-style display names by replacing path separators within agent names and capitalizing the result.
@nikita-ashihmin
nikita-ashihmin force-pushed the codex/acp-subagent-sessions branch from e0caacc to 3e33afa Compare August 25, 2026 13:44
Keep child turn state isolated from the root prompt and preserve pending
subagent identity until activity arrives. Scope permission correlation by
thread so concurrent children continue to receive approvals and elicitations.
Buffer child traffic until identity is announced, preserve immutable lifecycle
generations, and replay native child history with disconnected orphan states.
Keep permissions and cancellation ordered across parent and child sessions.
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.

1 participant