Skip to content

fix(examples-chat): research tool passes subagent_type so SubagentTracker registers#225

Merged
blove merged 1 commit into
mainfrom
claude/fix-examples-chat-research-subagent-type
May 9, 2026
Merged

fix(examples-chat): research tool passes subagent_type so SubagentTracker registers#225
blove merged 1 commit into
mainfrom
claude/fix-examples-chat-research-subagent-type

Conversation

@blove
Copy link
Copy Markdown
Contributor

@blove blove commented May 9, 2026

Summary

Phase 3B (PR #224) merged with a working python graph and Angular shell wiring, but live smoke against the demo revealed <chat-subagents> never surfaced a card during the research run. Root cause: `@ngaf/langgraph` SubagentTracker silently skips tool calls whose args don't include a valid `subagent_type` string — the demo's research tool only carried `topic`, so the tracker rejected the registration and `agent.subagents()` stayed empty.

Adds `subagent_type: str = "research"` to the research tool signature (consumed only as a UI hint — body deletes it before invoking the subgraph) and instructs the parent in `SYSTEM_PROMPT` to pass it.

Verification

Live smoke against the workspace examples/chat demo after the fix:

  • `agent.subagents().size === 1` after the parent dispatches the research tool ✅
  • Map entry: `{ id: "call_", status: "complete" }` after the subagent returns ✅
  • `` panel wrapper renders (the @if gate is satisfied by tracker map size) ✅
  • Card flashes briefly during the active window; `activeSubagents()` filter hides it post-complete (spec-acknowledged behavior — persistent post-complete display is a Phase 4+ concern) ✅
  • Final AI message returns the research summary; pytest still 8 passed ✅

Test plan

  • CI green (8 pytest, lint, build, e2e)
  • No regressions to Phase 3B's existing demo flow

🤖 Generated with Claude Code

…gentTracker registers

The @ngaf/langgraph SubagentTracker silently skips tool calls whose args
do not include a valid `subagent_type` string (matching the canonical
LangGraph `task` tool shape). Without it, `agent.subagents()` stays empty
and `<chat-subagents>` never surfaces a card during the research run.

Adds `subagent_type: str = "research"` to the tool signature (consumed
only as a UI hint — the body deletes it before invoking the subgraph)
and instructs the parent in SYSTEM_PROMPT to pass it. The result: the
SubagentTracker registers the subagent on tool-call dispatch, the panel
mounts during the active window, and (per the existing primitive's
active-only filter) the card hides cleanly once the subagent completes.

Verified live: agent.subagents() reports size=1 with the research tool
call id and status transitions through to 'complete' as the subagent
returns. End-state panel wrapper still renders because the tracker map
retains the entry; the inner @for filters complete subagents out.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@vercel
Copy link
Copy Markdown

vercel Bot commented May 9, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
cacheplane Ready Ready Preview, Comment May 9, 2026 6:01am

Request Review

@blove blove merged commit 8fb2ca5 into main May 9, 2026
14 checks passed
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