Skip to content

Agent Flow: sub-agents of IDE Claude Code chats never leave the hangar #459

Backlog

Description

@aMonteSl

As a developer watching a Code-XR IDE chat with Claude Code in Agent Flow
I want the sub-agents that Claude Code launches to take off from the hangar as their own UFOs
so that the sub-agent hangar (#453) works for live IDE chats, not only for recorded transcripts.

Bug

Found in Adrián's manual test of #453 (IDE, real Claude Code chat, 3-dic): the hangar was built, but no sub-agent UFO left it, although the chat launched sub-agents.

Cause

"Watch in XR" in the IDE reads the chat through ACP, not through the Claude Code transcript. Claude Code's ACP adapter names each tool and its owning sub-agent only in _meta.claudeCode (toolName, parentToolUseId), and the IDE dropped _meta when it mapped tool_call / tool_call_update. Agent Flow therefore saw the Agent/Task call as a plain think step with no sub-agent, and every tool the sub-agents ran as work of the main agent. With no sub-agent actors, the hangar never opened.

The plugin reads transcripts (subagents/agent-*.jsonl) and was not affected.

Fix

  • IDE (acpMapping.ts): carry toolName and parentToolUseId from _meta.claudeCode on tool events, store them on the transcript's tool cards and replay them when a chat is seeded (agentFlowFeed.ts).
  • Core (acpSessionEvents.ts, shared by both hosts): an Agent / Task tool becomes a delegate step that spawns a sub-agent named after its description; a tool with parentToolUseId (and a permission asked for it) runs as that sub-agent.

Acceptance criteria

  • In a new IDE chat with Claude Code that launches sub-agents, Watch in XR shows the main UFO going to the control tower and each sub-agent taking off from its hangar bay, working, and landing back.
  • The sub-agents' reads, edits and commands are drawn on their own UFOs, not on the main one.
  • Reopening the chat later (seeded from its stored transcript) draws the same sub-agents.
  • Unit tests: core ACP mapper (delegate + sub-agent actors in the dataset), IDE _meta mapping and feed (live and seeded).

Note: chats recorded before this fix have no _meta stored, so they keep showing only the main agent.


Generated by Claude Code

Activity

  1. self-assigned this
    on Dec 3, 2026
  2. added
    bug
    tfm
    user-story
    area: ide
    area: extension
    on Dec 3, 2026
  3. added 2 commits that reference this issue on Dec 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area: extensionarea: idebugstream: agent-flowtfmuser-story

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions