Commit 8fb2ca5
fix(examples-chat-python): research tool passes subagent_type so SubagentTracker registers (#225)
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>1 parent 1e91bf5 commit 8fb2ca5
1 file changed
Lines changed: 15 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
58 | 58 | | |
59 | 59 | | |
60 | 60 | | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | | - | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
65 | 66 | | |
66 | 67 | | |
67 | 68 | | |
| |||
178 | 179 | | |
179 | 180 | | |
180 | 181 | | |
181 | | - | |
| 182 | + | |
182 | 183 | | |
183 | 184 | | |
184 | 185 | | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
185 | 191 | | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
186 | 196 | | |
187 | 197 | | |
188 | 198 | | |
| |||
0 commit comments