You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: apps/website/content/docs/runtimes/mastra/how-it-connects.mdx
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -18,13 +18,13 @@ This page records the AG-UI wire behavior measured for Mastra on 2026-08-31. It
18
18
19
19
The service refuses to boot without `AG_UI_INTERNAL_TOKEN`, rejects any non-health route without a matching header, and maps an error from the underlying observable to a `RUN_ERROR` frame rather than dropping the socket. Any route other than `/ok` that arrives without a matching header returns `401 {"detail":"unauthorized"}`; with a valid token, an unknown path or method returns `404 {"detail":"not found"}` and an unregistered topic returns `404 {"detail":"no such topic: <topic>"}`.
20
20
21
-
In your own application this is still an ordinary `provideAgent({ url: '/agent' })`; the example in this repository passes a factory only because it resolves its endpoint at runtime. The token is injected by the dev proxy in front of the app, never by the browser.
21
+
In your own application this is still an ordinary `provideAgent({ url: '/agent', interruptTransport: 'mastra-command' })`; the example in this repository passes a factory only because it resolves its endpoint at runtime. The token is injected by the dev proxy in front of the app, never by the browser.
22
22
23
23
## Interrupts arrive by both conventions
24
24
25
25
Mastra is the only measured runtime that signals an interrupt twice: it emits a `CUSTOM` event named `on_interrupt`**and** finishes the run with the protocol-standard interrupt outcome.
26
26
27
-
AWS Strands and Microsoft Agent Framework emit only the outcome. The LangGraph bridge emits only `on_interrupt`. The adapter accepts either, and within a single run the first signal it sees wins, so a runtime that emits both is handled without special-casing.
27
+
AWS Strands and Microsoft Agent Framework emit only the outcome. The LangGraph bridge emits only `on_interrupt`. The adapter retains both forms in one session. The native batch drives the display projection, while `interruptSession().legacy?.value` preserves the Mastra suspend details used by the approval card.
28
28
29
29
## Resume uses interruptEvent
30
30
@@ -40,7 +40,7 @@ Mastra reads resume data from `forwardedProps.command.interruptEvent`, carrying
40
40
}
41
41
```
42
42
43
-
That is a third distinct shape. Strands and Microsoft Agent Framework read a top-level `resume` array; the LangGraph bridge reads `forwardedProps.command.resume`. Application code passes one neutral `submit({ resume })` and the adapter derives the wire shape from how the interrupt arrived.
43
+
That is a third distinct shape. Strands and Microsoft Agent Framework read a top-level `resume` array; the LangGraph bridge reads `forwardedProps.command.resume`. Application code passes one neutral `submit({ resume })`. The Mastra provider selects `interruptTransport: 'mastra-command'` explicitly because this backend emits both compatibility and native interrupts, and `auto` otherwise selects the native wire shape.
Copy file name to clipboardExpand all lines: apps/website/content/docs/runtimes/mastra/overview.mdx
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -113,7 +113,7 @@ The class supplies that payload and maps the two actions onto resume calls.
113
113
114
114
<ExampleCodefile="mastra.component.ts"region="approval-actions"title="mastra.component.ts — reading the interrupt and resuming" />
115
115
116
-
`agent.interrupt()` carries the parsed `CUSTOM on_interrupt` payload as its `value`, and because that payload carries a tool-call id,`submit({ resume })` goes back out as `forwardedProps.command = { resume, interruptEvent: { toolCallId, runId } }` — the shape the Mastra bridge reads to reopen the suspended run.
116
+
`agent.interruptSession().legacy?.value` carries the parsed `CUSTOM on_interrupt` payload alongside the native interrupt batch. The provider selects `interruptTransport: 'mastra-command'`, so`submit({ resume })` goes back out as `forwardedProps.command = { resume, interruptEvent: { toolCallId, runId } }` — the shape the Mastra bridge reads to reopen the suspended run.
0 commit comments