Skip to content

feat(ag-ui): interrupt support + cockpit ag-ui section (interrupts + streaming)#567

Merged
blove merged 37 commits into
mainfrom
claude/interesting-mccarthy-5d4ea0
Jun 2, 2026
Merged

feat(ag-ui): interrupt support + cockpit ag-ui section (interrupts + streaming)#567
blove merged 37 commits into
mainfrom
claude/interesting-mccarthy-5d4ea0

Conversation

@blove
Copy link
Copy Markdown
Contributor

@blove blove commented Jun 2, 2026

Summary

Closes the AG-UI adapter's HITL gap and establishes a navigable cockpit ag-ui section with two standalone examples that prove the runtime-neutral Agent contract across adapters.

  • @threadplane/ag-ui interrupt support. Reducer bridges the AG-UI CUSTOM/on_interrupt event into the runtime-neutral Agent.interrupt signal; submit({ resume }) resumes via source.runAgent({ forwardedProps: { command: { resume } } }). The reducer also JSON.parses string-serialized CUSTOM payloads (ag-ui-langgraph ships them as JSON strings via dump_json_safe), so consumers get parsed objects and <chat-approval-card matchKind=…> matches correctly.
  • New cockpit ag-ui section. Registered in libs/cockpit-registry immediately after langgraph, with streaming + interrupts topics.
  • Two standalone examples, both AG-UI-fronted LangGraph. cockpit/ag-ui/interrupts (refund-approval graph using interrupt()) and cockpit/ag-ui/streaming (single streaming chat node) — each Angular + Python (uvicorn + ag-ui-langgraph FastAPI app), each with a MemorySaver checkpointer required by plain uvicorn, each with its own e2e + recorded aimock fixtures. The interrupts example uses the same <chat-approval-card matchKind="refund_approval"> component as cockpit/langgraph/interrupts — the validation that the contract is truly runtime-neutral.
  • AG-UI-specific e2e harness. New createAgUiGlobalSetup in libs/e2e-harness spawns uvicorn (vs the existing langgraph createGlobalSetup which spawns langgraph dev); shared __AIMOCK_HARNESS_STATE__ + global teardown handle both backends. Langgraph e2e path is byte-for-byte unchanged.
  • Ports allocated (4320/5320, 4321/5321), CI cockpit-smoke list updated, ports verifier cleaned up.

Test Plan

  • nx test ag-ui — adapter unit tests including interrupt reducer + resume submit (95 pass)
  • nx test e2e-harness — harness tests (3/3 pass; langgraph factory unchanged)
  • nx test cockpit-registry — manifest ag-ui section registered (one pre-existing failure on cockpit/chat/generative-ui/python/prompts/generative-ui.md, unrelated; predates the merge base)
  • nx smoke cockpit-ag-ui-interrupts-python + cockpit-ag-ui-streaming-python — both green
  • nx build for ag-ui + both new Angular apps (default + cockpit configs) — green
  • nx e2e cockpit-ag-ui-interrupts-angular3/3 pass (approval card appears, approve resumes, cancel skips)
  • nx e2e cockpit-ag-ui-streaming-angular1/1 pass (streamed tokens render)
  • node --test scripts/cockpit-ports.spec.mjs — 7/7 pass
  • cockpit-matrix.mjs discovers both new ag-ui examples for the CI e2e matrix

Design spec: docs/superpowers/specs/2026-05-29-ag-ui-interrupts-cockpit-section-design.md
Implementation plan: docs/superpowers/plans/2026-05-29-ag-ui-interrupts-cockpit-section.md

🤖 Generated with Claude Code

