feat(examples-chat): Phase 3A — interrupts (HITL)#222
Merged
Conversation
Layers human-in-the-loop interrupts onto the canonical demo by adding
a request_approval tool that calls langgraph.types.interrupt() to
pause the graph mid-execution. Wires chat-interrupt-panel into the
demo shell with action handlers that resume via
agent.submit(null, command={resume}).
Tool-driven (vs topology node or conditional edge): the AI decides
when HITL fires; stacks on top of Phase 2B's tools ToolNode wiring;
zero new graph edges. Four-action vocabulary (accept/edit/respond/
ignore) maps to Command(resume=value). One welcome suggestion
exercises the database-backups scenario.
Phase 3B (subagents) deferred to its own spec/plan/PR cycle.
~90 LOC across python graph + 3 angular shell files + tests +
checklist.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Six-phase plan: branch; python TDD (failing request_approval + topology-regression tests then implement tool body using langgraph.types.interrupt + ToolNode binding + system-prompt extension); angular shell wiring (ChatInterruptPanelComponent import + onInterruptAction handler + @if(agent.interrupt) HTML block + CSS positioning); welcome suggestion entry; CHECKLIST additions; verification + PR. ~90 LOC, 4 commits. Server-side probe confirms interrupt -> Command(resume) -> final answer cycle. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
blove
added a commit
that referenced
this pull request
May 9, 2026
* feat(examples-chat-python): research subagent + tool * feat(examples-chat-angular): register research as a subagent tool * feat(examples-chat-angular): mount chat-subagents in demo shell * feat(examples-chat-angular): welcome suggestion exercising subagents * docs(examples-chat-smoke): populate Subagents checklist * docs(spec): canonical examples/chat Phase 3B subagents 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> * docs(plan): canonical examples/chat Phase 3B subagents plan 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> --------- Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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
request_approvaltool to the LangGraph chat graph that callsinterrupt()to pause the run for human-in-the-loop confirmation before destructive actions<chat-interrupt-panel>in the demo shell with anonInterruptActionhandler that resumes the graph viaagent.submit(null, { command: { resume } })for accept / edit / respond / ignoreVerification
Server-side end-to-end probe confirms the interrupt + resume cycle works:
tool_callforrequest_approvalwithreason: \"User plans to delete old database backups older than 90 days...\"next: ['tools']with interrupt value{type: 'approval_request', reason: ...}command={resume: 'approved'}→ 4 total messages, final AI text walks through the deletion planSpec:
docs/superpowers/specs/2026-05-08-canonical-chat-demo-phase-3a-interrupts-design.mdPlan:
docs/superpowers/plans/2026-05-08-canonical-chat-demo-phase-3a-interrupts.mdTest plan
<chat-interrupt-panel>renders with the AI's reason🤖 Generated with Claude Code