Repository navigation
Description
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): carrytoolNameandparentToolUseIdfrom_meta.claudeCodeon 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): anAgent/Tasktool becomes adelegatestep that spawns a sub-agent named after its description; a tool withparentToolUseId(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
_metamapping 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
Merge pull request #463 from Code-XR-Project/claude/project-thread-oe…
Merge pull request #464 from Code-XR-Project/claude/project-thread-oe…