Skip to content

fix(langgraph): extract __interrupt__ from values/updates events#223

Merged
blove merged 1 commit into
mainfrom
claude/fix-langgraph-interrupt-from-updates
May 9, 2026
Merged

fix(langgraph): extract __interrupt__ from values/updates events#223
blove merged 1 commit into
mainfrom
claude/fix-langgraph-interrupt-from-updates

Conversation

@blove
Copy link
Copy Markdown
Contributor

@blove blove commented May 9, 2026

Summary

LangGraph emits interrupts as part of `values` and `updates` events under the special `interrupt` key, not as standalone `interrupt` events. The `@ngaf/langgraph` bridge was only handling the latter, so `agent.interrupt()` / `agent.interrupts()` never populated for real graphs — any UI gated on those signals (e.g. ``) stayed hidden.

Adds an `extractInterrupts` helper called from the values/updates branches that:

  • Mirrors `interrupt` payloads onto `interrupt$` (latest) and `interrupts$` (full list)
  • Clears both subjects when a values/updates event arrives without an `interrupt` key — LangGraph does not emit a separate "cleared" event, so the absence is the dismissal signal once a resume completes

Verification

Live smoke against the canonical `examples/chat` demo (issue surfaced as Finding H during the Phase 3A re-smoke):

  • Trigger the approval welcome suggestion → `` renders with the AI's reason ✅
  • Accept → graph resumes, panel dismisses, AI continues with deletion plan ✅
  • Edit (custom resume value) → graph resumes, panel dismisses ✅
  • Respond → graph resumes with the typed text, panel dismisses ✅
  • Ignore → graph resumes with denial, panel dismisses ✅

Test plan

  • CI passes (langgraph unit tests, build, e2e)
  • No regressions to existing `agent.interrupt` / `agent.interrupts` consumers

🤖 Generated with Claude Code

LangGraph emits interrupts as part of `values` and `updates` events under
the special `__interrupt__` key, not as standalone `interrupt` events.
The bridge was only handling the latter, so `agent.interrupt()` /
`agent.interrupts()` never populated for real graphs and any UI gated on
those signals (e.g. <chat-interrupt-panel>) stayed hidden.

Adds an `extractInterrupts` helper called from the values/updates branches
that:

  - Mirrors `__interrupt__` payloads onto `interrupt$` (latest) and
    `interrupts$` (full list).
  - Clears both subjects when a values/updates event arrives without an
    `__interrupt__` key — LangGraph does not emit a separate "cleared"
    event, so the absence is the dismissal signal once a resume completes.

Verified end-to-end against the canonical examples/chat demo: the
approval welcome suggestion now surfaces <chat-interrupt-panel>, and all
four actions (Accept / Edit / Respond / Ignore) resume the graph and
dismiss the panel correctly.

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:56am

Request Review

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