fix(examples-chat): research tool passes subagent_type so SubagentTracker registers#225
Merged
Merged
Conversation
…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>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
Test plan
🤖 Generated with Claude Code