Skip to content

feat(examples-chat): Phase 3A — interrupts (HITL)#222

Merged
blove merged 6 commits into
mainfrom
claude/examples-chat-phase-3a-interrupts
May 9, 2026
Merged

feat(examples-chat): Phase 3A — interrupts (HITL)#222
blove merged 6 commits into
mainfrom
claude/examples-chat-phase-3a-interrupts

Conversation

@blove
Copy link
Copy Markdown
Contributor

@blove blove commented May 9, 2026

Summary

  • Adds request_approval tool to the LangGraph chat graph that calls interrupt() to pause the run for human-in-the-loop confirmation before destructive actions
  • Mounts <chat-interrupt-panel> in the demo shell with an onInterruptAction handler that resumes the graph via agent.submit(null, { command: { resume } }) for accept / edit / respond / ignore
  • Adds a welcome suggestion exercising the approval flow (delete database backups older than 90 days)
  • Updates the smoke CHECKLIST with the Interrupts / human-in-the-loop section

Verification

Server-side end-to-end probe confirms the interrupt + resume cycle works:

  • Initial submit with the database-backups welcome prompt → 2 messages, AI emitted tool_call for request_approval with reason: \"User plans to delete old database backups older than 90 days...\"
  • Thread state showed next: ['tools'] with interrupt value {type: 'approval_request', reason: ...}
  • Resume with command={resume: 'approved'} → 4 total messages, final AI text walks through the deletion plan

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

Test plan

  • CI passes (lint, build, tests)
  • Live smoke: trigger the approval welcome suggestion, verify <chat-interrupt-panel> renders with the AI's reason
  • Click "Approve" → graph resumes, AI continues with the deletion plan
  • Click "Reject" / "Edit" / "Respond" → each surfaces the corresponding resume value to the graph

🤖 Generated with Claude Code

blove and others added 6 commits May 8, 2026 21:30
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>
@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 4:37am

Request Review

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