Skip to content

Commit d7db181

Browse files
committed
feat(claude-sdk-python): add not-supported stubs for interrupt demos
Adds page.tsx + README stubs for gen-ui-interrupt and interrupt-headless. Both rely on LangGraph's graph-level interrupt() / Command(resume=...) primitive, which the Claude Agent SDK's Anthropic Messages stream does not expose. Stubs explain the gap and link users to the hitl / hitl-in-app cells, which model approval gating with regular tool calls.
1 parent 36ffb40 commit d7db181

4 files changed

Lines changed: 143 additions & 0 deletions

File tree

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Gen UI Interrupt — Not Supported
2+
3+
## Why It's Not Supported
4+
5+
The langgraph `useInterrupt` flow depends on the LangGraph runtime's built-in `interrupt()` primitive — a graph-level pause/resume protocol with thread-scoped checkpointing and `Command(resume=...)` semantics.
6+
7+
The Claude Agent SDK's Anthropic Messages stream has no equivalent. There is no graph, no checkpointer, and no resume primitive — so there's nothing to map `useInterrupt` onto.
8+
9+
## What To Use Instead
10+
11+
For human-in-the-loop on this backend, see:
12+
13+
- **`hitl`** — in-chat approval gate using a regular tool call. The agent proposes steps, the user approves/rejects in chat, and the same tool call resolves with the user's decision.
14+
- **`hitl-in-app`** — out-of-chat approval modal driven by `useFrontendTool` with an async handler.
15+
16+
Both model approval gating without requiring a graph-level interrupt primitive.
17+
18+
## Reference
19+
20+
- [langgraph-python `gen-ui-interrupt`](../../../../../langgraph-python/src/app/demos/gen-ui-interrupt) — the canonical implementation, for context.
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
"use client";
2+
3+
/**
4+
* Gen UI Interrupt — NOT SUPPORTED on Claude Agent SDK (Python).
5+
*
6+
* The langgraph `useInterrupt` flow depends on the LangGraph runtime's
7+
* built-in `interrupt()` primitive (a graph-level pause/resume protocol
8+
* with thread-scoped checkpointing). The Claude Agent SDK does not expose
9+
* an equivalent primitive — its Anthropic Messages stream has no
10+
* pause/resume/`Command(resume=...)` semantics.
11+
*
12+
* For human-in-the-loop on this backend see the `hitl` and `hitl-in-app`
13+
* cells, both of which model approval gating with regular tool calls
14+
* rather than graph-level interrupts.
15+
*/
16+
17+
import React from "react";
18+
import Link from "next/link";
19+
20+
export default function GenUiInterruptUnsupported() {
21+
return (
22+
<div className="flex h-screen w-full items-center justify-center p-6">
23+
<div className="max-w-xl rounded-2xl border border-[#E5E5ED] bg-white/80 p-8 shadow-[0_10px_40px_-10px_rgba(99,102,241,0.18)] backdrop-blur-sm">
24+
<p className="text-xs font-medium uppercase tracking-wider text-[#7C7C8A]">
25+
Not supported on this integration
26+
</p>
27+
<h1 className="mt-2 text-2xl font-semibold tracking-tight text-[#010507]">
28+
Gen UI Interrupt
29+
</h1>
30+
<p className="mt-3 text-sm text-[#3A3A46]">
31+
The <code>useInterrupt</code> flow depends on LangGraph&apos;s built-in
32+
graph-level <code>interrupt()</code> / <code>Command(resume=...)</code>{" "}
33+
protocol. The Claude Agent SDK&apos;s Anthropic Messages stream has
34+
no equivalent pause/resume primitive, so this demo is not available
35+
on the claude-sdk-python integration.
36+
</p>
37+
<p className="mt-3 text-sm text-[#3A3A46]">
38+
For human-in-the-loop on this backend, see the{" "}
39+
<Link className="font-medium text-[#6366F1] underline" href="/demos/hitl">
40+
hitl
41+
</Link>{" "}
42+
and{" "}
43+
<Link
44+
className="font-medium text-[#6366F1] underline"
45+
href="/demos/hitl-in-app"
46+
>
47+
hitl-in-app
48+
</Link>{" "}
49+
cells — both model approval gating with regular tool calls rather
50+
than graph-level interrupts.
51+
</p>
52+
</div>
53+
</div>
54+
);
55+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Headless Interrupt — Not Supported
2+
3+
## Why It's Not Supported
4+
5+
This demo drives the same LangGraph `interrupt()` primitive as `gen-ui-interrupt` — just from a plain button grid instead of a chat-rendered card. The Claude Agent SDK has no equivalent graph-level pause/resume primitive, so this flow cannot be ported.
6+
7+
## What To Use Instead
8+
9+
For human-in-the-loop on this backend, see:
10+
11+
- **`hitl`** — in-chat approval gate using a regular tool call.
12+
- **`hitl-in-app`** — out-of-chat approval modal driven by `useFrontendTool`.
13+
14+
## Reference
15+
16+
- [langgraph-python `interrupt-headless`](../../../../../langgraph-python/src/app/demos/interrupt-headless) — the canonical implementation, for context.
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
"use client";
2+
3+
/**
4+
* Interrupt Headless — NOT SUPPORTED on Claude Agent SDK (Python).
5+
*
6+
* The headless-interrupt cell drives the same LangGraph `interrupt()`
7+
* primitive as `gen-ui-interrupt` — just from a plain button grid instead
8+
* of a chat-rendered card. The Claude Agent SDK has no equivalent
9+
* pause/resume primitive, so this cell is not available on the
10+
* claude-sdk-python integration.
11+
*
12+
* For human-in-the-loop on this backend see `hitl` and `hitl-in-app`.
13+
*/
14+
15+
import React from "react";
16+
import Link from "next/link";
17+
18+
export default function InterruptHeadlessUnsupported() {
19+
return (
20+
<div className="flex h-screen w-full items-center justify-center p-6">
21+
<div className="max-w-xl rounded-2xl border border-[#E5E5ED] bg-white/80 p-8 shadow-[0_10px_40px_-10px_rgba(99,102,241,0.18)] backdrop-blur-sm">
22+
<p className="text-xs font-medium uppercase tracking-wider text-[#7C7C8A]">
23+
Not supported on this integration
24+
</p>
25+
<h1 className="mt-2 text-2xl font-semibold tracking-tight text-[#010507]">
26+
Headless Interrupt
27+
</h1>
28+
<p className="mt-3 text-sm text-[#3A3A46]">
29+
This demo resolves LangGraph <code>interrupt()</code> events from a
30+
plain button grid (no chat). The Claude Agent SDK has no
31+
equivalent graph-level pause/resume primitive, so the headless
32+
interrupt flow is not available on the claude-sdk-python
33+
integration.
34+
</p>
35+
<p className="mt-3 text-sm text-[#3A3A46]">
36+
For human-in-the-loop on this backend, see the{" "}
37+
<Link className="font-medium text-[#6366F1] underline" href="/demos/hitl">
38+
hitl
39+
</Link>{" "}
40+
and{" "}
41+
<Link
42+
className="font-medium text-[#6366F1] underline"
43+
href="/demos/hitl-in-app"
44+
>
45+
hitl-in-app
46+
</Link>{" "}
47+
cells.
48+
</p>
49+
</div>
50+
</div>
51+
);
52+
}

0 commit comments

Comments
 (0)