Skip to content

feat(examples-chat): Phase 3B — subagents#224

Merged
blove merged 7 commits into
mainfrom
claude/examples-chat-phase-3b-subagents
May 9, 2026
Merged

feat(examples-chat): Phase 3B — subagents#224
blove merged 7 commits into
mainfrom
claude/examples-chat-phase-3b-subagents

Conversation

@blove
Copy link
Copy Markdown
Contributor

@blove blove commented May 9, 2026

Summary

Layers subagents onto the canonical demo by adding a compiled child graph (research) that the parent dispatches as a tool. Surfaces <chat-subagents> in the demo shell. Adds one welcome suggestion.

  • Python graph: ResearchState TypedDict + research_node async function + compiled research_subgraph (single-node child graph) + research @tool whose body awaits research_subgraph.ainvoke(...). Bound on the parent in 2 places (bind_tools, ToolNode); zero new graph edges. SYSTEM_PROMPT extended by one paragraph instructing the parent to dispatch research for in-depth topic questions.
  • Angular adapter config: subagentToolNames: ['research'] passed to the agent({...}) factory in demo-shell.component.ts. This populates agent.subagents() from tools:<id>-namespaced child stream events that the SubagentTracker keys on.
  • Demo shell: import ChatSubagentsComponent from @ngaf/chat; add to imports array; mount <chat-subagents [agent]="agent" /> in a fixed-position panel above the chat input via @if (agent.subagents && agent.subagents().size > 0).
  • Welcome suggestion: 9th entry "Demo: dispatch a research subagent".
  • CHECKLIST.md: Subagents section populated.

<chat-subagents> filters to active (non-complete) subagents internally, so the card flashes during the child run and disappears once the parent has the summary back. Persisting the card after completion is a Phase 4+ concern.

Spec: docs/superpowers/specs/2026-05-08-canonical-chat-demo-phase-3b-subagents-design.md
Plan: docs/superpowers/plans/2026-05-08-canonical-chat-demo-phase-3b-subagents.md

Phase 4+ (generative UI, time travel, multi-thread) is later.

Test plan

Verified locally

  • `nx run examples-chat-python:smoke` — 8 passed (6 existing + 2 new)
  • `nx run examples-chat-angular:test` — 9 passed
  • `nx run examples-chat-angular:lint` — 0 errors
  • `nx run examples-chat-angular:build` — succeeds (development)
  • Server-side end-to-end probe: submit the standalone-components welcome prompt with model=gpt-5-mini. Final messages: 4 total, AI tool_call with `name: 'research'` and `args.topic` containing the topic, ToolMessage with the subagent's summary, final AI message (no tool_calls) with a substantive summary referencing standalone components.
  • Stream-events probe (`stream_subgraphs: true`): 366 `research_node` mentions in the SSE stream including `langgraph_node:research_node` and `tools:` namespace prefixes — confirms child subgraph events flow with the namespace shape SubagentTracker keys on.

Pending visual verification

  • After merge: live smoke against the workspace `examples/chat` demo. `` panel appears above the chat input while the research subagent runs; disappears once the parent emits its final summary.

(Visual sweep continues against issue #214; rolls together with the next iteration.)

🤖 Generated with Claude Code

blove and others added 7 commits May 8, 2026 22:35
Splits Phase 3 of the canonical demo's roadmap into 3A (interrupts —
shipped in PRs #222 + #223) and this 3B (subagents). Adds a compiled
child graph (`research`) the parent dispatches as a tool, surfaces
`<chat-subagents>` in the demo shell, and adds one welcome suggestion.

Mirrors Phase 3A's shape: ~90 LOC, single PR, TDD'd python graph +
Angular shell wiring + welcome suggestion + CHECKLIST + verification.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Single-subagent-dispatch plan for Phase 3B. ~90 LOC across 7 phased
tasks (Phases 0-6). TDD'd python graph (research subgraph + tool),
Angular adapter config (subagentToolNames), shell wiring (chat-subagents
mount), welcome suggestion, CHECKLIST, server-side verification probe,
and PR open. Mirrors the Phase 3A plan format committed at daf31f89.

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 5:43am

Request Review

@blove blove merged commit 1e91bf5 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