blove and others added 30 commits May 28, 2026 14:22
Source-grounded rewrite of root README + 7 published @threadplane/*
package READMEs. Two-phase approach: verified API/capability inventory
first, then write — every claim traces to an inventory entry to kill
factual drift. Adds net-new a2ui README; surfaces reliability/production
trust signals.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Audits all 7 published @threadplane/* packages and populates the
Ground Truth Appendix in the design spec with verified exported
symbols, peer-dep ranges, sub-path exports, ngaf:* event names,
env vars, CI job names, and test harness locations.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
toAgent() exposes only messages/status/isLoading/error/toolCalls/state
signals; interrupt and subagents are not wired by this adapter. Correct
the inventory's over-claimed capability line too.
…ing dump

Replaces the 163-line partial README with a full developer reference: badges
in root-README shield style, accurate peer-dep list, capability sections for
compositions, primitives, interrupts/HITL, tool calls, subagents, citations,
GenUI/A2UI surfaces, and streaming markdown. Collapses the ~50-token a2ui
theming dump into a tight subsection with four theme presets, two agent knobs,
a short custom-override example, and a docs link. Dual-license story and
commercial-use / provideChat({license}) content preserved verbatim. All symbols
verified against libs/chat/src/public-api.ts; build passes.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…nsparency contract

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…e + reliability framing

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…carthy-5d4ea0

# Conflicts:
#	README.md
#	libs/ag-ui/README.md
#	libs/langgraph/README.md
Closes the ag-ui adapter's interrupt gap (CUSTOM on_interrupt → Agent.interrupt;
resume via forwardedProps.command.resume), registers a navigable ag-ui cockpit
section, adds a standalone ag-ui/interrupts example (ag-ui-fronted LangGraph),
refactors ag-ui/streaming to a real backend, and adds an ag-ui-specific e2e
setup + recorded fixtures.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…signal

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…) after langgraph

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…refund graph)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…card, runtime-neutral parity)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
blove and others added 6 commits May 29, 2026 14:54
… refund fixtures)

Also fixes two bugs discovered during test execution:
- graph.py: add MemorySaver checkpointer so ag_ui_langgraph can call aget_state
- reducer.ts: parse JSON-string CUSTOM event values before storing interrupt signal

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…treaming chat graph)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…+ cockpit embedding parity

Swaps provideFakeAgent for provideAgent({ url: '/agent' }) + provideChat({}),
replaces static proxy.conf.json with dynamic proxy.conf.mjs (port 5321),
adds main.cockpit.ts + cockpit build config + e2e target to project.json,
strips agUiUrl from environments, adds libs/cockpit-telemetry tsconfig ref,
and updates index.ts codeAssetPaths + backendAssetPaths to real files.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…streaming fixtures)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Also removes the stale AGUI_EXCEPTION guard from cockpit-ports.spec.mjs
now that both ag-ui projects are registered in cockpit/ports.mjs.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@vercel
Copy link
Copy Markdown

vercel Bot commented Jun 2, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
threadplane Ready Ready Preview, Comment Jun 2, 2026 9:02pm

Request Review

…carthy-5d4ea0

# Conflicts:
#	libs/ag-ui/README.md
#	libs/langgraph/README.md
@blove blove merged commit 53e61d6 into main Jun 2, 2026
17 of 18 checks passed
blove added a commit that referenced this pull request Jun 4, 2026
Pre-existing failure inherited from main:
- cockpit-e2e-wiring.spec.ts parsed only 'langgraphCwd' from
  global-setup-impl.ts, but ag-ui examples use 'pythonCwd' (the
  createAgUiGlobalSetup field). Accept either.
- capability-registry.ts had the old "FakeAgent, no Python backend"
  shape for ag-ui-streaming (port 4600) and no entry for the new
  ag-ui-interrupts example. Update both to match the real uvicorn
  ag-ui-langgraph backend ports (4320/5320 + 4321/5321 from
  cockpit/ports.mjs).
blove added a commit that referenced this pull request Jun 4, 2026
…port; fix docs (#569)

* docs(spec): render VIEW_REGISTRY drift + chat re-export cleanup + nits

Closes a chain of compounding bugs: render exports public API with no
engine behavior; chat leaks render tokens into its surface; chat README's
markdown override example is broken three ways. Adds overrideViews,
wires VIEW_REGISTRY into the render engine, drops chat's re-export,
fixes all documentation (README + chat markdown guide + render views
API + CHANGELOG + regenerated api-docs.json). Plus three nits: ag-ui
README interrupt docs + new docs guide, .gitignore Playwright dirs,
rename dashboard.md → generative-ui.md.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* docs(plan): render VIEW_REGISTRY drift + chat re-export cleanup + nits implementation plan

* feat(render): add overrideViews helper for override-semantics composition

* feat(render): wire VIEW_REGISTRY as third-priority registry fallback in engine

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* refactor(chat): drop re-export of provideViews/VIEW_REGISTRY from @threadplane/render

* docs(chat): fix markdown view override example (MARKDOWN_VIEW_REGISTRY + overrideViews)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* docs(website): correct markdown view override path in chat guide

Fix the chat markdown guide to use MARKDOWN_VIEW_REGISTRY (correct
token), overrideViews from @threadplane/render (not the old provideViews
pattern), and 'code-block' (not 'code') as the node-type key. Add
app-wide and per-instance override examples, a 22-entry node-type
reference table, overrideViews-vs-withViews callout, and brief theming
cross-link.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* docs(render): document engine resolution order + overrideViews helper

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* docs(website): add overrideViews + clarify provideViews engine consumption

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* docs(website): regenerate API JSON for chat re-export drop + render overrideViews

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* docs(ag-ui): document Agent.interrupt + submit({ resume }) HITL feature

* docs(website): add ag-ui interrupts guide + register in nav

New guide covers the AG-UI HITL contract: CUSTOM on_interrupt wire
format, dump_json_safe auto-parsing, submit({ resume }) flow, and
cross-adapter parity with the LangGraph guide. Registers the page in
the ag-ui Guides section of docs-config.ts.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* chore: gitignore Playwright test-results under cockpit examples

* fix(cockpit): rename dashboard.md → generative-ui.md to match manifest convention

* fix(cockpit): align e2e wiring test with post-#567 ag-ui example shape

Pre-existing failure inherited from main:
- cockpit-e2e-wiring.spec.ts parsed only 'langgraphCwd' from
  global-setup-impl.ts, but ag-ui examples use 'pythonCwd' (the
  createAgUiGlobalSetup field). Accept either.
- capability-registry.ts had the old "FakeAgent, no Python backend"
  shape for ag-ui-streaming (port 4600) and no entry for the new
  ag-ui-interrupts example. Update both to match the real uvicorn
  ag-ui-langgraph backend ports (4320/5320 + 4321/5321 from
  cockpit/ports.mjs).

---------

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