<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Brian Love</title>
    <description>The latest articles on DEV Community by Brian Love (@blove).</description>
    <link>https://dev.to/blove</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F290639%2F709928e7-e5b7-47d6-811c-0156c4f1e45e.jpg</url>
      <title>DEV Community: Brian Love</title>
      <link>https://dev.to/blove</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/blove"/>
    <language>en</language>
    <item>
      <title>We Measured the Runtime Swap: Three Non-LangGraph Backends, One Angular Contract</title>
      <dc:creator>Brian Love</dc:creator>
      <pubDate>Tue, 17 Nov 2026 16:00:39 +0000</pubDate>
      <link>https://dev.to/blove/we-measured-the-runtime-swap-three-non-langgraph-backends-one-angular-contract-45ni</link>
      <guid>https://dev.to/blove/we-measured-the-runtime-swap-three-non-langgraph-backends-one-angular-contract-45ni</guid>
      <description>&lt;p&gt;The previous post in this series ended on an admission rather than a conclusion.&lt;/p&gt;

&lt;p&gt;I'd spent several thousand words showing that swapping the agent runtime under an Angular app costs one import line at the component level.&lt;br&gt;
Then I had to point out that every AG-UI backend in our repository was itself a LangGraph graph.&lt;br&gt;
That was a transport swap over one runtime, not a runtime swap.&lt;br&gt;
I wrote that I believed the neutral contract would hold against a genuinely different runtime, and a belief isn't a measurement.&lt;/p&gt;

&lt;p&gt;So we measured it.&lt;/p&gt;

&lt;p&gt;We picked three runtimes that have no LangGraph anywhere in them: AWS Strands, Microsoft Agent Framework, and Mastra.&lt;br&gt;
Two languages.&lt;br&gt;
Real servers, driven by real model calls, with the Server-Sent Events captured off the wire and replayed through the shipped client.&lt;/p&gt;

&lt;p&gt;The short version is that the contract held where it mattered and broke in two places, and both of the breaks were ours.&lt;/p&gt;

&lt;h2&gt;
  
  
  What was actually run?
&lt;/h2&gt;

&lt;p&gt;Each runtime got a server standing on its upstream AG-UI integration, not on anything we wrote to make the numbers look good.&lt;br&gt;
Microsoft Agent Framework runs behind &lt;code&gt;agent-framework-ag-ui&lt;/code&gt;.&lt;br&gt;
Strands runs behind the community &lt;code&gt;ag-ui-strands&lt;/code&gt; bridge, pinned to a git reference because the published release crashes on multi-agent routes.&lt;br&gt;
Mastra needed about two hundred lines of Node hosting code, because the upstream package ships an in-process bridge and a mount for its own chat frontend, rather than a plain HTTP endpoint.&lt;/p&gt;

&lt;p&gt;Every server was driven with live model calls until it produced each surface we cared about: streaming text, a tool call, shared state, and a human approval.&lt;br&gt;
The raw event stream from each of those runs was saved.&lt;br&gt;
Those captures then went back through schema validation and the protocol client's own &lt;code&gt;verifyEvents&lt;/code&gt;, and through the adapter reducer, event for event.&lt;/p&gt;

&lt;p&gt;A screenshot of a working demo proves that one path worked once.&lt;br&gt;
A committed transcript replayed through the real client proves what the runtime put on the wire, and it keeps proving it every time the test suite runs.&lt;/p&gt;

&lt;h2&gt;
  
  
  What was the result?
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Runtime&lt;/th&gt;
&lt;th&gt;Messages&lt;/th&gt;
&lt;th&gt;Tool calls&lt;/th&gt;
&lt;th&gt;State&lt;/th&gt;
&lt;th&gt;Interrupts&lt;/th&gt;
&lt;th&gt;Subagents&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;LangGraph (baseline)&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;AWS Strands&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;td&gt;Partial&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Microsoft Agent Framework&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Mastra&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Messages, tool calls, and shared state crossed three non-LangGraph runtimes with zero changes to the adapter.&lt;br&gt;
Not one line!&lt;br&gt;
The Angular side of each example is the same &lt;code&gt;injectAgent()&lt;/code&gt; call and the same &lt;code&gt;&amp;lt;chat&amp;gt;&lt;/code&gt; element that the LangGraph demos use.&lt;/p&gt;

&lt;p&gt;For me, that's the claim I actually wanted to test. 💚&lt;/p&gt;

&lt;p&gt;There's one note on the Mastra interrupt cell.&lt;br&gt;
It was verified live against a real model in the development harness.&lt;br&gt;
Its resume round trip is covered by tests that replay the captured transcripts through the shipped protocol client.&lt;br&gt;
The production service for it doesn't exist yet.&lt;br&gt;
I'm not going to call that cell production-proven, because it isn't.&lt;/p&gt;

&lt;h2&gt;
  
  
  Both real failures were ours
&lt;/h2&gt;

&lt;p&gt;I think this is the most useful part of the exercise.&lt;/p&gt;

&lt;p&gt;We went in expecting the negative cells to indict the protocol or the upstream bridges.&lt;br&gt;
The two hard failures indicted us.&lt;/p&gt;

&lt;h3&gt;
  
  
  We keyed interrupts on a convention, not on the protocol
&lt;/h3&gt;

&lt;p&gt;Our AG-UI adapter detected a human-in-the-loop pause by watching for a &lt;code&gt;CUSTOM&lt;/code&gt; event with the name &lt;code&gt;on_interrupt&lt;/code&gt;.&lt;br&gt;
I flagged that in the previous post as a fragility, and I was right about the fragility and wrong about the shape of the risk.&lt;br&gt;
I assumed a runtime that didn't adopt the convention would simply have no interrupt support.&lt;/p&gt;

&lt;p&gt;What actually happens is worse.&lt;/p&gt;

&lt;p&gt;Strands and Microsoft Agent Framework both signal an interrupt the way the protocol says to.&lt;br&gt;
The run-finished event carries an outcome object naming the pending interrupts.&lt;br&gt;
Neither of them emits the custom event at all.&lt;br&gt;
Our handler for that event read the status and ignored the outcome.&lt;/p&gt;

&lt;p&gt;So the run didn't fail.&lt;br&gt;
It finalized as a success, with a tool call sitting there waiting for an approval the UI never asked for.&lt;br&gt;
The adapter's &lt;code&gt;interrupt&lt;/code&gt; signal stayed undefined.&lt;br&gt;
It failed silently, which only means it took longer to notice.&lt;/p&gt;

&lt;p&gt;The fix was small once the cause was clear, and it landed in &lt;a href="https://github.com/cacheplane/threadplane/pull/888" rel="noopener noreferrer"&gt;#888&lt;/a&gt;.&lt;br&gt;
Both conventions are now recognized.&lt;br&gt;
Updated September 9, 2026: the adapter retains both forms in one session. Native batches take precedence in &lt;code&gt;auto&lt;/code&gt; mode regardless of arrival order; the Mastra integration explicitly selects &lt;code&gt;mastra-command&lt;/code&gt; so the resume includes its decision and suspended-tool correlation.&lt;/p&gt;

&lt;p&gt;I want to name the mistake precisely, because "we had a bug" isn't the lesson.&lt;br&gt;
We built a protocol adapter and then tested it exclusively against one bridge implementation of that protocol.&lt;br&gt;
A bridge convention and a protocol primitive are different things.&lt;br&gt;
A test suite that only ever sees one backend can't tell you which of the two you depend on.&lt;/p&gt;

&lt;h3&gt;
  
  
  Our resume payload was shaped like LangGraph
&lt;/h3&gt;

&lt;p&gt;The second defect is the same mistake wearing different clothes.&lt;/p&gt;

&lt;p&gt;When the user approves the pending action, the adapter sends the resume value back.&lt;br&gt;
It sent exactly the shape the LangGraph bridge reads, under &lt;code&gt;forwardedProps.command.resume&lt;/code&gt;.&lt;br&gt;
That works for LangGraph.&lt;br&gt;
It's a coincidence anywhere else.&lt;/p&gt;

&lt;p&gt;Mastra needs the interrupt's identity carried with the value, specifically the tool-call id and the run id of the suspended run.&lt;br&gt;
Without those it can't find the suspension to resume.&lt;/p&gt;

&lt;p&gt;Strands and Microsoft Agent Framework want something else entirely: the top-level &lt;code&gt;resume&lt;/code&gt; array the protocol itself defines, carrying one entry per interrupt id.&lt;br&gt;
Microsoft additionally wants an entry addressing every pending interrupt.&lt;br&gt;
Send it nothing addressable and it raises an error.&lt;/p&gt;

&lt;p&gt;That's four runtimes with three different answers to how a resume identifies itself.&lt;/p&gt;

&lt;p&gt;The adapter now derives the outgoing shape from how the interrupt arrived, which is the only signal available that isn't a hardcoded runtime name.&lt;br&gt;
That work is in &lt;a href="https://github.com/cacheplane/threadplane/pull/889" rel="noopener noreferrer"&gt;#889&lt;/a&gt;.&lt;br&gt;
The protocol-package upgrade in &lt;a href="https://github.com/cacheplane/threadplane/pull/891" rel="noopener noreferrer"&gt;#891&lt;/a&gt; is what made the standard top-level array sendable at all.&lt;br&gt;
The application-facing call didn't change.&lt;br&gt;
You still write &lt;code&gt;submit({ resume })&lt;/code&gt; and the adapter decides what goes on the wire.&lt;/p&gt;

&lt;p&gt;Both defects share a root.&lt;br&gt;
Neither would have been found by another demo, another end-to-end test, or another review of our own code.&lt;br&gt;
They were only findable by pointing the adapter at software written by people who had never heard of us.&lt;/p&gt;

&lt;h2&gt;
  
  
  What stayed partial?
&lt;/h2&gt;

&lt;p&gt;One cell didn't go fully green.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Shared state on Strands is partial.&lt;/strong&gt;&lt;br&gt;
Its bridge sends whole-document snapshots and never sends a patch, and a tool only contributes state if it opts in through a per-tool hook.&lt;br&gt;
A snapshot replaces the document; it doesn't merge into it.&lt;br&gt;
So every hook has to return the entire state object.&lt;br&gt;
A hook that returns just the key it touched will erase its siblings.&lt;br&gt;
That's a real hazard.&lt;br&gt;
It's documented in the example.&lt;br&gt;
The cause is the upstream bridge, not the protocol and not us.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Subagents were the last column to converge, and the fix was one seam per runtime.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The protocol standardized the events (&lt;code&gt;SUBAGENT_STARTED&lt;/code&gt;, &lt;code&gt;SUBAGENT_FINISHED&lt;/code&gt;, &lt;code&gt;SUBAGENT_ERROR&lt;/code&gt;, plus a &lt;code&gt;subagentRunId&lt;/code&gt; attribution field on ordinary content events), and the adapter consumes them directly.&lt;br&gt;
What no runtime does is emit them natively.&lt;br&gt;
Each one reports delegation in its own dialect: Strands surfaces the specialist's tool use and forwards its token stream, Microsoft Agent Framework streams the specialist's updates in-process into the tool body where the in-tree emitter merges them across the bridge boundary, and Mastra forwards the child's chunks on the parent stream, where its bridge drops them and withholds the delegation tool call until the child resolves.&lt;br&gt;
So each demo backend carries a small emitter (roughly 190 to 360 lines each) that translates its runtime's dialect into the standard events at the bridge boundary.&lt;/p&gt;

&lt;p&gt;All three cards stream live.&lt;br&gt;
Mastra's took one more seam than the others: the emitter observes the runtime's public stream through a tee ahead of the bridge, emits the delegation tool call eagerly, and forwards the child's deltas itself, because the bridge would otherwise have painted the card only at completion.&lt;br&gt;
That extra seam belongs to the runtime's bridge rather than to the protocol or the adapter, and the bridge itself is left unmodified.&lt;br&gt;
If you're building on server-declared subagents today, the contract to target is the protocol's own events; the emitter is the per-runtime cost, and it's small.&lt;/p&gt;

&lt;h2&gt;
  
  
  What did the deploy check find?
&lt;/h2&gt;

&lt;p&gt;Measuring the deploy path surfaced something unrelated.&lt;/p&gt;

&lt;p&gt;One of our AG-UI demo topics had been dead in production for two and a half months.&lt;br&gt;
Its imports were written in a form that resolves when the topic is served from its own directory in development.&lt;br&gt;
In the aggregated deployment layout they don't resolve, so every image built since the middle of June crashed on startup.&lt;br&gt;
The deploy command uploads and detaches, so it reports success at upload time.&lt;br&gt;
The platform kept serving the last image that booted.&lt;br&gt;
Nothing was red anywhere.&lt;br&gt;
The route had been returning a not-found for months.&lt;/p&gt;

&lt;p&gt;The fix in &lt;a href="https://github.com/cacheplane/threadplane/pull/899" rel="noopener noreferrer"&gt;#899&lt;/a&gt; was two import statements.&lt;br&gt;
The deploy workflow now installs the exact dependency set, imports the server, and fails the job if it can't boot.&lt;/p&gt;

&lt;p&gt;Verify the route, not the exit code.&lt;br&gt;
A deploy step that exits zero has told you that a file was uploaded.&lt;br&gt;
It hasn't told you that anything is running, and if your platform keeps the previous image alive on failure, the absence of an alarm isn't evidence.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;The neutral &lt;code&gt;Agent&lt;/code&gt; contract is portable across runtimes for messages, tool calls, and state.&lt;br&gt;
That's now measured against three implementations in two languages.&lt;/p&gt;

&lt;p&gt;Interrupts are portable as of these fixes, and they weren't before, in a way no amount of internal testing would have revealed.&lt;/p&gt;

&lt;p&gt;Subagents are portable through a per-runtime emitter that speaks the protocol's own events, streaming on all three runtimes.&lt;/p&gt;

&lt;p&gt;The matrix now lives in the &lt;a href="https://threadplane.ai/docs/choosing-an-adapter" rel="noopener noreferrer"&gt;adapter guide&lt;/a&gt;, with a cause column on every gap.&lt;br&gt;
It's split three ways: the protocol can't express it, the upstream bridge doesn't emit it, or our adapter failed to consume it.&lt;br&gt;
That third category is the one I care about keeping honest, and it's currently empty.&lt;/p&gt;

&lt;p&gt;The transcripts for messages, tool calls, state, and interrupts are committed as test fixtures, verbatim from the wire.&lt;br&gt;
The subagent captures are committed as wire-capture documents alongside each backend, and the subagent transcript the suite replays is synthetic, built to the event shape those captures record.&lt;br&gt;
Interrupt detection and resume shaping are now pinned to what three real runtimes actually sent us on a specific day.&lt;br&gt;
The next regression in either one fails a test.&lt;/p&gt;

&lt;p&gt;For me, that's the difference between a portability claim and a portability guarantee.&lt;br&gt;
If you point the adapter at a runtime we haven't tried, let me know where it breaks.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>angular</category>
      <category>typescript</category>
      <category>architecture</category>
    </item>
    <item>
      <title>Agentic UI in Angular: Production Patterns After the Demo</title>
      <dc:creator>Brian Love</dc:creator>
      <pubDate>Thu, 12 Nov 2026 16:00:39 +0000</pubDate>
      <link>https://dev.to/blove/agentic-ui-in-angular-production-patterns-after-the-demo-1449</link>
      <guid>https://dev.to/blove/agentic-ui-in-angular-production-patterns-after-the-demo-1449</guid>
      <description>&lt;p&gt;Agentic UI in Angular starts where the streaming chat demo ends.&lt;/p&gt;

&lt;p&gt;A demo proves that tokens can reach a template.&lt;br&gt;
A production agent UI has to make a long-running, partially autonomous system understandable, controllable, and recoverable.&lt;/p&gt;

&lt;p&gt;That difference matters.&lt;br&gt;
An agent can call tools, pause for a decision, change application state, and continue work after the user closes the tab.&lt;br&gt;
A transcript alone doesn't explain what the system is doing or give the user enough control over what happens next.&lt;/p&gt;

&lt;p&gt;If you came here looking for an AG-UI Angular setup, the &lt;a href="https://threadplane.ai/blog/build-fullstack-agentic-angular-apps-using-ag-ui" rel="noopener noreferrer"&gt;fullstack AG-UI tutorial&lt;/a&gt; covers the wire-up.&lt;br&gt;
This post begins after that connection works.&lt;/p&gt;

&lt;p&gt;For me, the production question isn't, “Can the agent stream?”&lt;br&gt;
It's, “Can the user understand, interrupt, resume, and trust the work?”&lt;/p&gt;

&lt;p&gt;Let's look at the patterns that answer that question.&lt;/p&gt;

&lt;h2&gt;
  
  
  When is plain chat enough?
&lt;/h2&gt;

&lt;p&gt;Plain chat is enough more often than agent framework diagrams suggest.&lt;/p&gt;

&lt;p&gt;If the experience is low-risk question answering, retrieval, or short-lived drafting, a message list and composer may be the right product.&lt;br&gt;
The user asks, the model responds, and a retry is an acceptable recovery path.&lt;/p&gt;

&lt;p&gt;Keep it that way if you can.&lt;br&gt;
Every visible tool, checkpoint, approval, and generated component adds product behavior your team has to design, test, and support.&lt;/p&gt;

&lt;p&gt;The boundary moves when the system starts doing work &lt;em&gt;outside&lt;/em&gt; the conversation.&lt;br&gt;
If it can modify data, contact another person, spend money, run for minutes, delegate work, or resume later, the UI needs more than bubbles and a spinner.&lt;/p&gt;

&lt;p&gt;The spinner isn't a product model (poor spinner).&lt;/p&gt;

&lt;h2&gt;
  
  
  Pattern 1: Put the runtime behind an Angular contract
&lt;/h2&gt;

&lt;p&gt;The first pattern is a boring boundary, and I mean that as a compliment.&lt;/p&gt;

&lt;p&gt;Your components should read messages, status, tool calls, errors, state, and interrupts from one stable interface.&lt;br&gt;
They should submit user intent through that same interface.&lt;br&gt;
They shouldn't know whether the backend emitted LangGraph stream chunks, AG-UI events, or something custom.&lt;/p&gt;

&lt;p&gt;Threadplane calls this runtime-neutral boundary the &lt;a href="https://threadplane.ai/docs/langgraph/concepts/agent-contract" rel="noopener noreferrer"&gt;&lt;code&gt;Agent&lt;/code&gt; contract&lt;/a&gt;.&lt;br&gt;
Runtime adapters translate their wire format into Signals and a small action surface that chat components can consume.&lt;/p&gt;

&lt;p&gt;This keeps protocol details out of your design system and route-level components.&lt;br&gt;
It also gives tests a clean seam: replace the contract with writable Signals instead of recreating a server stream.&lt;/p&gt;

&lt;p&gt;There's a cost, though.&lt;br&gt;
A neutral contract can't pretend every runtime has the same capabilities.&lt;br&gt;
Checkpoint history, branching, subagents, and interrupts may be optional or adapter-specific, so feature-detect them and keep runtime-specific behavior at a deliberate edge.&lt;/p&gt;

&lt;p&gt;I think that's healthier than finding AG-UI event names scattered through a dozen Angular components six months later.&lt;/p&gt;

&lt;h2&gt;
  
  
  Pattern 2: Treat the stream as state, not text
&lt;/h2&gt;

&lt;p&gt;Streaming text is only one projection of a run.&lt;/p&gt;

&lt;p&gt;A useful read model includes the current messages, lifecycle status, active tool calls, shared state, error, and any pending interrupt.&lt;br&gt;
Those values change at different rates, but the template needs a coherent answer every time Angular renders.&lt;/p&gt;

&lt;p&gt;Signals fit this work well.&lt;br&gt;
The adapter reduces runtime events into stable state, Angular tracks the parts each view reads, and &lt;code&gt;computed()&lt;/code&gt; can turn those Signals into product decisions such as “can submit,” “show cancel,” or “this task is waiting for approval.”&lt;/p&gt;

&lt;p&gt;The important part isn't avoiding RxJS.&lt;br&gt;
RxJS is still a good fit for transport streams.&lt;br&gt;
The important part is stopping raw event order from becoming the component API.&lt;/p&gt;

&lt;p&gt;Let the adapter own accumulation, deduplication, and lifecycle transitions.&lt;br&gt;
Let the component read the result.&lt;br&gt;
The &lt;a href="https://threadplane.ai/docs/langgraph/concepts/angular-signals" rel="noopener noreferrer"&gt;Signals guide&lt;/a&gt; shows the boundary in practice.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;&lt;a href="https://threadplane.ai/blog/agentic-ui-in-angular-production-patterns" rel="noopener noreferrer"&gt;See the diagram on the original post&lt;/a&gt;: LangGraph stream chunks and AG-UI SSE events both enter a runtime adapter that owns accumulation, deduplication and lifecycle transitions, and the adapter publishes one Agent contract of Angular signals - messages, status, toolCalls, state, error and interrupt - that chat components and an approved component registry read, with user intent travelling back through the same contract.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;The tradeoff is that normalization can hide useful runtime detail.&lt;br&gt;
Keep an explicit event escape hatch for information that isn't durable UI state, but don't publish messages or tool calls through two competing sources.&lt;br&gt;
Two sources of truth create timing bugs that are difficult to reproduce and even harder to explain to a user.&lt;/p&gt;

&lt;h2&gt;
  
  
  Pattern 3: Make tool progress part of the product
&lt;/h2&gt;

&lt;p&gt;Tool calls aren't developer logs.&lt;br&gt;
They're the part of the product that explains where the time went and what authority the agent used.&lt;/p&gt;

&lt;p&gt;“Working…” tells the user almost nothing.&lt;br&gt;
“Searching 12 policies,” “Drafting the refund,” and “Waiting for the billing service” set an expectation and make a slow run legible.&lt;/p&gt;

&lt;p&gt;Treat each important tool as a small state machine:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;what the agent intends to do;&lt;/li&gt;
&lt;li&gt;what is running now;&lt;/li&gt;
&lt;li&gt;what completed, with a useful result;&lt;/li&gt;
&lt;li&gt;what failed, and whether the user can recover.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Raw JSON arguments usually aren't the right UI.&lt;br&gt;
Map high-value tools to product-specific Angular components, group repetitive background calls, and keep low-value orchestration noise out of the main reading path.&lt;br&gt;
Threadplane's &lt;a href="https://threadplane.ai/docs/chat/components/chat-tool-call-template" rel="noopener noreferrer"&gt;tool-call templates&lt;/a&gt; let a team replace the default card one tool at a time.&lt;/p&gt;

&lt;p&gt;Custom tool UI costs more than a generic trace.&lt;br&gt;
Spend that effort where the result changes a user's decision, where latency is meaningful, or where a failure needs a next step.&lt;br&gt;
The rest can use a compact default.&lt;/p&gt;

&lt;h2&gt;
  
  
  Pattern 4: Pause before consequential writes
&lt;/h2&gt;

&lt;p&gt;An approval shown after a write isn't human-in-the-loop.&lt;br&gt;
It's a receipt.&lt;/p&gt;

&lt;p&gt;For a consequential action, the backend should pause &lt;em&gt;before&lt;/em&gt; execution and persist enough state to resume from the same point.&lt;br&gt;
The UI should show what will change, which resource is affected, and the values the agent intends to use.&lt;br&gt;
Then the user can approve, reject, or edit the proposal.&lt;/p&gt;

&lt;p&gt;Keep authorization on the server.&lt;br&gt;
An Angular approval card expresses a decision; it doesn't replace permission checks, idempotency, or an audit record.&lt;/p&gt;

&lt;p&gt;Not every tool needs an interrupt.&lt;br&gt;
Approving every search or read turns safety into click fatigue.&lt;br&gt;
In my opinion, risk tiers work better: allow reversible reads, confirm sensitive or externally visible writes, and require stronger review for destructive or financial actions.&lt;/p&gt;

&lt;p&gt;The interrupt and resume shape belongs on the same neutral agent boundary, while each runtime decides how to checkpoint the work.&lt;br&gt;
The &lt;a href="https://threadplane.ai/blog/human-in-the-loop-ag-ui-agents-in-angular" rel="noopener noreferrer"&gt;AG-UI approval tutorial&lt;/a&gt; and its &lt;a href="https://threadplane.ai/blog/human-in-the-loop-langgraph-agents-in-angular" rel="noopener noreferrer"&gt;LangGraph counterpart&lt;/a&gt; cover the implementation details.&lt;/p&gt;

&lt;h2&gt;
  
  
  Pattern 5: Give threads durable semantics
&lt;/h2&gt;

&lt;p&gt;A thread ID isn't just a sidebar key.&lt;br&gt;
It's the identity of work that may cross runs, routes, browser sessions, and deployments.&lt;/p&gt;

&lt;p&gt;Decide what a thread belongs to: a user, case, project, or task.&lt;br&gt;
Scope access on the server, use stable identifiers, and make a reload restore the same conversation from durable backend state.&lt;/p&gt;

&lt;p&gt;Separate a &lt;em&gt;thread&lt;/em&gt; from a &lt;em&gt;run&lt;/em&gt; as well.&lt;br&gt;
One thread can contain many attempts, tool calls, pauses, and resumptions.&lt;br&gt;
If those concepts collapse into one loading boolean, retry and recovery behavior becomes ambiguous.&lt;/p&gt;

&lt;p&gt;Angular routing can make the active thread explicit and shareable.&lt;br&gt;
The URL can restore the active ID, but only the backend can restore the work behind it.&lt;br&gt;
The &lt;a href="https://threadplane.ai/docs/chat/guides/thread-routing" rel="noopener noreferrer"&gt;thread-routing guide&lt;/a&gt; calls out that dependency, and the &lt;a href="https://threadplane.ai/docs/langgraph/guides/persistence" rel="noopener noreferrer"&gt;LangGraph persistence guide&lt;/a&gt; covers checkpoints and thread restoration.&lt;/p&gt;

&lt;p&gt;This is also where backend differences matter.&lt;br&gt;
The runtime-neutral &lt;code&gt;Agent&lt;/code&gt; contract isn't a message database, and the AG-UI adapter doesn't currently provide LangGraph's history and time-travel APIs.&lt;br&gt;
Choose the adapter whose durability surface matches the product, or add an application-owned thread service instead of assuming the protocol solved persistence.&lt;/p&gt;

&lt;h2&gt;
  
  
  Pattern 6: Let agents choose components, not invent UI
&lt;/h2&gt;

&lt;p&gt;Generative UI gets useful when the agent can choose the right surface for the job.&lt;br&gt;
It gets risky when “generate a surface” means “ship arbitrary code into the application.”&lt;/p&gt;

&lt;p&gt;For me, the production pattern is a registry of approved Angular components.&lt;br&gt;
The agent returns a structured spec, and the frontend resolves each type against components your team owns.&lt;/p&gt;

&lt;p&gt;That boundary keeps accessibility, localization, analytics, validation, and theming inside the design system.&lt;br&gt;
It also limits what the agent can render.&lt;br&gt;
An unregistered type can't instantiate an Angular component.&lt;/p&gt;

&lt;p&gt;Threadplane supports this with a &lt;code&gt;ViewRegistry&lt;/code&gt; for json-render and A2UI surfaces.&lt;br&gt;
You can add, override, or remove components as the product evolves; the &lt;a href="https://threadplane.ai/docs/chat/guides/generative-ui" rel="noopener noreferrer"&gt;generative UI guide&lt;/a&gt; and &lt;a href="https://threadplane.ai/docs/chat/guides/custom-catalogs" rel="noopener noreferrer"&gt;custom catalog patterns&lt;/a&gt; show how.&lt;/p&gt;

&lt;p&gt;The tradeoff is intentional constraint.&lt;br&gt;
A small catalog won't express every layout the model imagines, but it'll produce a UI your team can test and support.&lt;br&gt;
For unknown or invalid specs, define a plain-text fallback and capture enough diagnostic context to fix the contract without exposing private content.&lt;/p&gt;

&lt;h2&gt;
  
  
  Pattern 7: Design the unhappy path first
&lt;/h2&gt;

&lt;p&gt;Agent UI failures are rarely one clean exception.&lt;br&gt;
A stream can stop halfway through a sentence, a tool can time out after other tools completed, an approval can outlive its session, or a saved link can point to a thread the user can't access.&lt;/p&gt;

&lt;p&gt;The recovery behavior comes before polishing the happy path.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Classify errors so the UI retries only when retrying can help.&lt;/li&gt;
&lt;li&gt;Preserve enough completed work to explain what happened.&lt;/li&gt;
&lt;li&gt;Give the user a safe way to stop a run.&lt;/li&gt;
&lt;li&gt;Handle stale threads and unsupported generated components.&lt;/li&gt;
&lt;li&gt;Decide when to fall back to plain text or a non-agent workflow.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The &lt;a href="https://threadplane.ai/docs/chat/guides/error-handling" rel="noopener noreferrer"&gt;&lt;code&gt;AgentError&lt;/code&gt; model&lt;/a&gt; distinguishes connection, authentication, server, and interrupted failures so the UI can respond differently.&lt;br&gt;
User aborts settle gracefully back to idle instead of becoming errors.&lt;br&gt;
That's more useful than rendering &lt;code&gt;Something went wrong&lt;/code&gt; for everything.&lt;/p&gt;

&lt;p&gt;Testing should follow the same state model.&lt;br&gt;
Use a contract mock for component behavior, a fake adapter for streaming integration, and fixture replay for the small number of end-to-end paths that need the whole stack.&lt;br&gt;
The &lt;a href="https://threadplane.ai/docs/ag-ui/guides/testing" rel="noopener noreferrer"&gt;AG-UI testing guide&lt;/a&gt; lays out those layers.&lt;/p&gt;

&lt;p&gt;Observe the transitions users feel: run duration, tool failures, interrupt wait time, retries, and thread restore failures.&lt;br&gt;
Keep event properties operational and out of prompt, completion, tool-input, and tool-output content unless your own policy explicitly requires otherwise.&lt;br&gt;
Threadplane's browser instrumentation runs through an app-owned sink, which keeps that boundary under your control.&lt;/p&gt;

&lt;h2&gt;
  
  
  What about backend portability?
&lt;/h2&gt;

&lt;p&gt;Backend portability is the result of these patterns, not a one-line provider swap you can assume forever.&lt;/p&gt;

&lt;p&gt;If components depend on the neutral contract, tool UI depends on normalized tool state, and approvals use a common interrupt shape, then LangGraph and AG-UI backends can share most of the Angular surface.&lt;br&gt;
The &lt;a href="https://threadplane.ai/docs/choosing-an-adapter" rel="noopener noreferrer"&gt;adapter guide&lt;/a&gt; documents that common boundary.&lt;/p&gt;

&lt;p&gt;But portability has limits.&lt;br&gt;
If the product depends on LangGraph checkpoint history, a runtime-specific branch model, or a custom AG-UI event, that feature needs an explicit adapter boundary and its own tests.&lt;/p&gt;

&lt;p&gt;That's fine!&lt;br&gt;
The goal isn't to erase useful backend capabilities.&lt;br&gt;
It's to make the coupling visible, small, and intentional.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;Agentic UI in Angular isn't a more animated chat transcript.&lt;br&gt;
It's the product layer that turns asynchronous agent work into state a user can understand and actions a user can control.&lt;/p&gt;

&lt;p&gt;Start with plain chat when plain chat is enough.&lt;br&gt;
When the agent gains more time, authority, or persistence, add the patterns that make those capabilities legible: a neutral contract, Signals, meaningful tool progress, approvals, durable threads, constrained components, and rehearsed recovery.&lt;/p&gt;

&lt;p&gt;These are the production patterns I think are worth carrying into an Angular architecture review.&lt;br&gt;
If your team has found another one, let me know what made the difference. 💚&lt;/p&gt;

</description>
      <category>angular</category>
      <category>ai</category>
      <category>webdev</category>
      <category>architecture</category>
    </item>
    <item>
      <title>What Fixture Replay Can't Catch</title>
      <dc:creator>Brian Love</dc:creator>
      <pubDate>Tue, 10 Nov 2026 16:00:40 +0000</pubDate>
      <link>https://dev.to/blove/what-fixture-replay-cant-catch-44od</link>
      <guid>https://dev.to/blove/what-fixture-replay-cant-catch-44od</guid>
      <description>&lt;p&gt;Agents are hard to test end to end for one boring reason: the model doesn't return the same thing twice.&lt;br&gt;
Ask it the same question in two runs and you get two different sentences, two different orderings, sometimes a tool call and sometimes not.&lt;br&gt;
Write an assertion against that and you've written a coin flip.&lt;/p&gt;

&lt;p&gt;The usual fix is to stop calling the model.&lt;br&gt;
You capture its responses once, save them to disk as &lt;em&gt;fixtures&lt;/em&gt;, and &lt;em&gt;replay&lt;/em&gt; them on every run: same request in, same bytes back, forever.&lt;br&gt;
The tests go deterministic, CI stops spending money on tokens, and the agent under test never knows it's talking to a recording.&lt;/p&gt;

&lt;p&gt;We test our whole demo fleet that way.&lt;br&gt;
This post is about the bill, because replay isn't free and the charge doesn't show up where you'd look for it.&lt;/p&gt;

&lt;p&gt;Every deterministic harness buys its determinism by deleting a dimension of the real thing.&lt;br&gt;
Ours deletes &lt;em&gt;time&lt;/em&gt; (deliberately, with the reason written in the source), and one specific class of bug vanishes along with it.&lt;/p&gt;

&lt;p&gt;So I think the interesting question about a harness isn't whether it's green.&lt;br&gt;
It's which dimension you deleted, because that's the list of bugs it can't report.&lt;/p&gt;
&lt;h2&gt;
  
  
  Where do you put the mock?
&lt;/h2&gt;

&lt;p&gt;At the model provider, not the app.&lt;/p&gt;

&lt;p&gt;Our end-to-end suite starts a mock OpenAI server, then spawns the real agent server with its base URL pointed at that mock: &lt;code&gt;langgraph dev&lt;/code&gt; for the LangGraph apps, uvicorn for the AG-UI ones.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;mock&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;startMock&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;mode&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'replay'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;fixturePath&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;opts&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;fixturesDir&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="nf"&gt;spawn&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'uv'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'run'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'langgraph'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'dev'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'--port'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nb"&gt;String&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;langgraphPort&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="n"&gt;env&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nb"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;env&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="no"&gt;OPENAI_BASE_URL&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;mock&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;baseUrl&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;   &lt;span class="c1"&gt;// the only thing that isn't real&lt;/span&gt;
    &lt;span class="no"&gt;OPENAI_API_KEY&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'test-not-used'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Everything above that line is the real thing.&lt;br&gt;
A real Angular app, the real streaming transport, a real Python server, real graph nodes with their edges and conditional routing.&lt;br&gt;
The model is the only stand-in.&lt;/p&gt;

&lt;p&gt;Why not mock the agent at the app boundary instead?&lt;br&gt;
A test that does that proves your component renders what you handed it.&lt;br&gt;
It can't tell you that your graph's conditional edge routes correctly, that your transport merges deltas in the right order, or that a tool call round-trips.&lt;br&gt;
Push the seam out to the provider and all of that is under test, because none of it was replaced.&lt;/p&gt;

&lt;p&gt;Replacing the model (and only the model) is also what makes it cheap enough to run everywhere: no API spend, no rate limits, no coin flips.&lt;br&gt;
We have 53 fixture files holding 169 entries across 36 apps, 34 workspace capabilities and two example apps, all on the same harness.&lt;/p&gt;

&lt;p&gt;This is the outer tier.&lt;br&gt;
For in-process fakes at the unit level, the &lt;a href="https://threadplane.ai/docs/langgraph/guides/testing" rel="noopener noreferrer"&gt;testing guide&lt;/a&gt; covers &lt;code&gt;provideFakeAgent()&lt;/code&gt;, &lt;code&gt;mockLangGraphAgent()&lt;/code&gt;, and &lt;code&gt;MockAgentTransport&lt;/code&gt;, which are a different tool for a different job.&lt;/p&gt;
&lt;h2&gt;
  
  
  What does a fixture match on?
&lt;/h2&gt;

&lt;p&gt;The shape of the request, and the order you list the entries decides which one wins.&lt;/p&gt;

&lt;p&gt;A fixture file is a list of entries, and each one is a pair: a &lt;code&gt;match&lt;/code&gt; block describing which request it answers, and the response to hand back when a request fits.&lt;/p&gt;

&lt;p&gt;The obvious discriminator is the user message, but there are richer ones: a parent LLM's first call and its continuation after a tool round carry the same user message.&lt;br&gt;
Something has to tell them apart.&lt;/p&gt;

&lt;p&gt;That something is &lt;code&gt;hasToolResult&lt;/code&gt;, and matching is first-match-wins:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;"fixtures"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nl"&gt;"match"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nl"&gt;"userMessage"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"book a flight"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nl"&gt;"hasToolResult"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nl"&gt;"response"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"..."&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nl"&gt;"match"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nl"&gt;"userMessage"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"book a flight"&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nl"&gt;"response"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"..."&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Swap those two entries and the run never terminates.&lt;/p&gt;

&lt;p&gt;The continuation arrives carrying the same user message, matches the looser entry first, and gets handed the response that asks for the tool call again.&lt;br&gt;
The model calls the tool.&lt;br&gt;
The result comes back.&lt;br&gt;
It matches the looser entry again.&lt;br&gt;
Nothing errors. The assistant simply never finalizes.&lt;/p&gt;

&lt;p&gt;For me, that's the sharpest thing about fixture files: they're data, so they look inert, but the ordering is executable.&lt;/p&gt;
&lt;h2&gt;
  
  
  What did we trade away?
&lt;/h2&gt;

&lt;p&gt;The streaming, by default.&lt;/p&gt;

&lt;p&gt;The mock is constructed with a chunk size large enough that every response arrives in one or two server-sent events.&lt;br&gt;
Here's the note that sits above it:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// Use a large default chunkSize so ordinary fixture responses arrive in 1-2&lt;/span&gt;
&lt;span class="c1"&gt;// SSE deltas: most e2e assertions measure the final rendered DOM, and big&lt;/span&gt;
&lt;span class="c1"&gt;// chunks keep them deterministic. This is a determinism default, not a&lt;/span&gt;
&lt;span class="c1"&gt;// workaround — streaming-progressive behavior is covered by the unit&lt;/span&gt;
&lt;span class="c1"&gt;// variance tables and by fixtures that opt into small per-fixture&lt;/span&gt;
&lt;span class="c1"&gt;// chunkSize/latency values (see the fence fixture in&lt;/span&gt;
&lt;span class="c1"&gt;// cockpit/chat/messages/angular/e2e/fixtures/c-messages.json).&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;mock&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;LLMock&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;port&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;chunkSize&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;4096&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Structural assertions (a code fence renders as a block, a list is a list) are final-state invariants, and big chunks keep them from depending on where a token boundary happened to fall.&lt;/p&gt;

&lt;p&gt;That 4096 is a &lt;em&gt;default&lt;/em&gt;, not a law, and the second half of that comment is the useful half.&lt;br&gt;
Targeted streaming regressions opt into smaller per-fixture chunks: fixtures that set chunk sizes of three, four, six, eight, twenty-three, thirty-six, with latencies from 25 to 750 milliseconds, and e2e tests that sample the mid-stream DOM while it renders.&lt;br&gt;
What a real model's chunking does to a triple-backtick fence is covered one tier down too, in unit tables that drive the markdown parser one character at a time.&lt;/p&gt;

&lt;p&gt;So "we deleted time" is too tidy.&lt;br&gt;
What we did was delete it by default and buy it back per fixture, in the places somebody decided the progressive render was the thing under test.&lt;/p&gt;

&lt;p&gt;That turns the question into a better one.&lt;br&gt;
Not &lt;em&gt;what did the harness give up&lt;/em&gt;, but &lt;em&gt;which fixtures opted back in&lt;/em&gt;, because a tier where nothing does is flying blind on everything mid-stream.&lt;/p&gt;

&lt;h2&gt;
  
  
  What does that hide?
&lt;/h2&gt;

&lt;p&gt;Bugs that exist only while the stream is open and fix themselves before it closes.&lt;/p&gt;

&lt;p&gt;Let's build the shape from a mechanism &lt;a href="https://threadplane.ai/blog/langgraph-subgraphs-when-to-split" rel="noopener noreferrer"&gt;the subgraphs post&lt;/a&gt; walks through.&lt;br&gt;
A child graph's tokens stream in under a namespace.&lt;br&gt;
A consumer that merged them into the transcript would show an extra chat bubble mid-run: the child's internal notes, rendered as if the assistant said them.&lt;br&gt;
Then the run settles, the parent publishes its authoritative state, the transcript is rebuilt from it, and the extra bubble vanishes.&lt;/p&gt;

&lt;p&gt;Now look at that sequence from a test's point of view.&lt;br&gt;
The end state is correct. Two messages, in the right order.&lt;br&gt;
Assert on the finished DOM and it passes, and not by luck.&lt;/p&gt;

&lt;p&gt;That's why our transport routes child tokens structurally instead of by merge decision.&lt;br&gt;
It's also why &lt;em&gt;verifying&lt;/em&gt; that property means driving a live model and sampling the DOM on a tight interval for the length of a full run, watching that the message count never crosses two.&lt;br&gt;
That's not something a final-state suite does, and not something it could tell you.&lt;/p&gt;

&lt;p&gt;Let's generalize, because this isn't specific to us.&lt;br&gt;
Any assertion that runs after an &lt;code&gt;await&lt;/code&gt; sees a settled system.&lt;br&gt;
A self-correcting bug is precisely one that settles.&lt;br&gt;
So the class of defects a final-state suite can't see isn't random; it's exactly the ones that repair themselves. 😲&lt;/p&gt;

&lt;h2&gt;
  
  
  What runs alongside it?
&lt;/h2&gt;

&lt;p&gt;A live pass for what replay structurally can't see, and a weekly drift run for the model itself.&lt;/p&gt;

&lt;p&gt;The live pass is unglamorous: for anything whose failure mode is mid-stream, drive it against a real model in a real browser before it ships.&lt;br&gt;
There's no clever tooling in it.&lt;br&gt;
The deterministic suite is for final-state invariants, and mid-stream behavior isn't one of them.&lt;/p&gt;

&lt;p&gt;Drift is the other half, and the tempting design is the wrong one.&lt;br&gt;
Re-record fixtures and diff the bytes and you detect that a response changed &lt;em&gt;size&lt;/em&gt; while learning nothing about whether it changed &lt;em&gt;meaning&lt;/em&gt;.&lt;br&gt;
That's the same trade again, one layer up.&lt;br&gt;
A model that starts returning something equally long and completely different sails straight through a size check.&lt;/p&gt;

&lt;p&gt;So the drift check isn't a new metric.&lt;br&gt;
It's the assertions we already trust.&lt;/p&gt;

&lt;p&gt;The drift run takes a tagged subset of the same e2e suite (contract assertions only: a reply renders, the research dispatch surfaces a subagent card, the interrupt panel appears) and points it at the live provider through the mock's record-proxy, which any app on the harness can switch on with an environment variable.&lt;br&gt;
No fixtures judged, no thresholds invented.&lt;br&gt;
If today's model stops calling the research tool, or the graph's prompts stop eliciting the interrupt, a spec we already believe in goes red and a weekly job opens an issue.&lt;br&gt;
Meaning drift is caught by construction.&lt;/p&gt;

&lt;p&gt;One rule makes the subset work: a tagged assertion may depend on structure or on the prompt's own terms (an element exists, a reply to "say hi" matches &lt;code&gt;/hi/i&lt;/code&gt;), never on the content of a canned response.&lt;br&gt;
A spec that expects the fixture's exact words fails against a live model whether or not anything drifted, so it stays in replay where it belongs.&lt;br&gt;
A structural differ runs alongside as a diagnostic, and it files recordings the recorder itself flagged as incomplete under their own category instead of counting them as drift.&lt;br&gt;
It's an instrument reporting on its own blind spot rather than disguising it.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;My recommendation is simple: push your seam as far out as you can afford.&lt;br&gt;
The further out it goes, the more of your stack is under test rather than simulated, and provider base URL is far out for how little it costs.&lt;/p&gt;

&lt;p&gt;Then write down which dimension you deleted to make it deterministic, in the file where you deleted it.&lt;br&gt;
Not in a wiki.&lt;br&gt;
Six months later that comment is the difference between "the suite is green" and "the suite is green, and here's what green doesn't cover."&lt;/p&gt;

&lt;p&gt;For us the remaining list is short and specific: mid-stream behavior on fixtures that never opted into real chunking, and the model itself moving under the fixtures.&lt;br&gt;
Both are answered by pointing what you already trust at the real thing: the tagged specs at the live provider on a schedule, a live browser at anything mid-stream before it ships.&lt;br&gt;
Widening either net is a fixture opt-in or a spec tag, not a new design.&lt;/p&gt;

&lt;p&gt;The &lt;a href="https://threadplane.ai/docs/langgraph/guides/testing" rel="noopener noreferrer"&gt;testing guide&lt;/a&gt; has the in-process tier, and &lt;a href="https://threadplane.ai/blog/langgraph-subgraphs-when-to-split" rel="noopener noreferrer"&gt;the subgraphs post&lt;/a&gt; has the streaming attribution model this post leans on.&lt;/p&gt;

&lt;p&gt;If your agent suite is green today, let me know what you think it can't see.&lt;/p&gt;

</description>
      <category>testing</category>
      <category>ai</category>
      <category>langgraph</category>
      <category>angular</category>
    </item>
    <item>
      <title>Debugging an Angular Agent UI with AG-UI DevTools</title>
      <dc:creator>Brian Love</dc:creator>
      <pubDate>Sun, 08 Nov 2026 15:12:10 +0000</pubDate>
      <link>https://dev.to/blove/debugging-an-angular-agent-ui-with-ag-ui-devtools-1icc</link>
      <guid>https://dev.to/blove/debugging-an-angular-agent-ui-with-ag-ui-devtools-1icc</guid>
      <description>&lt;p&gt;Learn how to debug an agent UI with AG-UI DevTools, a Chrome DevTools panel for AG-UI and LangGraph event streams.&lt;/p&gt;

&lt;h2&gt;
  
  
  Introducing AG-UI DevTools
&lt;/h2&gt;

&lt;p&gt;When an agent run misbehaves, the Network panel shows you an opaque &lt;code&gt;text/event-stream&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;And &lt;code&gt;console.log&lt;/code&gt; only shows you what your app &lt;em&gt;thinks&lt;/em&gt; happened.&lt;/p&gt;

&lt;p&gt;AG-UI DevTools shows you the wire.&lt;/p&gt;

&lt;p&gt;It captures, decodes, and validates every event in a run, and it lays them out in the order they arrived.&lt;/p&gt;

&lt;p&gt;It also understands LangGraph Platform streams.&lt;/p&gt;

&lt;p&gt;If you're using Threadplane 0.3.4 or later, it does even more.&lt;/p&gt;

&lt;p&gt;In development, a Threadplane app reports which of its signals each event wrote, which generated components rendered, and it lets the panel script your agent's next run.&lt;/p&gt;

&lt;h2&gt;
  
  
  Goals
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Install AG-UI DevTools.&lt;/li&gt;
&lt;li&gt;Walk through each tab in the panel.&lt;/li&gt;
&lt;li&gt;Learn what the protocol validator catches.&lt;/li&gt;
&lt;li&gt;Script an approval interrupt with no model call.&lt;/li&gt;
&lt;li&gt;Look at a few practical use cases.&lt;/li&gt;
&lt;li&gt;See how the validator helps if you build your own AG-UI framework.&lt;/li&gt;
&lt;li&gt;Have fun!&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Install
&lt;/h2&gt;

&lt;p&gt;To get started, add &lt;a href="https://chromewebstore.google.com/detail/ag-ui-devtools/bfdacpjjmapclfedhocdbogihggpnkob" rel="noopener noreferrer"&gt;AG-UI DevTools from the Chrome Web Store&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;You'll need Chrome 111 or newer.&lt;/p&gt;

&lt;p&gt;Then:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Open your app at &lt;code&gt;http://localhost&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Open Chrome DevTools.&lt;/li&gt;
&lt;li&gt;Select the &lt;strong&gt;AG-UI&lt;/strong&gt; panel (it may be behind the &lt;code&gt;»&lt;/code&gt; overflow if your tab strip is full).&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Capture is on for &lt;code&gt;localhost&lt;/code&gt;, &lt;code&gt;127.0.0.1&lt;/code&gt;, and &lt;code&gt;0.0.0.0&lt;/code&gt; right away.&lt;/p&gt;

&lt;p&gt;For any other origin, click &lt;strong&gt;Enable capture&lt;/strong&gt; in the panel and reload the page.&lt;/p&gt;

&lt;p&gt;I should note that the extension stays out of your data.&lt;/p&gt;

&lt;p&gt;It makes no network requests of its own, it never reads &lt;code&gt;Authorization&lt;/code&gt; headers or cookies, and the capture lives in memory unless you export it.&lt;/p&gt;

&lt;p&gt;The source is &lt;a href="https://github.com/blove/ag-ui-chrome-extension" rel="noopener noreferrer"&gt;on GitHub&lt;/a&gt; if you want to check.&lt;/p&gt;

&lt;h2&gt;
  
  
  Timeline
&lt;/h2&gt;

&lt;p&gt;The &lt;strong&gt;Timeline&lt;/strong&gt; tab is where you'll spend most of your time.&lt;/p&gt;

&lt;p&gt;At the top is a waterfall of each run, with bars for messages, tool calls, and steps.&lt;/p&gt;

&lt;p&gt;Below that is every event in order, and selecting an event shows its payload on the right.&lt;/p&gt;

&lt;p&gt;Here is a screenshot of a two-run capture with a &lt;code&gt;TOOL_CALL_START&lt;/code&gt; event selected:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F8prt7580yqsowih7wd8h.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F8prt7580yqsowih7wd8h.png" alt="AG-UI DevTools Timeline" width="800" height="417"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Let's break this down:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Clicking a bar in the waterfall jumps to its event in the list.&lt;/li&gt;
&lt;li&gt;The &lt;strong&gt;Filter&lt;/strong&gt; box narrows the list by text.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Expand chunks&lt;/strong&gt; rebuilds the &lt;code&gt;*_CHUNK&lt;/code&gt; events into their full start, content, and end events.&lt;/li&gt;
&lt;li&gt;The &lt;strong&gt;Run&lt;/strong&gt; selector in the top right scopes every tab to a single run.&lt;/li&gt;
&lt;li&gt;For LangGraph Platform streams, the detail pane also lists the AG-UI events the panel derived from each frame.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Issues
&lt;/h2&gt;

&lt;p&gt;This is the feature I think you'll appreciate the most.&lt;/p&gt;

&lt;p&gt;As events arrive, a validator checks them against the AG-UI protocol.&lt;/p&gt;

&lt;p&gt;An event with a problem gets a verdict card in the detail pane, and the toolbar shows an issue count for the current scope.&lt;/p&gt;

&lt;p&gt;Click the count, and the list filters down to just the events with issues.&lt;/p&gt;

&lt;p&gt;In this example, a &lt;code&gt;TEXT_MESSAGE_CONTENT&lt;/code&gt; event references a message that was never opened:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Ftp6zmcn0rih3hbaea50b.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Ftp6zmcn0rih3hbaea50b.png" alt="Protocol issue in the Timeline" width="800" height="417"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Here are a few of the rules it checks:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;event-before-run-started&lt;/code&gt; and &lt;code&gt;event-after-terminal&lt;/code&gt;: events outside the run.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;run-never-terminated&lt;/code&gt;: a run that never sent &lt;code&gt;RUN_FINISHED&lt;/code&gt; or &lt;code&gt;RUN_ERROR&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;unopened-message-id&lt;/code&gt; and &lt;code&gt;unopened-tool-call-id&lt;/code&gt;: content for a message or tool call that was never started.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;unclosed-message&lt;/code&gt; and &lt;code&gt;unclosed-tool-call&lt;/code&gt;: a start with no end.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;tool-args-not-json&lt;/code&gt;: streamed tool arguments that don't join into valid JSON.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;state-patch-failed&lt;/code&gt;: a &lt;code&gt;STATE_DELTA&lt;/code&gt; that can't be applied.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;shape-invalid&lt;/code&gt;: an event that fails the AG-UI schema.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The Network panel can't tell you any of that. 😲&lt;/p&gt;

&lt;h2&gt;
  
  
  Runs
&lt;/h2&gt;

&lt;p&gt;The &lt;strong&gt;Runs&lt;/strong&gt; tab is a table with one row per run:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fn6kowf7wm05geefvpaqn.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fn6kowf7wm05geefvpaqn.png" alt="Runs table" width="800" height="119"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You get the thread, agent, outcome, duration, time to first token (TTFT), event count, and issue count.&lt;/p&gt;

&lt;p&gt;Missing values say so in words, like "not reported" or "still running", rather than showing a misleading zero.&lt;/p&gt;

&lt;p&gt;Click a row to scope the panel to that run and open it in Timeline.&lt;/p&gt;

&lt;h2&gt;
  
  
  Messages
&lt;/h2&gt;

&lt;p&gt;The &lt;strong&gt;Messages&lt;/strong&gt; tab rebuilds the conversation from the stream:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fb8cl2s8zkucp6o807cb7.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fb8cl2s8zkucp6o807cb7.png" alt="Messages tab" width="800" height="381"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;User turns come from the captured request, and assistant messages, reasoning, and tool calls come from the stream, in time order.&lt;/p&gt;

&lt;p&gt;Each tool call gets a verdict on its arguments: streaming, parsed, or failed.&lt;/p&gt;

&lt;p&gt;The &lt;strong&gt;Timeline&lt;/strong&gt; buttons jump back to the frames that built each message.&lt;/p&gt;

&lt;h2&gt;
  
  
  State
&lt;/h2&gt;

&lt;p&gt;If your agent shares state with the UI, the &lt;strong&gt;State&lt;/strong&gt; tab replays it.&lt;/p&gt;

&lt;p&gt;Each run gets a scrubber with one frame per &lt;code&gt;STATE_SNAPSHOT&lt;/code&gt; or &lt;code&gt;STATE_DELTA&lt;/code&gt;:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fse26ypgckl1s1n6kw9hx.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fse26ypgckl1s1n6kw9hx.png" alt="State tab with a JSON Patch frame" width="800" height="360"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Each frame shows its JSON Patch operations and the full state document after they're applied.&lt;/p&gt;

&lt;p&gt;So when a value in your UI looks wrong, you can scrub back to the exact delta that set it.&lt;/p&gt;

&lt;h2&gt;
  
  
  UI
&lt;/h2&gt;

&lt;p&gt;The &lt;strong&gt;UI&lt;/strong&gt; tab is for generative UI.&lt;/p&gt;

&lt;p&gt;It lists every A2UI and json-render surface in the capture as a component tree, and it badges each node as rendered, fallback, unknown type, or not rendered.&lt;/p&gt;

&lt;p&gt;Here is a json-render surface from a Threadplane development build, where the model asked for two chart types the app never registered:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fbsmxioj56n59ytvmjta5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fbsmxioj56n59ytvmjta5.png" alt="UI tab with the app's render report" width="799" height="401"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Without a Threadplane app, the panel infers those states from the wire against the A2UI basic catalog.&lt;/p&gt;

&lt;p&gt;With a Threadplane development build, the app reports how each spec actually resolved, so the findings are marked &lt;strong&gt;EXACT&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;I think this one saves a lot of guessing.&lt;/p&gt;

&lt;p&gt;An unknown component type renders nothing, along with everything under it, and before this nothing told you why.&lt;/p&gt;

&lt;h2&gt;
  
  
  Signals
&lt;/h2&gt;

&lt;p&gt;The &lt;strong&gt;Signals&lt;/strong&gt; tab needs a Threadplane 0.3.4+ development build.&lt;/p&gt;

&lt;p&gt;A Threadplane agent keeps its state in signals: &lt;code&gt;messages&lt;/code&gt;, &lt;code&gt;status&lt;/code&gt;, &lt;code&gt;toolCalls&lt;/code&gt;, &lt;code&gt;interrupt&lt;/code&gt;, and so on.&lt;/p&gt;

&lt;p&gt;After handling each event, the agent reports which signals that event wrote.&lt;/p&gt;

&lt;p&gt;The tab shows those reports as a matrix, with signals as rows and events as columns:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fpbq79b753ilmc26d9zdk.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fpbq79b753ilmc26d9zdk.png" alt="Signals matrix" width="799" height="361"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Select an event column, and it finds that event's frame in Timeline.&lt;/p&gt;

&lt;p&gt;So when your spinner never goes away, you can see whether any event ever wrote &lt;code&gt;status&lt;/code&gt; back to idle.&lt;/p&gt;

&lt;p&gt;Note, the report carries signal names and timing only.&lt;/p&gt;

&lt;p&gt;The agent never reads the values it writes, so nothing from the conversation is in it.&lt;/p&gt;

&lt;p&gt;You don't need the extension to peek at these, by the way.&lt;/p&gt;

&lt;p&gt;They're plain &lt;code&gt;CustomEvent&lt;/code&gt;s on &lt;code&gt;window&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="nb"&gt;window&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;addEventListener&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;threadplane:devtools&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;e&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;e&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;detail&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Simulate
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Simulate&lt;/strong&gt; scripts your agent's next run.&lt;/p&gt;

&lt;p&gt;Your app's real code handles the scripted events (the adapter, any middleware, and your components), and only the network call is replaced.&lt;/p&gt;

&lt;p&gt;That means no model call, no backend, and the exact same run every time.&lt;/p&gt;

&lt;p&gt;To get started, turn on &lt;strong&gt;Developer mode&lt;/strong&gt; for the site in the panel.&lt;/p&gt;

&lt;p&gt;It's a per-site switch, and while it's on, every tab shows a banner.&lt;/p&gt;

&lt;p&gt;Then pick a template, choose the AG-UI or LangGraph adapter, and click &lt;strong&gt;Arm&lt;/strong&gt;:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F5xwvpwf11doapjudkw9q.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F5xwvpwf11doapjudkw9q.png" alt="Simulate tab with the Interrupt template" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The templates are:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Interrupt (approval)&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Subagent handoff&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Malformed event&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Replay a captured run&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The arm list shows each arm as armed, consumed, expired, cancelled, or rejected.&lt;/p&gt;

&lt;p&gt;If no Threadplane hook answers within two seconds, it tells you so.&lt;/p&gt;

&lt;p&gt;Simulate needs a Threadplane 0.3.4+ development build, and it only reaches the page's top frame.&lt;/p&gt;

&lt;p&gt;The panel isn't doing anything magic here, either.&lt;/p&gt;

&lt;p&gt;It dispatches a &lt;code&gt;CustomEvent&lt;/code&gt;, and you can do the same from the console.&lt;/p&gt;

&lt;p&gt;Here's an approval interrupt for an AG-UI agent:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="nb"&gt;window&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;dispatchEvent&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;CustomEvent&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;threadplane:devtools:arm&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="na"&gt;detail&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="na"&gt;v&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;armId&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;refund-approval&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;adapter&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;ag-ui&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;runs&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
      &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="na"&gt;events&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
          &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;RUN_STARTED&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;threadId&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;t&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;runId&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;r1&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt;
          &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;TEXT_MESSAGE_START&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;messageId&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;ai-1&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;role&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;assistant&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt;
          &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;TEXT_MESSAGE_CONTENT&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;messageId&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;ai-1&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;delta&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;This needs your approval.&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt;
          &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;TEXT_MESSAGE_END&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;messageId&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;ai-1&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt;
          &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;RUN_FINISHED&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;threadId&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;t&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;runId&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;r1&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="na"&gt;outcome&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;interrupt&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;interrupts&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[{&lt;/span&gt; &lt;span class="na"&gt;id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;int-1&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;reason&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;confirmation&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;message&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Approve the $42 refund?&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="p"&gt;}]&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt;
          &lt;span class="p"&gt;},&lt;/span&gt;
        &lt;span class="p"&gt;],&lt;/span&gt;
      &lt;span class="p"&gt;},&lt;/span&gt;
      &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="na"&gt;events&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
          &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;RUN_STARTED&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;threadId&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;t&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;runId&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;r2&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt;
          &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;TEXT_MESSAGE_START&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;messageId&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;ai-2&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;role&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;assistant&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt;
          &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;TEXT_MESSAGE_CONTENT&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;messageId&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;ai-2&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;delta&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Refund issued.&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt;
          &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;TEXT_MESSAGE_END&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;messageId&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;ai-2&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt;
          &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;RUN_FINISHED&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;threadId&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;t&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;runId&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;r2&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;outcome&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;success&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt;
        &lt;span class="p"&gt;],&lt;/span&gt;
      &lt;span class="p"&gt;},&lt;/span&gt;
    &lt;span class="p"&gt;],&lt;/span&gt;
  &lt;span class="p"&gt;},&lt;/span&gt;
&lt;span class="p"&gt;}));&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Let's review:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;First, the next run your agent starts takes &lt;code&gt;runs[0]&lt;/code&gt;, which pauses on the interrupt, so your approval UI shows up.&lt;/li&gt;
&lt;li&gt;Then, when you approve, the resume takes &lt;code&gt;runs[1]&lt;/code&gt; and finishes the turn.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;RUN_STARTED&lt;/code&gt; and &lt;code&gt;RUN_FINISHED&lt;/code&gt; take the real run's &lt;code&gt;threadId&lt;/code&gt; and &lt;code&gt;runId&lt;/code&gt;, so the ids in the script don't need to match anything.&lt;/li&gt;
&lt;li&gt;Each step is acknowledged with a &lt;code&gt;threadplane:devtools:ack&lt;/code&gt; event, and a bad arm is rejected with a short reason.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For a LangGraph agent, set &lt;code&gt;adapter: 'langgraph'&lt;/code&gt; and give each run a &lt;code&gt;frames&lt;/code&gt; array of &lt;code&gt;{ event, data }&lt;/code&gt; frames, exactly as the LangGraph SDK yields them.&lt;/p&gt;

&lt;p&gt;One more note.&lt;/p&gt;

&lt;p&gt;The page can't tell who dispatched an arm, so any script running on your development page can script your agent's next run.&lt;/p&gt;

&lt;p&gt;The Developer mode switch guards against accidents, not against code that's already in the page.&lt;/p&gt;

&lt;h2&gt;
  
  
  Session and Export
&lt;/h2&gt;

&lt;p&gt;The &lt;strong&gt;Session&lt;/strong&gt; tab shows what the panel detected (framework, transport, and protocol), the capture status, issue totals, and the export options:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F4ew8psntx6n29o516osy.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F4ew8psntx6n29o516osy.png" alt="Session tab with export and redaction" width="800" height="417"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You can export a capture a few ways:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Download capture (.agui.jsonl)&lt;/strong&gt;, which you can import back into the panel later.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Copy JSON to clipboard&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Download TypeScript fixture (.ts)&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Download Threadplane test (.spec.ts)&lt;/strong&gt; for LangGraph Platform captures. It replays the capture through &lt;code&gt;MockAgentTransport&lt;/code&gt; from &lt;code&gt;@threadplane/langgraph&lt;/code&gt;, and it passes as generated.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Before you export, you can redact message text, reasoning, tool arguments, tool results, and state values.&lt;/p&gt;

&lt;p&gt;Redacted values become &lt;code&gt;«redacted: 412 chars»&lt;/code&gt;, so the structure, ordering, sizes, and timings all survive.&lt;/p&gt;

&lt;p&gt;Note, nothing is redacted unless you choose it, and the &lt;strong&gt;Export&lt;/strong&gt; button in the toolbar is always unredacted.&lt;/p&gt;

&lt;h2&gt;
  
  
  Practical use cases
&lt;/h2&gt;

&lt;p&gt;Here are just a few scenarios where AG-UI DevTools can help in your day-to-day work, with code for each one.&lt;/p&gt;

&lt;h3&gt;
  
  
  Testing approval flows without a model
&lt;/h3&gt;

&lt;p&gt;Approval flows are annoying to test by hand.&lt;/p&gt;

&lt;p&gt;You have to coax the model into asking, every time, and each attempt costs a real call.&lt;/p&gt;

&lt;p&gt;The good news is that the same &lt;code&gt;threadplane:devtools:arm&lt;/code&gt; event works from an end-to-end test, as long as the test runs against a development build (like &lt;code&gt;ng serve&lt;/code&gt;).&lt;/p&gt;

&lt;p&gt;Let's say your app shows approvals with &lt;code&gt;&amp;lt;chat-approval-card&amp;gt;&lt;/code&gt; from &lt;code&gt;@threadplane/chat&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;chat&lt;/span&gt; &lt;span class="na"&gt;[agent]=&lt;/span&gt;&lt;span class="s"&gt;"agent"&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;chat-approval-card&lt;/span&gt; &lt;span class="na"&gt;[agent]=&lt;/span&gt;&lt;span class="s"&gt;"agent"&lt;/span&gt; &lt;span class="na"&gt;(action)=&lt;/span&gt;&lt;span class="s"&gt;"onApproval($event)"&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="nf"&gt;onApproval&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;action&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;ChatApprovalAction&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt; &lt;span class="k"&gt;void&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;void&lt;/span&gt; &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;agent&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;submit&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="na"&gt;resume&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;approved&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;action&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;approve&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="p"&gt;});&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here is a Playwright test that arms two runs, sends a message, and approves the refund, with no model and no backend.&lt;/p&gt;

&lt;p&gt;Create an &lt;strong&gt;e2e/approval.spec.ts&lt;/strong&gt; file:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;expect&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;test&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kd"&gt;type&lt;/span&gt; &lt;span class="nx"&gt;Page&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;@playwright/test&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;refundRuns&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
  &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="na"&gt;events&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
      &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;RUN_STARTED&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;threadId&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;t&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;runId&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;r1&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt;
      &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;TEXT_MESSAGE_START&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;messageId&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;ai-1&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;role&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;assistant&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt;
      &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;TEXT_MESSAGE_CONTENT&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;messageId&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;ai-1&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;delta&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;This needs your approval.&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt;
      &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;TEXT_MESSAGE_END&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;messageId&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;ai-1&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt;
      &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;RUN_FINISHED&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;threadId&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;t&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;runId&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;r1&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="na"&gt;outcome&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;interrupt&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;interrupts&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[{&lt;/span&gt; &lt;span class="na"&gt;id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;int-1&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;reason&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;confirmation&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;message&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Approve the $42 refund?&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="p"&gt;}]&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt;
      &lt;span class="p"&gt;},&lt;/span&gt;
    &lt;span class="p"&gt;],&lt;/span&gt;
  &lt;span class="p"&gt;},&lt;/span&gt;
  &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="na"&gt;events&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
      &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;RUN_STARTED&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;threadId&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;t&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;runId&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;r2&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt;
      &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;TEXT_MESSAGE_START&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;messageId&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;ai-2&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;role&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;assistant&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt;
      &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;TEXT_MESSAGE_CONTENT&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;messageId&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;ai-2&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;delta&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Refund issued.&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt;
      &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;TEXT_MESSAGE_END&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;messageId&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;ai-2&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt;
      &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;RUN_FINISHED&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;threadId&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;t&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;runId&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;r2&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;outcome&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;success&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt;
    &lt;span class="p"&gt;],&lt;/span&gt;
  &lt;span class="p"&gt;},&lt;/span&gt;
&lt;span class="p"&gt;];&lt;/span&gt;

&lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;armNextRuns&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;page&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;Page&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;runs&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;unknown&lt;/span&gt;&lt;span class="p"&gt;[]):&lt;/span&gt; &lt;span class="nb"&gt;Promise&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="k"&gt;void&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;page&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;evaluate&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nx"&gt;runs&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nb"&gt;Promise&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="k"&gt;void&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nx"&gt;resolve&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;reject&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;armId&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;crypto&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;randomUUID&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;timer&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;window&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;setTimeout&lt;/span&gt;&lt;span class="p"&gt;(()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="nf"&gt;cleanup&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
      &lt;span class="nf"&gt;reject&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Error&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Timed out waiting for the development agent hooks.&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
    &lt;span class="p"&gt;},&lt;/span&gt; &lt;span class="mi"&gt;3000&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;cleanup&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="nb"&gt;window&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;clearTimeout&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;timer&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
      &lt;span class="nb"&gt;window&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;removeEventListener&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;threadplane:devtools:ack&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;onAck&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;onAck&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="na"&gt;event&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;Event&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;ack&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;event&lt;/span&gt; &lt;span class="kd"&gt;as &lt;/span&gt;&lt;span class="nx"&gt;CustomEvent&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nx"&gt;detail&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
      &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;ack&lt;/span&gt;&lt;span class="p"&gt;?.&lt;/span&gt;&lt;span class="nx"&gt;armId&lt;/span&gt; &lt;span class="o"&gt;!==&lt;/span&gt; &lt;span class="nx"&gt;armId&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
      &lt;span class="nf"&gt;cleanup&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
      &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;ack&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;state&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;armed&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="nf"&gt;resolve&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
      &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="nf"&gt;reject&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Error&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;`Script rejected: &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;ack&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;reason&lt;/span&gt; &lt;span class="o"&gt;??&lt;/span&gt; &lt;span class="nx"&gt;ack&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;state&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="nb"&gt;window&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;addEventListener&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;threadplane:devtools:ack&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;onAck&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="nb"&gt;window&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;dispatchEvent&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;CustomEvent&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;threadplane:devtools:arm&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="na"&gt;detail&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;v&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;armId&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;adapter&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;ag-ui&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;runs&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt;
    &lt;span class="p"&gt;}));&lt;/span&gt;
  &lt;span class="p"&gt;}),&lt;/span&gt; &lt;span class="nx"&gt;runs&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nf"&gt;test&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;approving a refund finishes the turn&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;async &lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="nx"&gt;page&lt;/span&gt; &lt;span class="p"&gt;})&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;page&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;goto&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;/&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;input&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;page&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getByRole&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;textbox&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Type a message&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="p"&gt;});&lt;/span&gt;
  &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;expect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;input&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;toBeVisible&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;

  &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;armNextRuns&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;page&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;refundRuns&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

  &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;input&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;fill&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Refund order 42&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;page&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getByRole&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;button&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Send message&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="p"&gt;}).&lt;/span&gt;&lt;span class="nf"&gt;click&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;

  &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;page&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getByRole&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;button&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Approve&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="p"&gt;}).&lt;/span&gt;&lt;span class="nf"&gt;click&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
  &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;expect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;page&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getByText&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Refund issued.&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)).&lt;/span&gt;&lt;span class="nf"&gt;toBeVisible&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Let's review:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;First, we wait for the chat input, because the agent registers its listener when it's created.&lt;/li&gt;
&lt;li&gt;Then, &lt;code&gt;armNextRuns()&lt;/code&gt; dispatches the arm and waits for the &lt;code&gt;armed&lt;/code&gt; acknowledgement. A rejected script fails with its reason; missing development hooks fail after three seconds. Both paths remove the listener.&lt;/li&gt;
&lt;li&gt;The message takes &lt;code&gt;runs[0]&lt;/code&gt; and pauses on the interrupt, which opens the approval card.&lt;/li&gt;
&lt;li&gt;Clicking &lt;strong&gt;Approve&lt;/strong&gt; calls &lt;code&gt;submit({ resume })&lt;/code&gt;, which takes &lt;code&gt;runs[1]&lt;/code&gt; and finishes the turn.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Want to test &lt;strong&gt;Cancel&lt;/strong&gt; too?&lt;/p&gt;

&lt;p&gt;Arm the same script again and click &lt;strong&gt;Cancel&lt;/strong&gt; instead.&lt;/p&gt;

&lt;p&gt;Every arm is used once, so each test gets the exact same run.&lt;/p&gt;

&lt;h3&gt;
  
  
  Finding a stuck spinner
&lt;/h3&gt;

&lt;p&gt;When the UI says it's working forever, start with the Runs tab.&lt;/p&gt;

&lt;p&gt;If the run shows &lt;code&gt;aborted&lt;/code&gt; with a &lt;code&gt;run-never-terminated&lt;/code&gt; issue, the backend closed the stream without ending the run.&lt;/p&gt;

&lt;p&gt;That's a server fix, and there's an example of exactly that fix in the framework section near the end of this post.&lt;/p&gt;

&lt;p&gt;If the run finished cleanly, the problem is on the client, and that's where the signals report helps.&lt;/p&gt;

&lt;p&gt;Paste this into the console of your development build:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nb"&gt;window&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;addEventListener&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;threadplane:devtools&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;event&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;report&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;event&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;detail&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;report&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;kind&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;render&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;report&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;wrote&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;includes&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;status&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;report&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;adapter&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;report&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;eventType&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;report&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;wrote&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;join&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;, &lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For an AG-UI agent, a healthy run logs something like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ag-ui RUN_STARTED status, isLoading, error, interrupt, customEvents, activities
ag-ui RUN_FINISHED messages, status, isLoading, interruptSession, interrupt
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you see &lt;code&gt;RUN_STARTED&lt;/code&gt; and never a &lt;code&gt;RUN_FINISHED&lt;/code&gt; (or &lt;code&gt;RUN_ERROR&lt;/code&gt;), your agent never heard that the run ended.&lt;/p&gt;

&lt;p&gt;For a LangGraph agent, look for &lt;code&gt;run:start&lt;/code&gt; and &lt;code&gt;run:end&lt;/code&gt; instead.&lt;/p&gt;

&lt;h3&gt;
  
  
  Debugging generative UI
&lt;/h3&gt;

&lt;p&gt;When a generated component doesn't show up, open the UI tab.&lt;/p&gt;

&lt;p&gt;An &lt;strong&gt;unknown type&lt;/strong&gt; badge means your registry has no entry for that type, and &lt;strong&gt;fallback&lt;/strong&gt; means the component's props weren't ready yet.&lt;/p&gt;

&lt;p&gt;You can get the same answer from the render report in the console:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nb"&gt;window&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;addEventListener&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;threadplane:devtools&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;event&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;report&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;event&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;detail&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;report&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;kind&lt;/span&gt; &lt;span class="o"&gt;!==&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;render&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;table&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;report&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;elements&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;filter&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nx"&gt;element&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;element&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;state&lt;/span&gt; &lt;span class="o"&gt;!==&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;mounted&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Let's say the model asked for a &lt;code&gt;GoogleMap&lt;/code&gt; you never registered.&lt;/p&gt;

&lt;p&gt;The report shows the map as &lt;code&gt;unresolved&lt;/code&gt;, and the pin inside it as &lt;code&gt;hidden&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;key   type        state
map   GoogleMap   unresolved
pin   Text        hidden
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The fix is to add the component to the catalog you pass to &lt;code&gt;&amp;lt;chat&amp;gt;&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;withViews&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;@threadplane/render&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;GoogleMapComponent&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;./google-map.component&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;catalog&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;withViews&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;baseCatalog&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;GoogleMap&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;GoogleMapComponent&lt;/span&gt; &lt;span class="p"&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;chat&lt;/span&gt; &lt;span class="na"&gt;[agent]=&lt;/span&gt;&lt;span class="s"&gt;"agent"&lt;/span&gt; &lt;span class="na"&gt;[views]=&lt;/span&gt;&lt;span class="s"&gt;"catalog"&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;withViews()&lt;/code&gt; only adds new keys, so it won't replace anything already in your catalog.&lt;/p&gt;

&lt;h3&gt;
  
  
  Sharing a bug report
&lt;/h3&gt;

&lt;p&gt;When you need to report a protocol bug to someone else, export a redacted capture.&lt;/p&gt;

&lt;p&gt;In the Session tab, check &lt;strong&gt;Message text&lt;/strong&gt; and &lt;strong&gt;Tool arguments&lt;/strong&gt;, then click &lt;strong&gt;Download capture (.agui.jsonl)&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Each line in the file is one record, and the header says exactly what was redacted:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{"kind":"header","schemaVersion":1,"tool":"ag-ui-devtools@0.2.0","capturedAt":"2026-11-02T15:04:05.000Z","url":"http://localhost:4200","transport":"sse","redacted":["text","toolArgs"]}
{"kind":"event","connId":"c1","seq":3,"tMs":63,"event":{"type":"TEXT_MESSAGE_CONTENT","messageId":"m_1","delta":"«redacted: 23 chars»"}}
{"kind":"event","connId":"c1","seq":7,"tMs":131,"event":{"type":"TOOL_CALL_ARGS","toolCallId":"tc_1","delta":"«redacted: 16 chars»"}}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The event types, ids, ordering, sizes, and timings all survive, and that's what a protocol bug report needs.&lt;/p&gt;

&lt;p&gt;Whoever picks it up clicks &lt;strong&gt;Import&lt;/strong&gt; in their own panel and sees every event in order.&lt;/p&gt;

&lt;p&gt;Redacting tool arguments also removes the evidence needed to diagnose malformed argument JSON. Keep an unredacted capture locally for that investigation, and share sensitive arguments only through an appropriate private channel.&lt;/p&gt;

&lt;p&gt;Note, tool results are their own redaction group, so check &lt;strong&gt;Tool results&lt;/strong&gt; too if they contain anything private.&lt;/p&gt;

&lt;h3&gt;
  
  
  Turning a capture into a test
&lt;/h3&gt;

&lt;p&gt;If your agent runs on LangGraph Platform, &lt;strong&gt;Download Threadplane test (.spec.ts)&lt;/strong&gt; turns a capture into a Vitest spec.&lt;/p&gt;

&lt;p&gt;It replays each captured connection, frame by frame, through &lt;code&gt;MockAgentTransport&lt;/code&gt; from &lt;code&gt;@threadplane/langgraph&lt;/code&gt;, and asserts what the capture shows.&lt;/p&gt;

&lt;p&gt;Here is the heart of one, for a run that called a &lt;code&gt;get_weather&lt;/code&gt; tool:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="nf"&gt;it&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;replays connection c1 (run r-tool-calls)&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;async &lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;transport&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;MockAgentTransport&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
  &lt;span class="nx"&gt;TestBed&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;configureTestingModule&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
    &lt;span class="na"&gt;providers&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nf"&gt;provideAgent&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="na"&gt;apiUrl&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;''&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;assistantId&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;request_1&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;assistant_id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;transport&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;throttle&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt; &lt;span class="p"&gt;})],&lt;/span&gt;
  &lt;span class="p"&gt;});&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;agent&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;TestBed&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;runInInjectionContext&lt;/span&gt;&lt;span class="p"&gt;(()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nf"&gt;injectAgent&lt;/span&gt;&lt;span class="p"&gt;());&lt;/span&gt;

  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;submitted&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;agent&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;submit&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="na"&gt;state&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;request_1&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;input&lt;/span&gt; &lt;span class="p"&gt;});&lt;/span&gt;
  &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;transport&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;emit&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;frames_1&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;map&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;toStreamEvent&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
  &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;transport&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;close&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
  &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;submitted&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="k"&gt;catch&lt;/span&gt;&lt;span class="p"&gt;(()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="kc"&gt;undefined&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

  &lt;span class="nf"&gt;expect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;transport&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;streams&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]?.&lt;/span&gt;&lt;span class="nx"&gt;payload&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;toEqual&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;request_1&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;input&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="nf"&gt;expect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;agent&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;status&lt;/span&gt;&lt;span class="p"&gt;()).&lt;/span&gt;&lt;span class="nf"&gt;toBe&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;idle&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="nf"&gt;expect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;agent&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;interrupt&lt;/span&gt;&lt;span class="p"&gt;()).&lt;/span&gt;&lt;span class="nf"&gt;toBeFalsy&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
  &lt;span class="nf"&gt;expect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;lastAssistantText&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;agent&lt;/span&gt;&lt;span class="p"&gt;)).&lt;/span&gt;&lt;span class="nf"&gt;toBe&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;It is sunny in SF.&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="nf"&gt;expect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;agent&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;toolCalls&lt;/span&gt;&lt;span class="p"&gt;().&lt;/span&gt;&lt;span class="nf"&gt;map&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nx"&gt;call&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;call&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;name&lt;/span&gt;&lt;span class="p"&gt;)).&lt;/span&gt;&lt;span class="nf"&gt;toEqual&lt;/span&gt;&lt;span class="p"&gt;([&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;get_weather&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;]);&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The captured request and frames live at the top of the file, so the test needs no server.&lt;/p&gt;

&lt;p&gt;Change an assertion to the behavior you want, and you've got a regression test for that exact run.&lt;/p&gt;

&lt;h2&gt;
  
  
  What about building your own AG-UI framework?
&lt;/h2&gt;

&lt;p&gt;Building your own AG-UI framework isn't the norm.&lt;/p&gt;

&lt;p&gt;Most apps should use an adapter, like &lt;code&gt;@threadplane/ag-ui&lt;/code&gt; or &lt;code&gt;@threadplane/langgraph&lt;/code&gt;, and let it handle the protocol details for you.&lt;/p&gt;

&lt;p&gt;That said, I think building one is a fun learning exercise, and it's one of the best ways to really learn the protocol.&lt;/p&gt;

&lt;p&gt;If you go down that road, this is where the validator earns its keep.&lt;/p&gt;

&lt;p&gt;We did this for &lt;a href="https://b4.run" rel="noopener noreferrer"&gt;b4.run&lt;/a&gt;, our agent framework built on LangGraph.js.&lt;/p&gt;

&lt;p&gt;Its &lt;code&gt;@b4run/ag-ui&lt;/code&gt; package turns the runtime's stream into AG-UI events over SSE: text, reasoning, tool calls, subagents, and interrupts.&lt;/p&gt;

&lt;p&gt;Looking back through the pull requests, a lot of the bugs were protocol bugs:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A run cut off by the recursion limit or an abort left tool calls with no results (&lt;a href="https://github.com/cacheplane/b4run/pull/893" rel="noopener noreferrer"&gt;b4run#893&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;Reasoning messages weren't always closed at a tool call or an interrupt (&lt;a href="https://github.com/cacheplane/b4run/pull/910" rel="noopener noreferrer"&gt;b4run#910&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;Streamed tool arguments had to join back into exactly the JSON the model produced (&lt;a href="https://github.com/cacheplane/b4run/pull/781" rel="noopener noreferrer"&gt;b4run#781&lt;/a&gt;).&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Let's look at an example.&lt;/p&gt;

&lt;p&gt;Here is a simplified AG-UI endpoint in Express.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;runtime.stream()&lt;/code&gt; and &lt;code&gt;toAguiEvents()&lt;/code&gt; stand in for your framework's runtime and its event translation:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="nx"&gt;app&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;post&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;/agent&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;async &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;req&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;threadId&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;runId&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;req&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;body&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;setHeader&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Content-Type&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;text/event-stream&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;send&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="na"&gt;event&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;object&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;write&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;`data: &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;JSON&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;stringify&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;event&lt;/span&gt;&lt;span class="p"&gt;)}&lt;/span&gt;&lt;span class="s2"&gt;\n\n`&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

  &lt;span class="k"&gt;try&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nf"&gt;send&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;RUN_STARTED&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;threadId&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;runId&lt;/span&gt; &lt;span class="p"&gt;});&lt;/span&gt;
    &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="k"&gt;await &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;chunk&lt;/span&gt; &lt;span class="k"&gt;of&lt;/span&gt; &lt;span class="nx"&gt;runtime&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;stream&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;req&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;body&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="k"&gt;for &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;event&lt;/span&gt; &lt;span class="k"&gt;of&lt;/span&gt; &lt;span class="nf"&gt;toAguiEvents&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;chunk&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="nf"&gt;send&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;event&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="nf"&gt;send&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;RUN_FINISHED&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;threadId&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;runId&lt;/span&gt; &lt;span class="p"&gt;});&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;catch &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;err&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;error&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;err&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;finally&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;end&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That looks reasonable, right?&lt;/p&gt;

&lt;p&gt;Now let's say the runtime throws in the middle of a &lt;code&gt;search_flights&lt;/code&gt; tool call.&lt;/p&gt;

&lt;p&gt;The error is logged, the stream closes cleanly, and the client never hears that the run ended.&lt;/p&gt;

&lt;p&gt;Here is what the panel reports for that run:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ERROR    run-never-terminated
         Connection closed without RUN_FINISHED or RUN_ERROR
WARNING  unclosed-tool-call
         Tool call "tc_1" was never closed with TOOL_CALL_END
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The Runs tab shows the run as &lt;code&gt;aborted&lt;/code&gt;, too.&lt;/p&gt;

&lt;p&gt;I should note that &lt;code&gt;verifyEvents()&lt;/code&gt; from &lt;code&gt;@ag-ui/client&lt;/code&gt; (1.0.1) accepts this exact stream without an error.&lt;/p&gt;

&lt;p&gt;It checks each event as it arrives, so nothing complains about the events that never arrived.&lt;/p&gt;

&lt;p&gt;Let's fix it.&lt;/p&gt;

&lt;p&gt;We'll track what's open, close it when something goes wrong, and end the run with &lt;code&gt;RUN_ERROR&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="nx"&gt;app&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;post&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;/agent&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;async &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;req&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;threadId&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;runId&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;req&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;body&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;setHeader&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Content-Type&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;text/event-stream&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;openMessages&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nb"&gt;Set&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="kr"&gt;string&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;openToolCalls&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nb"&gt;Set&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="kr"&gt;string&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;send&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="na"&gt;event&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;string&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="na"&gt;key&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;string&lt;/span&gt;&lt;span class="p"&gt;]:&lt;/span&gt; &lt;span class="nx"&gt;unknown&lt;/span&gt; &lt;span class="p"&gt;})&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;event&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="kd"&gt;type&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;TEXT_MESSAGE_START&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="nx"&gt;openMessages&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;add&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;event&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;messageId&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="kd"&gt;as &lt;/span&gt;&lt;span class="kr"&gt;string&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;event&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="kd"&gt;type&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;TEXT_MESSAGE_END&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="nx"&gt;openMessages&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="k"&gt;delete&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;event&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;messageId&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="kd"&gt;as &lt;/span&gt;&lt;span class="kr"&gt;string&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;event&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="kd"&gt;type&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;TOOL_CALL_START&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="nx"&gt;openToolCalls&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;add&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;event&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;toolCallId&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="kd"&gt;as &lt;/span&gt;&lt;span class="kr"&gt;string&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;event&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="kd"&gt;type&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;TOOL_CALL_END&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="nx"&gt;openToolCalls&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="k"&gt;delete&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;event&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;toolCallId&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="kd"&gt;as &lt;/span&gt;&lt;span class="kr"&gt;string&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;write&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;`data: &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;JSON&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;stringify&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;event&lt;/span&gt;&lt;span class="p"&gt;)}&lt;/span&gt;&lt;span class="s2"&gt;\n\n`&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="p"&gt;};&lt;/span&gt;

  &lt;span class="k"&gt;try&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nf"&gt;send&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;RUN_STARTED&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;threadId&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;runId&lt;/span&gt; &lt;span class="p"&gt;});&lt;/span&gt;
    &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="k"&gt;await &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;chunk&lt;/span&gt; &lt;span class="k"&gt;of&lt;/span&gt; &lt;span class="nx"&gt;runtime&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;stream&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;req&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;body&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="k"&gt;for &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;event&lt;/span&gt; &lt;span class="k"&gt;of&lt;/span&gt; &lt;span class="nf"&gt;toAguiEvents&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;chunk&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="nf"&gt;send&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;event&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="nf"&gt;send&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;RUN_FINISHED&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;threadId&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;runId&lt;/span&gt; &lt;span class="p"&gt;});&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;catch &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;err&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;for &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;toolCallId&lt;/span&gt; &lt;span class="k"&gt;of&lt;/span&gt; &lt;span class="p"&gt;[...&lt;/span&gt;&lt;span class="nx"&gt;openToolCalls&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt; &lt;span class="nf"&gt;send&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;TOOL_CALL_END&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;toolCallId&lt;/span&gt; &lt;span class="p"&gt;});&lt;/span&gt;
    &lt;span class="k"&gt;for &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;messageId&lt;/span&gt; &lt;span class="k"&gt;of&lt;/span&gt; &lt;span class="p"&gt;[...&lt;/span&gt;&lt;span class="nx"&gt;openMessages&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt; &lt;span class="nf"&gt;send&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;TEXT_MESSAGE_END&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;messageId&lt;/span&gt; &lt;span class="p"&gt;});&lt;/span&gt;
    &lt;span class="nf"&gt;send&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;RUN_ERROR&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;message&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;err&lt;/span&gt; &lt;span class="k"&gt;instanceof&lt;/span&gt; &lt;span class="nb"&gt;Error&lt;/span&gt; &lt;span class="p"&gt;?&lt;/span&gt; &lt;span class="nx"&gt;err&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;message&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Run failed&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="p"&gt;});&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;finally&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;end&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Let's break this down:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;First, &lt;code&gt;send()&lt;/code&gt; keeps track of every message and tool call that's still open.&lt;/li&gt;
&lt;li&gt;Then, when the runtime throws, we close whatever is still open.&lt;/li&gt;
&lt;li&gt;Finally, we end the run with &lt;code&gt;RUN_ERROR&lt;/code&gt;, so the client knows the run is over (and your spinner stops).&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Capture the same failure again, and the run now ends as &lt;code&gt;error&lt;/code&gt; instead of &lt;code&gt;aborted&lt;/code&gt;, with no &lt;code&gt;run-never-terminated&lt;/code&gt; or &lt;code&gt;unclosed-tool-call&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;If the runtime threw in the middle of the tool call's arguments, you'll still get a &lt;code&gt;tool-args-not-json&lt;/code&gt; error on the &lt;code&gt;TOOL_CALL_END&lt;/code&gt;, and that's accurate: the arguments never finished.&lt;/p&gt;

&lt;p&gt;b4.run goes one step further in &lt;a href="https://github.com/cacheplane/b4run/pull/893" rel="noopener noreferrer"&gt;b4run#893&lt;/a&gt; and also writes a result for each tool call that was cut off, because model providers reject a history with unanswered tool calls.&lt;/p&gt;

&lt;p&gt;The validator catches a couple of other framework mistakes worth knowing about.&lt;/p&gt;

&lt;p&gt;If the streamed arguments don't join into valid JSON, the &lt;code&gt;TOOL_CALL_END&lt;/code&gt; gets this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ERROR    tool-args-not-json
         Accumulated arguments for tool call "tc_1" are not valid JSON
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And if your framework streams state, a JSON Patch that can't be applied is flagged on the &lt;code&gt;STATE_DELTA&lt;/code&gt; that sent it, like &lt;code&gt;STATE_DELTA op 1 (add /booking/seat) failed: parent-not-found&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;The State tab shows you the exact operation, and the state stops advancing at that frame:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fn4bggj6q7tfbfbsl5j32.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fn4bggj6q7tfbfbsl5j32.png" alt="A failed JSON Patch in the State tab" width="800" height="391"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The panel isn't a replacement for a conformance test suite.&lt;/p&gt;

&lt;p&gt;b4.run runs its stream through the official AG-UI client's event verification in its tests, and I'd recommend you do the same.&lt;/p&gt;

&lt;p&gt;But for me, the panel is the fastest way to see &lt;em&gt;where&lt;/em&gt; a stream went wrong while you're building.&lt;/p&gt;

&lt;h2&gt;
  
  
  What does this cost in production?
&lt;/h2&gt;

&lt;p&gt;Nothing.&lt;/p&gt;

&lt;p&gt;The Threadplane hooks only exist in Angular development mode.&lt;/p&gt;

&lt;p&gt;A production build removes them from the bundle entirely, and Threadplane's CI checks the built bundle for them.&lt;/p&gt;

&lt;p&gt;In development, the reports are fire-and-forget, so the page can't even tell whether the extension is listening.&lt;/p&gt;

&lt;p&gt;If you want them off in development too, set this before your agents are created:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="nb"&gt;window&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;__THREADPLANE_DEVTOOLS_DISABLED__&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;In conclusion, AG-UI DevTools gives you a real view of your agent's event stream: every event in order, protocol issues named and located, state replayed patch by patch, and generated UI checked node by node.&lt;/p&gt;

&lt;p&gt;With a Threadplane 0.3.4+ development build, you also get the Signals and Simulate tabs.&lt;/p&gt;

&lt;p&gt;Give it a try, and let me know what you'd like to see next.&lt;/p&gt;

&lt;p&gt;Issues and ideas are very welcome on the &lt;a href="https://github.com/blove/ag-ui-chrome-extension/issues" rel="noopener noreferrer"&gt;AG-UI DevTools repo&lt;/a&gt;. 💙&lt;/p&gt;

</description>
      <category>angular</category>
      <category>agui</category>
      <category>langgraph</category>
      <category>devtools</category>
    </item>
    <item>
      <title>json-render vs A2UI: Choosing a Generative UI Contract</title>
      <dc:creator>Brian Love</dc:creator>
      <pubDate>Thu, 05 Nov 2026 16:00:39 +0000</pubDate>
      <link>https://dev.to/blove/json-render-vs-a2ui-choosing-a-generative-ui-contract-158l</link>
      <guid>https://dev.to/blove/json-render-vs-a2ui-choosing-a-generative-ui-contract-158l</guid>
      <description>&lt;p&gt;Threadplane gives you two ways to let an agent build UI: a json-render spec or an A2UI surface.&lt;br&gt;
Let's figure out how to pick.&lt;/p&gt;

&lt;p&gt;I think of it as a ladder: markdown when text is the best UI → a fixed spec when you can validate the whole thing up front → a live protocol when the surface keeps changing.&lt;br&gt;
The &lt;a href="https://threadplane.ai/docs/render/concepts/json-render-vs-a2ui" rel="noopener noreferrer"&gt;mechanical comparison&lt;/a&gt; covers what each layer does.&lt;br&gt;
This post answers the question that page ends on: which rung is yours?&lt;/p&gt;
&lt;h2&gt;
  
  
  What's actually different?
&lt;/h2&gt;

&lt;p&gt;This isn't a renderer shootout.&lt;br&gt;
The tradeoff is contract shape.&lt;/p&gt;

&lt;p&gt;With json-render, the contract is &lt;em&gt;application-owned&lt;/em&gt;.&lt;br&gt;
You define the schema, you validate the spec before anything mounts, and your handlers own what every event means.&lt;/p&gt;

&lt;p&gt;With A2UI, the surface is &lt;em&gt;agent-owned&lt;/em&gt;.&lt;br&gt;
The agent creates it, keeps updating it over the life of the conversation, and gets structured actions back when the user interacts.&lt;/p&gt;

&lt;p&gt;Let's look at the same order card in both shapes.&lt;br&gt;
First, as a json-render spec:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"root"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"card"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"elements"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"card"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"type"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Card"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"props"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{},&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"children"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"body"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"body"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"type"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Column"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"props"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{},&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"children"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"title"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"total"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"title"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"type"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Text"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"props"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"text"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Order #1042"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"variant"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"h4"&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"total"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"type"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Text"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"props"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"text"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"$118.00"&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And as an A2UI JSONL stream:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{"version":"v0.9","createSurface":{"surfaceId":"order","catalogId":"https://a2ui.org/specification/v0_9/catalogs/basic/catalog.json"}}
{"version":"v0.9","updateComponents":{"surfaceId":"order","components":[{"id":"root","component":"Text","text":{"path":"/total"}}]}}
{"version":"v0.9","updateDataModel":{"surfaceId":"order","path":"/total","value":"$118.00"}}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;(I trimmed this one to the total line. The full card is just more components in the &lt;code&gt;updateComponents&lt;/code&gt; envelope. What matters is the shape: structure in one message, data in another.)&lt;/p&gt;

&lt;p&gt;One is a document you can validate before you show it; the other is a conversation you subscribe to.&lt;/p&gt;

&lt;h2&gt;
  
  
  When does the fixed spec win?
&lt;/h2&gt;

&lt;p&gt;Whenever the UI is one answer: the agent responds once, the UI renders once, and it's done.&lt;/p&gt;

&lt;p&gt;Let's walk two scenarios to a verdict.&lt;/p&gt;

&lt;p&gt;A &lt;em&gt;structured result card&lt;/em&gt; in chat: the agent looks up an order and answers with a summary card.&lt;br&gt;
Nothing about that card changes after it lands, so there's no ongoing surface to manage.&lt;br&gt;
Verdict: json-render.&lt;br&gt;
You get to validate the whole spec before mount, and your handlers (not the protocol) decide what a click means.&lt;/p&gt;

&lt;p&gt;A &lt;em&gt;dashboard or results panel&lt;/em&gt; outside chat: your application already has the data and wants a model (or a config file, honestly) to describe the layout.&lt;br&gt;
Verdict: json-render again, driven directly through &lt;code&gt;&amp;lt;render-spec&amp;gt;&lt;/code&gt;.&lt;br&gt;
The fixed contract is the feature here: explicit inputs on your own custom components, a schema you can lint, a spec you can snapshot in a test.&lt;/p&gt;

&lt;p&gt;One security note: in both paths, the registry is doing allowlist duty.&lt;br&gt;
A component name the model emits that isn't registered falls back instead of executing.&lt;br&gt;
json-render and A2UI share that posture, so it's not a reason to pick either.&lt;/p&gt;

&lt;h2&gt;
  
  
  When does the protocol win?
&lt;/h2&gt;

&lt;p&gt;Whenever the surface has to live past its first render.&lt;/p&gt;

&lt;p&gt;Let's consider the itinerary case.&lt;br&gt;
The agent proposes a three-day trip mid-conversation: the component structure arrives first, prices and times fill in as &lt;code&gt;updateDataModel&lt;/code&gt; messages land, and two turns later the agent swaps day two entirely.&lt;br&gt;
That isn't one spec becoming one component tree.&lt;br&gt;
It's a surface being edited over time, and that's exactly what the envelope stream models.&lt;/p&gt;

&lt;p&gt;Now a form the &lt;em&gt;agent&lt;/em&gt; needs back.&lt;br&gt;
A &lt;em&gt;valid&lt;/em&gt; submit goes back to the agent as a structured action message on its own; create the surface with &lt;code&gt;sendDataModel&lt;/code&gt; and the current data model rides along.&lt;br&gt;
Either way, user input flows back through the protocol, not through handlers you wire yourself.&lt;/p&gt;

&lt;p&gt;So the reasons to step up: incremental surfaces, data arriving separately from structure, and user actions as first-class protocol messages.&lt;/p&gt;

&lt;p&gt;For me, the real cost is protocol discipline.&lt;br&gt;
Envelopes have to be valid and arrive in a sensible order, the catalog has to support every component type the agent names, and someone has to actually design the action semantics.&lt;br&gt;
A fixed spec asks for none of that.&lt;/p&gt;

&lt;h2&gt;
  
  
  What does it cost to switch?
&lt;/h2&gt;

&lt;p&gt;Inside chat, less than you'd think.&lt;/p&gt;

&lt;p&gt;The same &lt;code&gt;[views]&lt;/code&gt; catalog feeds both paths, and chat detects the contract from the first bytes: &lt;code&gt;{&lt;/code&gt; means a json-render spec, &lt;code&gt;---a2ui_JSON---&lt;/code&gt; means A2UI JSONL.&lt;br&gt;
So the choice is per-surface, not per-app, and it's revisable.&lt;/p&gt;

&lt;p&gt;For me, the default is to start with json-render, and step up to A2UI only when a surface genuinely needs to live past its first render.&lt;br&gt;
You're not locked in either way, so the cheap contract is the right place to begin.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;The heuristic is short.&lt;br&gt;
If you can validate the entire UI before it renders, start with json-render.&lt;br&gt;
If the surface keeps changing after it lands (data trickling in, actions coming back, edits across turns), use A2UI.&lt;/p&gt;

&lt;p&gt;The &lt;a href="https://threadplane.ai/docs/render/concepts/json-render-vs-a2ui" rel="noopener noreferrer"&gt;mechanical comparison&lt;/a&gt; has the layer-by-layer details, the &lt;a href="https://threadplane.ai/docs/chat/guides/generative-ui" rel="noopener noreferrer"&gt;generative UI guide&lt;/a&gt; wires up the json-render path end to end, and the &lt;a href="https://threadplane.ai/docs/chat/a2ui/overview" rel="noopener noreferrer"&gt;A2UI overview&lt;/a&gt; does the same for surfaces.&lt;br&gt;
Pick a surface you're building this week, run it up the ladder, and let me know where it lands.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>angular</category>
      <category>webdev</category>
      <category>architecture</category>
    </item>
    <item>
      <title>LangGraph Subgraphs: When to Split a Graph and When Not To</title>
      <dc:creator>Brian Love</dc:creator>
      <pubDate>Tue, 03 Nov 2026 16:00:41 +0000</pubDate>
      <link>https://dev.to/blove/langgraph-subgraphs-when-to-split-a-graph-and-when-not-to-1ep4</link>
      <guid>https://dev.to/blove/langgraph-subgraphs-when-to-split-a-graph-and-when-not-to-1ep4</guid>
      <description>&lt;p&gt;Most people reach for a LangGraph subgraph expecting a &lt;em&gt;state&lt;/em&gt; boundary, and what they actually get is an &lt;em&gt;observable&lt;/em&gt; one.&lt;/p&gt;

&lt;p&gt;If your question is "single agent, approval loop, or multi-agent?", that's an architecture question, and the &lt;a href="https://threadplane.ai/docs/langgraph/concepts/agent-architecture" rel="noopener noreferrer"&gt;decision matrix&lt;/a&gt; already answers it.&lt;br&gt;
This post is about the layer underneath: what a subgraph actually changes at runtime, why our own graphs got split, and what the frontend sees while a child is running.&lt;/p&gt;
&lt;h2&gt;
  
  
  What does a subgraph actually give you?
&lt;/h2&gt;

&lt;p&gt;Nested execution and namespaced stream events.&lt;br&gt;
That's the whole list.&lt;/p&gt;

&lt;p&gt;Let's start with the canonical pattern, which is small.&lt;br&gt;
Compile a child &lt;code&gt;StateGraph&lt;/code&gt;, then add the compiled graph as a node in the parent:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;research_builder&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;StateGraph&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;MessagesState&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;research_builder&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;add_node&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;search&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;search_web&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;research_builder&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;add_edge&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;START&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;search&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;research_subgraph&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;research_builder&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;compile&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;

&lt;span class="n"&gt;builder&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;StateGraph&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;MessagesState&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;builder&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;add_node&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;research&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;research_subgraph&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;  &lt;span class="c1"&gt;# a compiled graph, used as a node
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Two things change.&lt;br&gt;
The child runs as its own graph, with its own nodes and its own step sequence, rather than being flattened into the parent's.&lt;br&gt;
And LangGraph emits the child's stream events under a namespace, so a consumer can tell parent output from child output.&lt;/p&gt;

&lt;p&gt;I think state isolation gets assumed as a third thing, and it shouldn't be.&lt;/p&gt;

&lt;p&gt;If parent and child share &lt;code&gt;MessagesState&lt;/code&gt;, the child appends to the same message list the parent is building.&lt;br&gt;
Nothing about &lt;code&gt;add_node&lt;/code&gt; fenced anything off.&lt;/p&gt;

&lt;p&gt;Isolation is something you design.&lt;br&gt;
Give the child its own state schema, then map in at the boundary and map the result back out.&lt;br&gt;
That's a decision you make and maintain, not a property &lt;code&gt;compile()&lt;/code&gt; hands you.&lt;/p&gt;

&lt;p&gt;We ship one graph that does exactly that, and because it's a capability demo built to show the primitive, it's a clean look at the shape.&lt;br&gt;
Its child state schema has no &lt;code&gt;messages&lt;/code&gt; key at all.&lt;br&gt;
Parent and child share exactly two keys, &lt;code&gt;research_topic&lt;/code&gt; and &lt;code&gt;research_brief&lt;/code&gt;, so the child is handed a topic and hands back a brief.&lt;br&gt;
It can't read the transcript, and it can't append to one.&lt;/p&gt;

&lt;p&gt;That boundary is real, and none of it came from &lt;code&gt;compile()&lt;/code&gt;.&lt;br&gt;
It came from writing two &lt;code&gt;TypedDict&lt;/code&gt;s and being deliberate about what they share.&lt;/p&gt;
&lt;h3&gt;
  
  
  What about context windows and error boundaries?
&lt;/h3&gt;

&lt;p&gt;Those are real reasons to split (our own docs lean on them).&lt;br&gt;
The &lt;a href="https://threadplane.ai/docs/langgraph/guides/subgraphs" rel="noopener noreferrer"&gt;subgraphs guide&lt;/a&gt; points at per-task context windows and failure containment as reasons to reach for subagents, and the docstring on our own research child's only node calls it "a focused contractor."&lt;/p&gt;

&lt;p&gt;But let's look at where each one actually comes from.&lt;br&gt;
A narrow context window is a consequence of what you pass into the child's &lt;code&gt;ainvoke&lt;/code&gt;; you get it by handing over a topic instead of a transcript.&lt;br&gt;
An error boundary is a consequence of how the parent handles a failed child call, and a node-level retry wraps any node, plain function or compiled graph alike.&lt;br&gt;
Reuse across parents is a consequence of the child being a value you can reference twice.&lt;/p&gt;

&lt;p&gt;You can have all three without ever compiling a child graph, and you can compile a child graph and get none of them.&lt;/p&gt;

&lt;p&gt;There's one more, and it's worth stating because it looks like a counterexample.&lt;br&gt;
Wire the child in as a node under a parent that has a checkpointer, and the child's steps get checkpointed under its namespace, which is what lets you interrupt and resume at child granularity.&lt;br&gt;
That's the namespace again, doing a second job.&lt;/p&gt;
&lt;h2&gt;
  
  
  Why do people really split?
&lt;/h2&gt;

&lt;p&gt;In our own repo, the honest answer is: so the frontend can see the delegation.&lt;/p&gt;

&lt;p&gt;That's a claim about our own graphs, not a law of the framework (and one of them splits for a different reason entirely, which I'll get to).&lt;br&gt;
But it's a natural experiment rather than a portfolio.&lt;br&gt;
Nobody wrote these to prove a point about subgraphs, and the constraint that drove them, a frontend that renders per-child progress, isn't specific to us.&lt;/p&gt;

&lt;p&gt;Here's the comment we wrote at the time, sitting above the research subagent in our canonical &lt;code&gt;examples/chat&lt;/code&gt; graph:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="c1"&gt;# Research subagent — a small compiled child graph the parent dispatches
# via the `research` @tool. Running it as an actual subgraph (vs. inline
# logic) is what causes LangGraph to emit stream events under namespace
# prefix `tools:&amp;lt;id&amp;gt;` for the child run, which is what the @threadplane/langgraph
# SubagentTracker keys on to populate `agent.subagents()`.
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That's not a state argument.&lt;br&gt;
It's a visibility argument.&lt;/p&gt;

&lt;p&gt;The design doc for that feature is blunter still.&lt;br&gt;
Here's the alternative it rejected:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Plain `@tool` returning a synthesized "subagent" payload — Simpler graph
code but does not exercise the SubagentTracker code path: no `tools:`
namespace events get emitted because no subgraph runs. The card would
render empty. Rejected.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Our &lt;code&gt;cockpit/chat/subagents&lt;/code&gt; demo makes the same call.&lt;br&gt;
Its three specialists dispatch through a real compiled child graph because the subgraph run is what emits namespace events, and the namespace events are what the tracker turns into per-child progress.&lt;br&gt;
Run the specialists as a flat in-process helper and the feature still works; the UI just can't see it working.&lt;/p&gt;

&lt;p&gt;In both of those graphs the compiled child is invoked from inside a &lt;code&gt;@tool&lt;/code&gt; body, not wired in as a plain node.&lt;br&gt;
That's deliberate: the tool call carries the identity, an id the tracker can attribute the child's stream to, and a &lt;code&gt;subagent_type&lt;/code&gt; to name it.&lt;/p&gt;

&lt;p&gt;A plain &lt;code&gt;add_node&lt;/code&gt; subgraph has an identity too, just a thinner one.&lt;br&gt;
Its namespace segment is unique per invocation and prefixed with the node name, so it registers in &lt;code&gt;subagents()&lt;/code&gt; under its namespace key the moment it first streams, named by its node.&lt;br&gt;
The subgraph is what makes the events observable; the tool call upgrades that identity from a node name to a real delegation record, with arguments a UI can render.&lt;/p&gt;
&lt;h2&gt;
  
  
  What does the frontend see while a child runs?
&lt;/h2&gt;

&lt;p&gt;Namespaced events, and nearly everything interesting downstream follows from that one fact.&lt;/p&gt;
&lt;h3&gt;
  
  
  What does the wire look like?
&lt;/h3&gt;

&lt;p&gt;The event type carries the namespace after a pipe, so the base type is the part before it:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;messages                 # parent
messages|tools:&amp;lt;uuid&amp;gt;    # a child run, streaming under its own namespace
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Our transport requests those child streams by default: &lt;code&gt;streamSubgraphs&lt;/code&gt; is &lt;code&gt;true&lt;/code&gt; unless you turn it off.&lt;br&gt;
That's the LangGraph JS SDK's own option name, passed straight through, and it's worth knowing if you're coming from the Python API, where the in-process &lt;code&gt;graph.stream()&lt;/code&gt; equivalent is the &lt;code&gt;subgraphs=True&lt;/code&gt; kwarg.&lt;/p&gt;
&lt;h3&gt;
  
  
  What's the terminal-event hazard?
&lt;/h3&gt;

&lt;p&gt;A child graph terminates before the parent does, and a child's terminal event looks an awful lot like the parent's.&lt;/p&gt;

&lt;p&gt;Without a namespace guard, that child terminal marker gets read as "the run finished" and closes out the parent's still-streaming assistant message.&lt;br&gt;
We guard it by refusing namespaced events as top-level terminal evidence, and there's a test that feeds a namespaced terminal marker in and asserts the parent message settles with outcome &lt;code&gt;interrupted&lt;/code&gt; rather than success.&lt;/p&gt;

&lt;p&gt;If you ever write a transport against this stream yourself, that's the bug you'll hit, and it'll look like truncation rather than a namespace bug.&lt;/p&gt;
&lt;h3&gt;
  
  
  Where does child text go?
&lt;/h3&gt;

&lt;p&gt;Onto the child's stream, and nowhere else.&lt;/p&gt;

&lt;p&gt;Any consumer reading a namespaced stream has to decide what a child's tokens mean, and "append them like everything else" is the path of least resistance.&lt;br&gt;
It's also a trap, and a well-hidden one.&lt;br&gt;
Merge a child's tokens into the transcript and its internal notes render as their own chat bubble mid-stream.&lt;br&gt;
Then the parent's final &lt;code&gt;values&lt;/code&gt; event rewrites the message list from authoritative graph state, and the stray bubble disappears on its own.&lt;br&gt;
The end state looks right.&lt;br&gt;
The streaming pass didn't.&lt;/p&gt;

&lt;p&gt;So we don't make it a decision at all.&lt;br&gt;
A namespaced event belongs to its child, structurally: it feeds that child's &lt;code&gt;messages()&lt;/code&gt; on the subagent stream and never merges into the parent transcript.&lt;br&gt;
There's no opt-out flag because there's nothing to opt out of.&lt;br&gt;
What the transcript shows at settle is decided by state: a shared &lt;code&gt;messages&lt;/code&gt; key delivers the child's message through the final &lt;code&gt;values&lt;/code&gt; sync, and an isolated child schema means it never arrives.&lt;br&gt;
&lt;code&gt;transcriptNodeNames&lt;/code&gt; still exists for the genuinely separate problem of &lt;em&gt;top-level&lt;/em&gt; side-effect nodes, like routers and title generators.&lt;/p&gt;
&lt;h3&gt;
  
  
  How does a child get attributed?
&lt;/h3&gt;

&lt;p&gt;By an announced binding, and for me this is the part of the design I'd steal for any protocol.&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;tools:&amp;lt;uuid&amp;gt;&lt;/code&gt; namespace a child streams under is a checkpoint id, assigned independently of the parent's tool-call id.&lt;br&gt;
Nothing on the wire links the two.&lt;br&gt;
But the server knows both halves.&lt;br&gt;
So the graph announces the pair: one custom event pairing the child's checkpoint namespace with its tool-call id, emitted from inside the tool body.&lt;br&gt;
The tracker treats that binding as authoritative.&lt;br&gt;
It never overrides an established mapping, it works with any number of children in flight, and it replays any chunks that streamed before the binding arrived.&lt;/p&gt;

&lt;p&gt;There's also a description-comparison ladder for graphs that don't announce: exact match on the tool call's &lt;code&gt;description&lt;/code&gt; argument, then substring either direction, then a positional fallback that only fires when exactly one unmapped subagent is still pending or running.&lt;br&gt;
That last rung is deliberately conservative.&lt;br&gt;
With parallel children in flight, guessing would cross-wire one card's output into another, so an unattributed stream stays buffered instead.&lt;br&gt;
An empty card beats a confidently wrong one.&lt;/p&gt;

&lt;p&gt;The general point is worth carrying to any protocol.&lt;br&gt;
A consumer mapping child runs onto delegations is doing string matching unless something hands it an id.&lt;br&gt;
Here the graph hands it one, which is why the ladder is a fallback, and why it would be load-bearing in a stack that can't announce.&lt;/p&gt;

&lt;p&gt;Nesting is worth knowing about too.&lt;br&gt;
A subagent that itself delegates gets its own entry in &lt;code&gt;subagents()&lt;/code&gt;, keyed by its namespace path, the same way a plain subgraph node does.&lt;br&gt;
Each level of delegation surfaces as its own stream; the map stays flat, so there's no parent/child tree to walk.&lt;/p&gt;
&lt;h2&gt;
  
  
  When should you not split?
&lt;/h2&gt;

&lt;p&gt;When there's no observable boundary to draw and no genuinely divergent state.&lt;/p&gt;

&lt;p&gt;The cleanest evidence I have is a control group we didn't set out to build.&lt;br&gt;
Our &lt;code&gt;cockpit/ag-ui/subagents&lt;/code&gt; capability ships the same three-subagent feature as the LangGraph one.&lt;br&gt;
It's a LangGraph &lt;code&gt;StateGraph&lt;/code&gt; too: same framework, same orchestrator-plus-&lt;code&gt;task&lt;/code&gt;-tool shape, same three roles, same cards in the UI, with no subgraph anywhere.&lt;br&gt;
Its module docstring says so outright:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Mirrors cockpit/chat/subagents' orchestrator + `task` tool + `_run_subagent`
structure, but each dispatch emits `subagent_activity` CUSTOM events [...]
The backend's SubagentEmittingAgent expands those CUSTOM events into the
protocol's standard SUBAGENT_STARTED / TEXT_MESSAGE_* (attributed via
subagentRunId) / SUBAGENT_FINISHED / SUBAGENT_ERROR events
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The thing that differs is the transport.&lt;br&gt;
AG-UI already carries first-class delegation events: &lt;code&gt;SUBAGENT_STARTED&lt;/code&gt;, &lt;code&gt;SUBAGENT_FINISHED&lt;/code&gt;, and content events attributed to a child run.&lt;br&gt;
So the specialists stayed a flat &lt;code&gt;async&lt;/code&gt; helper, the tool body dispatches its progress as custom events, and a thin wrapper on the server expands those into the protocol's standard subagent events on the wire.&lt;/p&gt;

&lt;p&gt;The subgraph was never required by the feature.&lt;br&gt;
It was required by the transport.&lt;/p&gt;

&lt;p&gt;You could dispatch custom events from the LangGraph graph too.&lt;br&gt;
Nothing stops you, and &lt;code&gt;adispatch_custom_event&lt;/code&gt; is a LangChain primitive, not an AG-UI one.&lt;br&gt;
What namespaces buy is that you don't have to.&lt;br&gt;
The boundary emits its own identity for free, and a transport that reads it works against any graph rather than any graph that remembered to instrument itself.&lt;/p&gt;

&lt;p&gt;Staying flat wasn't free.&lt;br&gt;
There's no separate state schema to isolate anything into, and no child step sequence; every specialist gets the parent's shape, one LLM call wide.&lt;br&gt;
What it bought was one fewer graph for a feature that renders identically.&lt;/p&gt;

&lt;p&gt;For me, that's the test.&lt;br&gt;
If your transport already has a way to say "a child is working right now," or your UI doesn't render per-child progress at all, then a subgraph is a boundary you now have to defend: an extra state schema, mapping at both edges, and one more place to look when a message goes missing.&lt;/p&gt;

&lt;p&gt;And splitting because a region of the graph &lt;em&gt;feels&lt;/em&gt; like a separate concern isn't a reason on its own.&lt;br&gt;
A node is already a unit.&lt;/p&gt;

&lt;h3&gt;
  
  
  So when does a split earn itself?
&lt;/h3&gt;

&lt;p&gt;When the child really is a different graph.&lt;br&gt;
The repo has exactly one of those, and after arguing the other side this whole time, it's only fair to show it.&lt;/p&gt;

&lt;p&gt;Our &lt;code&gt;examples/ag-ui&lt;/code&gt; demo runs on that same AG-UI transport, and its research tool reaches the frontend the same way: the protocol's standard &lt;code&gt;SUBAGENT_*&lt;/code&gt; events, with the child's messages and its own &lt;code&gt;lookup&lt;/code&gt; tool call attributed to the child run.&lt;br&gt;
So it isn't buying observability.&lt;br&gt;
It already had it.&lt;br&gt;
It compiles a child graph anyway.&lt;/p&gt;

&lt;p&gt;Let's look at what the child is, though.&lt;br&gt;
It has its own &lt;code&gt;agent → tools → agent&lt;/code&gt; loop with conditional edges and an iteration cap: a different control flow from the parent's, not a slice of it.&lt;/p&gt;

&lt;p&gt;This part took me a second read to see.&lt;br&gt;
A custom child state schema doesn't discriminate at all: the two graphs I just used as observability evidence &lt;em&gt;also&lt;/em&gt; define their own child &lt;code&gt;TypedDict&lt;/code&gt;s.&lt;br&gt;
But both of those children are one node and a straight line, so the schema is really just an argument list with a type on it.&lt;/p&gt;

&lt;p&gt;So it's the control flow, not the schema.&lt;br&gt;
A child that carries a &lt;code&gt;topic&lt;/code&gt; string is a function call wearing a graph costume.&lt;br&gt;
A child that loops until it's satisfied is a graph.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;Split when something outside the graph needs to see the child run as its own thing: a card, a progress panel, per-child streaming.&lt;br&gt;
Split when the child has its own control flow (a loop, a branch, a stopping condition the parent doesn't have) and you're willing to own the mapping at both edges.&lt;br&gt;
Don't split for tidiness, and don't assume the split isolated state: wire a child in as a node on a shared &lt;code&gt;MessagesState&lt;/code&gt; and it appends straight to the transcript the parent is building.&lt;/p&gt;

&lt;p&gt;The &lt;a href="https://threadplane.ai/docs/langgraph/concepts/agent-architecture" rel="noopener noreferrer"&gt;architecture matrix&lt;/a&gt; covers the tiering question, the &lt;a href="https://threadplane.ai/docs/langgraph/guides/subgraphs" rel="noopener noreferrer"&gt;subgraphs guide&lt;/a&gt; has the composition and &lt;code&gt;subagents()&lt;/code&gt; wiring, and &lt;a href="https://threadplane.ai/blog/what-inject-agent-returns" rel="noopener noreferrer"&gt;What injectAgent() Actually Returns&lt;/a&gt; walks the signal surface those child streams land in.&lt;/p&gt;

&lt;p&gt;If you've split a graph for a third reason (not observability, and not a child that's genuinely its own graph), please let me know.&lt;br&gt;
Those are the two I've been able to justify, and I doubt they're the only two that exist. 🤔&lt;/p&gt;

</description>
      <category>langgraph</category>
      <category>ai</category>
      <category>angular</category>
      <category>architecture</category>
    </item>
    <item>
      <title>AG-UI vs. WebMCP: Who Owns the Agent?</title>
      <dc:creator>Brian Love</dc:creator>
      <pubDate>Thu, 29 Oct 2026 22:26:13 +0000</pubDate>
      <link>https://dev.to/blove/ag-ui-vs-webmcp-who-owns-the-agent-1hf1</link>
      <guid>https://dev.to/blove/ag-ui-vs-webmcp-who-owns-the-agent-1hf1</guid>
      <description>&lt;p&gt;Learn the difference between AG-UI and WebMCP, and when you'd reach for each one.&lt;/p&gt;

&lt;p&gt;Both show up in the same conversations, both mention tools, and both promise to connect agents to web apps.&lt;br&gt;
So it's easy to assume they compete, but they actually point in opposite directions.&lt;br&gt;
Once you see which way each one points, the choice gets simple.&lt;/p&gt;
&lt;h2&gt;
  
  
  Goals
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Understand what AG-UI does.&lt;/li&gt;
&lt;li&gt;Understand what WebMCP does.&lt;/li&gt;
&lt;li&gt;Learn the one question that tells them apart.&lt;/li&gt;
&lt;li&gt;See how they work together in the same app.&lt;/li&gt;
&lt;li&gt;Learn where Threadplane fits.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
  
  
  What is AG-UI?
&lt;/h2&gt;

&lt;p&gt;AG-UI is an open protocol for streaming an agent's work to a user interface.&lt;/p&gt;

&lt;p&gt;Your frontend starts a run, and the agent streams back a sequence of typed events:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;RUN_STARTED&lt;/code&gt; and &lt;code&gt;RUN_FINISHED&lt;/code&gt; bracket the run.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;TEXT_MESSAGE_START&lt;/code&gt;, &lt;code&gt;TEXT_MESSAGE_CONTENT&lt;/code&gt;, and &lt;code&gt;TEXT_MESSAGE_END&lt;/code&gt; stream the assistant's reply token by token.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;TOOL_CALL_START&lt;/code&gt;, &lt;code&gt;TOOL_CALL_ARGS&lt;/code&gt;, and &lt;code&gt;TOOL_CALL_END&lt;/code&gt; show the agent calling tools as it happens.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;STATE_SNAPSHOT&lt;/code&gt; and &lt;code&gt;STATE_DELTA&lt;/code&gt; keep shared state in sync between the agent and the UI.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Over HTTP, that's a stream of server-sent events that looks something like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;data: {"type":"RUN_STARTED","threadId":"t_1","runId":"r_1"}
data: {"type":"TEXT_MESSAGE_START","messageId":"m_1","role":"assistant"}
data: {"type":"TEXT_MESSAGE_CONTENT","messageId":"m_1","delta":"Checking flights"}
data: {"type":"TOOL_CALL_START","toolCallId":"c_1","toolCallName":"searchFlights"}
...
data: {"type":"RUN_FINISHED","threadId":"t_1","runId":"r_1"}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The important part is who is on each end.&lt;br&gt;
On one end is &lt;em&gt;your&lt;/em&gt; agent: a LangGraph graph, a Strands agent, a Mastra workflow, whatever you built.&lt;br&gt;
On the other end is &lt;em&gt;your&lt;/em&gt; UI, rendering those events as a chat, a timeline, an approval card, or a map.&lt;/p&gt;

&lt;p&gt;AG-UI is the wire between two things you own.&lt;/p&gt;
&lt;h2&gt;
  
  
  What is WebMCP?
&lt;/h2&gt;

&lt;p&gt;WebMCP is a proposed web API that lets a page expose tools to an AI agent running in the browser.&lt;/p&gt;

&lt;p&gt;It's being incubated in the W3C Web Machine Learning Community Group, with editors from Microsoft and Google.&lt;br&gt;
It's still a draft Community Group report, not a standard, and Chrome is running it as an origin trial.&lt;/p&gt;

&lt;p&gt;The shape will feel familiar if you've built an MCP server.&lt;br&gt;
You register a tool with a name, a description, a JSON Schema for its input, and an &lt;code&gt;execute&lt;/code&gt; callback:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;modelContext&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;modelContext&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;registerTool&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
    &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;add_to_cart&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;description&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Add a product to the shopping cart by SKU.&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;inputSchema&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;object&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="na"&gt;properties&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="na"&gt;sku&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;string&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt;
        &lt;span class="na"&gt;quantity&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;number&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;minimum&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt;
      &lt;span class="p"&gt;},&lt;/span&gt;
      &lt;span class="na"&gt;required&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;sku&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;
    &lt;span class="p"&gt;},&lt;/span&gt;
    &lt;span class="na"&gt;annotations&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;consequentialHint&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt;
    &lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="nf"&gt;execute&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="nx"&gt;sku&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;quantity&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="p"&gt;})&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;cart&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;add&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;sku&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;quantity&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
      &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="s2"&gt;`Added &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;quantity&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt; of &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;sku&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;. Cart has &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;cart&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;count&lt;/span&gt;&lt;span class="p"&gt;()}&lt;/span&gt;&lt;span class="s2"&gt; items.`&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="p"&gt;},&lt;/span&gt;
  &lt;span class="p"&gt;});&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That &lt;code&gt;execute&lt;/code&gt; callback runs in your page, with the user's session, cookies, and app state already in place.&lt;br&gt;
The spec describes these pages as being similar to MCP servers that implement their tools in client-side script instead of on a backend.&lt;/p&gt;

&lt;p&gt;Chrome also documents a declarative flavor in its origin trial, where you add &lt;code&gt;toolname&lt;/code&gt; and &lt;code&gt;tooldescription&lt;/code&gt; attributes to an existing &lt;code&gt;&amp;lt;form&amp;gt;&lt;/code&gt; and the browser builds the tool from its fields.&lt;br&gt;
That part isn't in the normative spec yet, so I'd treat it as experimental.&lt;/p&gt;

&lt;p&gt;A quick heads up if you've read earlier tutorials: they use &lt;code&gt;navigator.modelContext&lt;/code&gt;, while the current draft exposes the API on &lt;code&gt;document.modelContext&lt;/code&gt;.&lt;br&gt;
That's why I feature-detect rather than assume.&lt;/p&gt;

&lt;p&gt;On one end of WebMCP is &lt;em&gt;your&lt;/em&gt; page, offering tools.&lt;br&gt;
On the other end is an agent you probably &lt;em&gt;didn't&lt;/em&gt; build: the one built into the browser, or an extension, or something the user brought with them.&lt;/p&gt;

&lt;p&gt;WebMCP is the doorway you open for someone else's agent.&lt;/p&gt;
&lt;h2&gt;
  
  
  So what's the difference?
&lt;/h2&gt;

&lt;p&gt;Here's the one question I'd ask: &lt;strong&gt;who owns the agent?&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;If you own the agent and you're building the UI for it, that's AG-UI.&lt;/li&gt;
&lt;li&gt;If the user brings the agent and you want your site to be usable by it, that's WebMCP.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Put another way, the arrows point in opposite directions:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;/th&gt;
&lt;th&gt;AG-UI&lt;/th&gt;
&lt;th&gt;WebMCP&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Who owns the agent?&lt;/td&gt;
&lt;td&gt;You&lt;/td&gt;
&lt;td&gt;The user, browser, or extension&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Where does the agent run?&lt;/td&gt;
&lt;td&gt;Usually your server&lt;/td&gt;
&lt;td&gt;Usually the browser&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;What flows over it?&lt;/td&gt;
&lt;td&gt;A stream of events: text, tool calls, state&lt;/td&gt;
&lt;td&gt;Tool definitions and tool calls&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Who renders the conversation?&lt;/td&gt;
&lt;td&gt;Your app&lt;/td&gt;
&lt;td&gt;The agent's own UI&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;What does your app provide?&lt;/td&gt;
&lt;td&gt;The UI&lt;/td&gt;
&lt;td&gt;The capabilities&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;For me, that last row is the clearest way to hold it.&lt;br&gt;
With AG-UI, your app &lt;em&gt;is&lt;/em&gt; the interface to an agent.&lt;br&gt;
With WebMCP, your app is a set of capabilities that some other interface can drive.&lt;/p&gt;
&lt;h2&gt;
  
  
  Doesn't AG-UI have tools too?
&lt;/h2&gt;

&lt;p&gt;It does, and this is where the confusion usually starts.&lt;/p&gt;

&lt;p&gt;AG-UI supports frontend tools.&lt;br&gt;
When you start a run, you can send a list of tool definitions along with the messages.&lt;br&gt;
The agent can call them, the call streams down as &lt;code&gt;TOOL_CALL_*&lt;/code&gt; events, your frontend executes it, and the result goes back on the next run.&lt;/p&gt;

&lt;p&gt;So in both protocols, a tool can run in the browser.&lt;br&gt;
The difference is still ownership.&lt;br&gt;
AG-UI frontend tools are offered to &lt;em&gt;your&lt;/em&gt; agent, as part of a conversation your app is hosting.&lt;br&gt;
WebMCP tools are offered to &lt;em&gt;whatever&lt;/em&gt; agent the browser lets in, and your app may never see the conversation at all.&lt;/p&gt;

&lt;p&gt;I think of AG-UI frontend tools as private, and WebMCP tools as public.&lt;br&gt;
That's a simplification, since WebMCP has origin controls and a Permissions Policy gate, but it's the right instinct for how carefully you should design them.&lt;/p&gt;
&lt;h2&gt;
  
  
  Can I use both?
&lt;/h2&gt;

&lt;p&gt;Yes, and I think a lot of apps will.&lt;/p&gt;

&lt;p&gt;The nice part is that the tool shapes are nearly the same: a name, a description, and a JSON Schema.&lt;br&gt;
So you can write the capability once and offer it through both doors:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;addToCart&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;add_to_cart&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;description&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Add a product to the shopping cart by SKU.&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;inputSchema&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;object&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;properties&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;sku&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;string&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt; &lt;span class="na"&gt;quantity&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;number&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt;
    &lt;span class="na"&gt;required&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;sku&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;
  &lt;span class="p"&gt;},&lt;/span&gt;
  &lt;span class="na"&gt;execute&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="k"&gt;async &lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="nx"&gt;sku&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;quantity&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="p"&gt;})&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;cart&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;add&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;sku&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;quantity&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="s2"&gt;`Added &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;quantity&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt; of &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;sku&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;.`&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="p"&gt;},&lt;/span&gt;
&lt;span class="p"&gt;};&lt;/span&gt;

&lt;span class="c1"&gt;// Door 1: your own in-app assistant, over AG-UI.&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;tools&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[{&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;addToCart&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;name&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;description&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;addToCart&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;description&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;parameters&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;addToCart&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;inputSchema&lt;/span&gt; &lt;span class="p"&gt;}];&lt;/span&gt;

&lt;span class="c1"&gt;// Door 2: the user's browser agent, over WebMCP.&lt;/span&gt;
&lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;modelContext&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;modelContext&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;registerTool&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;addToCart&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Your in-app assistant gets a rich, branded experience: streaming text, tool views, approvals, and state you control.&lt;br&gt;
A user who prefers their own agent still gets a site that works with it, instead of one it has to guess its way through by reading the DOM.&lt;/p&gt;

&lt;p&gt;If you're building that in-app assistant in Angular, the &lt;a href="https://threadplane.ai/docs/ag-ui/guides/client-tools" rel="noopener noreferrer"&gt;client tools guide&lt;/a&gt; shows the AG-UI side.&lt;/p&gt;

&lt;h2&gt;
  
  
  What should I watch out for?
&lt;/h2&gt;

&lt;p&gt;A few tradeoffs worth keeping in mind:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;WebMCP is early.&lt;/strong&gt; It's an origin trial with a moving API surface. Feature-detect, and don't build a critical path on it yet.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;You don't control the WebMCP caller.&lt;/strong&gt; Treat every input as untrusted, keep inputs narrow, and mark anything that spends money or sends a message with &lt;code&gt;consequentialHint&lt;/code&gt;. The user's agent may be reading content from other tabs, so prompt injection is a real concern.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;AG-UI means you run the agent.&lt;/strong&gt; That's infrastructure, model costs, and a backend to deploy. The upside is that you control the whole experience.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Neither one replaces the other.&lt;/strong&gt; WebMCP doesn't stream your agent's reasoning into your UI, and AG-UI doesn't make your site usable by an agent you didn't build.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Where does Threadplane fit?
&lt;/h2&gt;

&lt;p&gt;A few questions come up whenever I talk about this, so here are the short answers.&lt;/p&gt;

&lt;h3&gt;
  
  
  Why does Threadplane use AG-UI?
&lt;/h3&gt;

&lt;p&gt;Threadplane is a UI library for agents &lt;em&gt;you&lt;/em&gt; own, which is exactly the AG-UI side of the arrow.&lt;/p&gt;

&lt;p&gt;AG-UI gives us one adapter that reaches a lot of runtimes.&lt;br&gt;
&lt;code&gt;@threadplane/ag-ui&lt;/code&gt; works with any backend that speaks the protocol: CrewAI, Mastra, Microsoft Agent Framework, AG2, Pydantic AI, AWS Strands, and LangGraph fronted by AG-UI.&lt;br&gt;
We test that claim against real runtimes, and the results are in &lt;a href="https://threadplane.ai/docs/choosing-an-adapter" rel="noopener noreferrer"&gt;Choosing an adapter&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;For me, that's the appeal.&lt;br&gt;
Your Angular components shouldn't care which framework your agent team picked, and a protocol is how you keep it that way.&lt;/p&gt;

&lt;h3&gt;
  
  
  Why do we also use LangGraph directly?
&lt;/h3&gt;

&lt;p&gt;&lt;code&gt;@threadplane/langgraph&lt;/code&gt; talks to LangGraph Platform through LangGraph's own JavaScript SDK, without going through AG-UI.&lt;/p&gt;

&lt;p&gt;The reason is durability.&lt;br&gt;
Thread history, checkpoints, and time travel are things LangGraph does really well, and they're outside what the AG-UI protocol defines.&lt;br&gt;
Going direct lets the LangGraph adapter expose &lt;code&gt;history()&lt;/code&gt; and the rest of the thread surface, instead of only what fits through the event stream.&lt;/p&gt;

&lt;p&gt;The tradeoff is a second adapter to maintain.&lt;br&gt;
The upside is that you don't pay for it in your components: both adapters produce the same &lt;code&gt;Agent&lt;/code&gt; contract, so &lt;code&gt;&amp;lt;chat [agent]="agent" /&amp;gt;&lt;/code&gt; doesn't change when the import does.&lt;br&gt;
I wrote up exactly &lt;a href="https://threadplane.ai/blog/what-changes-when-the-runtime-changes" rel="noopener noreferrer"&gt;what changes when the runtime changes&lt;/a&gt; if you want the details.&lt;/p&gt;

&lt;h3&gt;
  
  
  Does Threadplane support WebMCP?
&lt;/h3&gt;

&lt;p&gt;No, not today.&lt;/p&gt;

&lt;p&gt;Threadplane builds the UI for your own agent, and WebMCP is about exposing your page to someone else's.&lt;br&gt;
Those are different jobs, so nothing about WebMCP is blocked by Threadplane, and nothing in Threadplane needs it.&lt;/p&gt;

&lt;p&gt;If you want both, you can do it yourself today.&lt;br&gt;
Offer a tool to your in-app agent through Threadplane's &lt;a href="https://threadplane.ai/docs/ag-ui/guides/client-tools" rel="noopener noreferrer"&gt;client tools&lt;/a&gt;, and register the same function with &lt;code&gt;document.modelContext&lt;/code&gt; next to it.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;In summary, AG-UI and WebMCP solve different problems.&lt;br&gt;
AG-UI connects &lt;em&gt;your&lt;/em&gt; agent to &lt;em&gt;your&lt;/em&gt; UI with a stream of events.&lt;br&gt;
WebMCP lets &lt;em&gt;your&lt;/em&gt; page offer tools to &lt;em&gt;someone else's&lt;/em&gt; agent running in the browser.&lt;/p&gt;

&lt;p&gt;When you're not sure which one you need, ask who owns the agent.&lt;br&gt;
The answer tells you which way the arrow points.&lt;/p&gt;

&lt;p&gt;I'm &lt;em&gt;really&lt;/em&gt; curious to see where WebMCP lands as it moves through the standards process.&lt;br&gt;
If you're experimenting with either one, or both, let me know what you're building.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>webdev</category>
      <category>angular</category>
      <category>javascript</category>
    </item>
    <item>
      <title>Three Questions to Answer Before You Ship an Agent UI</title>
      <dc:creator>Brian Love</dc:creator>
      <pubDate>Wed, 16 Sep 2026 05:29:13 +0000</pubDate>
      <link>https://dev.to/blove/three-questions-to-answer-before-you-ship-an-agent-ui-2ief</link>
      <guid>https://dev.to/blove/three-questions-to-answer-before-you-ship-an-agent-ui-2ief</guid>
      <description>&lt;p&gt;Most teams building an agent UI start with the chat box and work backwards.&lt;/p&gt;

&lt;p&gt;I think that is the wrong order.&lt;/p&gt;

&lt;p&gt;The decisions that shape the product are made earlier, usually by default, and usually without anyone noticing they were decisions.&lt;/p&gt;

&lt;p&gt;In this post, I want to give the three I keep coming back to:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Where does the agent loop run?&lt;/li&gt;
&lt;li&gt;How does the model hand you UI?&lt;/li&gt;
&lt;li&gt;Which dimension did your tests delete?&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;I build in Angular and I maintain &lt;a href="https://threadplane.ai" rel="noopener noreferrer"&gt;Threadplane&lt;/a&gt;, so my examples lean that way. The questions apply to any framework.&lt;/p&gt;

&lt;h2&gt;
  
  
  tl;dr
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;The agent loop runs in one of three places: a vendor's server, your route running a vendor's code, or your agent. Pick on purpose.&lt;/li&gt;
&lt;li&gt;Generative UI is not one thing. The useful choice is between a fixed spec you validate up front and a live surface the agent keeps editing.&lt;/li&gt;
&lt;li&gt;Every deterministic test harness buys determinism by deleting a dimension of the real system. Know which one yours deleted.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  1. Where does the agent loop run?
&lt;/h2&gt;

&lt;p&gt;The agent loop is the code that calls the model, sees a tool call, runs it, and calls the model again.&lt;/p&gt;

&lt;p&gt;Where it lives decides who holds the API key, where approvals pause, where threads persist, and whose release schedule you are on.&lt;/p&gt;

&lt;p&gt;I compared five libraries on this in September 2026. The answers sort into three shapes:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;A vendor server in the request path.&lt;/strong&gt; You deploy the library's runtime and your browser talks to it. You get key custody, auth, routing, and trusted middleware in one place. You trade a second server on the hot path.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Vendor code in your route.&lt;/strong&gt; No box to deploy, but the loop is the library's, inside an API route you own. Approvals and persistence can be first-class because the library owns both ends. You trade a loop that is separate from the one your agent framework already has.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Your agent.&lt;/strong&gt; The UI talks to the agent server directly. One loop, owned by the framework you already chose. You trade the ability to show anything the server does not send.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For me, the third shape is right for most teams, and it is the one Threadplane is built on.&lt;/p&gt;

&lt;p&gt;If you are running an agent, you already have a server. It holds the model key, it already authenticates, and it already sees every tool call. A vendor's box in front of it is a second place to solve a problem you already had one place to solve.&lt;/p&gt;

&lt;p&gt;That does not mean no server at all. Put an endpoint you own in front of your agent for auth and credentials. The difference from a vendor runtime is who owns the code running in it.&lt;/p&gt;

&lt;p&gt;The full comparison, with every cell source-checked and the costs of my own choice listed, is in &lt;a href="https://threadplane.ai/blog/why-do-agent-ui-libraries-require-a-runtime" rel="noopener noreferrer"&gt;Why Do Agent UI Libraries Require a Runtime?&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  2. How does the model hand you UI?
&lt;/h2&gt;

&lt;p&gt;"Generative UI" hides three mechanisms behind one phrase:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Tool-call rendering.&lt;/strong&gt; The model calls a tool and you map the tool name to a component. Every library does this, and it is where most teams should start.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Declarative specs.&lt;/strong&gt; The model authors a UI tree in a standard format and the client renders it from a catalog you registered. The two open specs gaining ground are &lt;a href="https://a2ui.org" rel="noopener noreferrer"&gt;A2UI&lt;/a&gt; and &lt;a href="https://github.com/vercel-labs/json-render" rel="noopener noreferrer"&gt;json-render&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Sandboxed apps.&lt;/strong&gt; An MCP server returns a &lt;code&gt;ui://&lt;/code&gt; resource and the client mounts it in an iframe. This is MCP Apps, and my project does not render it yet.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The choice that matters is inside the second bucket, and it is about contract shape.&lt;/p&gt;

&lt;p&gt;With a fixed spec like json-render, the contract is application-owned. You define the schema, validate the whole spec before it mounts, and your handlers decide what a click means.&lt;/p&gt;

&lt;p&gt;With a live protocol like A2UI, the surface is agent-owned. The agent creates it, keeps editing it across turns, and receives structured actions back.&lt;/p&gt;

&lt;p&gt;My heuristic is simple. If you can validate the entire UI before it renders, start with the fixed spec. If the surface has to live past its first render, step up to the protocol.&lt;/p&gt;

&lt;p&gt;An order summary card is a fixed spec. A three-day itinerary that fills in prices and gets rewritten when the user objects is a live surface.&lt;/p&gt;

&lt;p&gt;The walkthrough with the same card in both formats is in &lt;a href="https://threadplane.ai/blog/json-render-vs-a2ui-choosing" rel="noopener noreferrer"&gt;json-render vs A2UI&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Which dimension did your tests delete?
&lt;/h2&gt;

&lt;p&gt;Agents are hard to test end to end because the model does not return the same thing twice.&lt;/p&gt;

&lt;p&gt;The usual fix is to record its responses as fixtures and replay them. We test our whole demo fleet that way, and I recommend it. Two things about that setup deserve more thought than they get:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Where you put the mock decides what is under test.&lt;/strong&gt; Mock at the app boundary and you have proven your component renders what you handed it. Mock at the model provider, with the real agent server running against a fake model endpoint, and your routing, streaming, and tool round-trips are all under test.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Every deterministic harness deletes a dimension.&lt;/strong&gt; Ours deletes time. Replayed responses arrive in one or two chunks instead of token by token, so final-DOM assertions stay stable. A handful of fixtures opt back in with tiny chunks where the progressive render is the thing under test.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Here is the bug class that disappears when you delete time. A child agent streams tokens, a client merges them into the transcript as an extra bubble, and then the run settles and the transcript is rebuilt correctly. Assert on the finished DOM and the test passes. Any assertion after an &lt;code&gt;await&lt;/code&gt; sees a settled system, and a self-correcting bug is one that settles.&lt;/p&gt;

&lt;p&gt;So the question about your harness is not whether it is green. It is which dimension you deleted, and which tests opted back in.&lt;/p&gt;

&lt;p&gt;The full accounting is in &lt;a href="https://threadplane.ai/blog/what-fixture-replay-cant-catch" rel="noopener noreferrer"&gt;What Fixture Replay Can't Catch&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;Each of these questions has a default answer that arrives with whatever library you install first. None of the defaults is wrong, but all of them are decisions, and I think you should make them as decisions.&lt;/p&gt;

&lt;p&gt;For me: run the loop in the agent with an endpoint you own in front of it, start with a fixed UI spec and step up per surface, and mock at the model provider while knowing what you gave up.&lt;/p&gt;

&lt;p&gt;Those are the answers &lt;a href="https://threadplane.ai" rel="noopener noreferrer"&gt;Threadplane&lt;/a&gt; is built around. If you are building the same thing in another framework, I would like to hear where yours landed.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>webdev</category>
      <category>architecture</category>
      <category>testing</category>
    </item>
    <item>
      <title>Bringing Agents to the Web with Angular: Announcing Threadplane</title>
      <dc:creator>Brian Love</dc:creator>
      <pubDate>Thu, 04 Jun 2026 17:38:50 +0000</pubDate>
      <link>https://dev.to/blove/bringing-agents-to-the-web-with-angular-announcing-threadplane-3d06</link>
      <guid>https://dev.to/blove/bringing-agents-to-the-web-with-angular-announcing-threadplane-3d06</guid>
      <description>&lt;p&gt;For the past year I've been building AI agents, and shipping them inside Angular apps.&lt;/p&gt;

&lt;p&gt;And every single time, the same thing happened: the backend got all the love, and the Angular frontend got the leftovers.&lt;/p&gt;

&lt;p&gt;So we built Threadplane.&lt;/p&gt;

&lt;p&gt;Threadplane is an open-source framework for building fullstack agentic applications with Angular. It connects your agent runtime — LangChain, LangGraph, anything that speaks AG-UI — to production-ready Angular surfaces: chat, streaming, tool progress, interrupts, durable threads, and generative UI. All of it expressed in Signals, dependency injection, and standalone components. The way Angular actually wants to be written.&lt;/p&gt;

&lt;p&gt;Let me tell you why we built it, what's in it, and how to try it this week.&lt;/p&gt;

&lt;h2&gt;
  
  
  tl;dr
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://dev.toThreadplane%20is%20an%20Angular-native%20framework%20for%20building%20agentic%20apps"&gt;threadplane.ai&lt;/a&gt;. The runtime adapters are &lt;strong&gt;MIT licensed&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;It bridges &lt;strong&gt;LangChain / LangGraph&lt;/strong&gt; and &lt;strong&gt;AG-UI&lt;/strong&gt; backends into Angular Signals through one &lt;code&gt;injectAgent()&lt;/code&gt; call.&lt;/li&gt;
&lt;li&gt;Generative UI works through either &lt;strong&gt;Vercel's json-render&lt;/strong&gt; (a fixed, trusted component catalog) or &lt;strong&gt;Google's A2UI&lt;/strong&gt; (a portable declarative UI protocol) — rendered into &lt;em&gt;your&lt;/em&gt; design system.&lt;/li&gt;
&lt;li&gt;It's a complete solution: messages, status, tool calls, interrupts, branching, thread persistence, and tests. Not just stream plumbing.&lt;/li&gt;
&lt;li&gt;Grab it at &lt;a href="https://threadplane.ai" rel="noopener noreferrer"&gt;https://threadplane.ai&lt;/a&gt; and on GitHub at &lt;a href="https://github.com/cacheplane/angular-agent-framework" rel="noopener noreferrer"&gt;cacheplane/angular-agent-framework&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Why build this at all?
&lt;/h2&gt;

&lt;p&gt;Here's the thing nobody says out loud about agentic apps in 2026.&lt;/p&gt;

&lt;p&gt;The backend is the easy part now.&lt;/p&gt;

&lt;p&gt;That's not a dig — it's a compliment to everyone who's done the work. LangChain and LangGraph give you orchestration, tools, memory, and human-in-the-loop. Protocols like AG-UI standardize how an agent streams events to a UI. The runtime layer has matured fast.&lt;/p&gt;

&lt;p&gt;The frontend is where it still gets messy.&lt;/p&gt;

&lt;p&gt;An agent isn't a request and a response. It's a &lt;em&gt;stream&lt;/em&gt;. Tokens arrive a few at a time. A tool starts running, then finishes. The agent pauses to ask you to approve something. A subagent spins up, does its work, and reports back. The user edits an earlier message and the whole conversation branches. Then they close the tab, come back tomorrow, and expect the thread to still be there.&lt;/p&gt;

&lt;p&gt;Every one of those is a frontend state problem. And in Angular, you were on your own.&lt;/p&gt;

&lt;p&gt;For me, this came to a head on a flight-planning assistant I was building — an orchestrator agent delegating to research subagents, each grounded by retrieval over a different corpus. The agent architecture was right. The model choices were right. But wiring the stream into the Angular UI meant hand-rolling the same plumbing over and over: a service holding streaming state, a pile of &lt;code&gt;BehaviorSubject&lt;/code&gt;s, manual change detection, and a tool-call lifecycle I kept reinventing in slightly different ways across components.&lt;/p&gt;

&lt;p&gt;I'd written that code three times. That's usually my signal that it shouldn't be my code anymore.&lt;/p&gt;

&lt;h2&gt;
  
  
  The React teams already had this
&lt;/h2&gt;

&lt;p&gt;Let's be honest about the landscape, because it's the whole reason Threadplane exists.&lt;/p&gt;

&lt;p&gt;If you build agentic UIs in React, you've had good tools for a while. LangGraph's official frontend integration, &lt;code&gt;useStream&lt;/code&gt;, is a single React hook that gives you thread management, message streaming, and branching out of the box. There's a mature ecosystem of generative-UI libraries. The examples, the starters, the blog posts — they assume React.&lt;/p&gt;

&lt;p&gt;If you build in Angular, none of that was yours.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;useStream&lt;/code&gt; is React-only. Most of the generative-UI libraries ship React renderers first, and Angular &lt;em&gt;eventually&lt;/em&gt;, or not at all. So Angular teams did what Angular teams have always done: translate. Read the React example, mentally port the hooks to services, port the JSX to templates, port the React state to Signals, and hope you got the streaming edge cases right.&lt;/p&gt;

&lt;p&gt;I don't think that's good enough anymore.&lt;/p&gt;

&lt;p&gt;Angular has Signals. It has dependency injection that's genuinely best-in-class for this kind of problem. It has standalone components and a strong opinion about structure. An agent UI built &lt;em&gt;for&lt;/em&gt; Angular should feel like Angular — not like a React app wearing a trench coat.&lt;/p&gt;

&lt;p&gt;That's the gap. Threadplane is our attempt to close it.&lt;/p&gt;

&lt;h2&gt;
  
  
  What Threadplane actually gives you
&lt;/h2&gt;

&lt;p&gt;Threadplane is a small set of focused packages. You take what you need.&lt;/p&gt;

&lt;p&gt;The center of it is &lt;code&gt;injectAgent()&lt;/code&gt;. Think of it as the Angular equivalent of &lt;code&gt;useStream&lt;/code&gt; — but projected through Angular's reactivity model instead of React's.&lt;/p&gt;

&lt;p&gt;You wire your backend up once:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// app.config.ts&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;provideAgent&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;@threadplane/langgraph&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;appConfig&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;ApplicationConfig&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="na"&gt;providers&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
    &lt;span class="nf"&gt;provideAgent&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
      &lt;span class="na"&gt;apiUrl&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;https://your-langgraph-platform.com&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="na"&gt;assistantId&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;my-agent&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="p"&gt;}),&lt;/span&gt;
  &lt;span class="p"&gt;],&lt;/span&gt;
&lt;span class="p"&gt;};&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then you inject it into any component and bind directly to it:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;Component&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;@angular/core&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;ChatComponent&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;@threadplane/chat&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;injectAgent&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;@threadplane/langgraph&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="p"&gt;@&lt;/span&gt;&lt;span class="nd"&gt;Component&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
  &lt;span class="na"&gt;selector&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;app-support-chat&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;imports&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;ChatComponent&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;
  &lt;span class="na"&gt;template&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;`
    &amp;lt;chat [agent]="chat" /&amp;gt;

    @if (chat.isLoading()) {
      &amp;lt;span&amp;gt;Streaming…&amp;lt;/span&amp;gt;
    }
  `&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;})&lt;/span&gt;
&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;SupportChatComponent&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;protected&lt;/span&gt; &lt;span class="k"&gt;readonly&lt;/span&gt; &lt;span class="nx"&gt;chat&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;injectAgent&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;chat.messages()&lt;/code&gt;, &lt;code&gt;chat.status()&lt;/code&gt;, &lt;code&gt;chat.toolCalls()&lt;/code&gt;, &lt;code&gt;chat.interrupt()&lt;/code&gt; — these are all Angular Signals. You bind them straight into your template. No subscriptions. No &lt;code&gt;async&lt;/code&gt; pipe. No zone.js required.&lt;/p&gt;

&lt;p&gt;And it's not just the happy path. You get the stuff that actually makes an agent UI production-ready:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Streaming messages and status&lt;/strong&gt; as reactive primitives.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Tool call progress&lt;/strong&gt; — render what the agent is doing as it does it.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Interrupts&lt;/strong&gt; for human-in-the-loop — pause, ask the user to approve, resume.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Subagents&lt;/strong&gt; — a map of the subagents spun up during a run, so you can show delegation as it happens.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Branching and history&lt;/strong&gt; — edit a message, fork the conversation, walk back through it.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Durable threads&lt;/strong&gt; — persist a conversation and switch back to it later.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;regenerate()&lt;/code&gt; and &lt;code&gt;reload()&lt;/code&gt;&lt;/strong&gt; for the retry behaviors users now expect.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That's what I mean by &lt;em&gt;complete solution&lt;/em&gt;. The boring, necessary 80% is in the box.&lt;/p&gt;

&lt;h2&gt;
  
  
  Bring your own runtime
&lt;/h2&gt;

&lt;p&gt;Here's a design decision I care about: Threadplane doesn't want to own your agent.&lt;/p&gt;

&lt;p&gt;We are not a backend agent runtime. Keep LangGraph. Keep your custom service. Keep whatever you've already invested in.&lt;/p&gt;

&lt;p&gt;Threadplane talks to it through adapters:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;@threadplane/langgraph&lt;/code&gt; adapts a LangGraph Platform endpoint into Angular Signals. This is the &lt;code&gt;provideAgent()&lt;/code&gt; / &lt;code&gt;injectAgent()&lt;/code&gt; pair above.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;@threadplane/ag-ui&lt;/code&gt; bridges any AG-UI-compatible backend into the same chat surface.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;AG-UI, if you haven't run into it yet, is an open, lightweight, event-based protocol for connecting agents to user-facing apps. It's a small set of typed events — message chunks, tool calls, state updates, lifecycle — streamed over SSE (or whatever transport you like). It's being adopted across a lot of the ecosystem, which means an Angular adapter for it is leverage: speak AG-UI on the backend, and Threadplane renders it on the frontend.&lt;/p&gt;

&lt;p&gt;The nice part is what sits between the adapter and the UI. Both adapters resolve to the same runtime-neutral &lt;code&gt;Agent&lt;/code&gt; contract, and &lt;code&gt;@threadplane/chat&lt;/code&gt; only ever consumes &lt;em&gt;that&lt;/em&gt; contract. So swapping &lt;code&gt;@threadplane/langgraph&lt;/code&gt; for &lt;code&gt;@threadplane/ag-ui&lt;/code&gt; doesn't touch your components or your templates. The seam is in one place, on purpose.&lt;/p&gt;

&lt;h2&gt;
  
  
  Generative UI, rendered into your design system
&lt;/h2&gt;

&lt;p&gt;This is the part I'm most excited about, so let's slow down here.&lt;/p&gt;

&lt;p&gt;Generative UI is when the agent doesn't just send text — it sends &lt;em&gt;interface&lt;/em&gt;. A weather card instead of a paragraph about the weather. A form instead of "please reply with your address." A chart instead of a table of numbers read aloud.&lt;/p&gt;

&lt;p&gt;The scary version of this is letting a model emit arbitrary code into your app. That's a fast way to move chaos across a trust boundary. For a real product, you don't want that.&lt;/p&gt;

&lt;p&gt;There are two good answers to this in 2026, and Threadplane supports both.&lt;/p&gt;

&lt;p&gt;The first is &lt;strong&gt;Vercel's json-render&lt;/strong&gt;. The model generates JSON, constrained to a &lt;em&gt;fixed&lt;/em&gt; catalog of components you define. The agent can only use the components you've approved — it can't invent UI. &lt;code&gt;@threadplane/render&lt;/code&gt; is an Angular engine built on &lt;code&gt;@json-render/core&lt;/code&gt; that renders those JSON specs into real Angular components from your own library.&lt;/p&gt;

&lt;p&gt;The second is &lt;strong&gt;Google's A2UI&lt;/strong&gt; — a framework-agnostic protocol for declaring UI &lt;em&gt;intent&lt;/em&gt;, separating what the user should see from how it's implemented. It's the more dynamic, portable end of the spectrum. &lt;code&gt;@threadplane/a2ui&lt;/code&gt; gives you the protocol types, a streaming parser, and a dynamic-value resolver in pure TypeScript.&lt;/p&gt;

&lt;p&gt;Fixed catalog or portable protocol — that's a real architectural choice, and it depends on your surface area. (I wrote a whole post on &lt;a href="https://brianflove.com/posts/2026-03-17-google-a2ui-fixed-vs-dynamic-schemas/" rel="noopener noreferrer"&gt;fixed versus dynamic schemas&lt;/a&gt; if you want to go deeper.) The point is that with Threadplane, both render into &lt;em&gt;your&lt;/em&gt; design system. Approved components, your styles, your accessibility, your tests. The agent fills in the blanks. It doesn't get to repaint the walls.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why open source, and why MIT
&lt;/h2&gt;

&lt;p&gt;We're shipping this open source on purpose, and I want to be straight about exactly what that means.&lt;/p&gt;

&lt;p&gt;The runtime adapters and the rendering engine — &lt;code&gt;@threadplane/langgraph&lt;/code&gt;, &lt;code&gt;@threadplane/ag-ui&lt;/code&gt;, &lt;code&gt;@threadplane/render&lt;/code&gt;, and &lt;code&gt;@threadplane/a2ui&lt;/code&gt; — are &lt;strong&gt;MIT licensed&lt;/strong&gt;. Free for any use, including commercial, with attribution. The pieces that connect your agent to Angular and render generative UI are yours to use, fork, and build on.&lt;/p&gt;

&lt;p&gt;The opinionated chat UI, &lt;code&gt;@threadplane/chat&lt;/code&gt;, is the one exception: it's free for noncommercial use and has a commercial license for production inside a for-profit company. I'd rather tell you that plainly now than surprise you in a &lt;code&gt;LICENSE&lt;/code&gt; file later.&lt;/p&gt;

&lt;p&gt;MIT for the foundation matters to me because of where this category is heading. The agentic frontend space is full of stacks that start open and quietly close, or that only really open up the framework everyone &lt;em&gt;else&lt;/em&gt; uses. Angular teams — especially in fintech, healthcare, and other places where a React rewrite is off the table — deserve a foundation they can actually depend on. No required cloud. No app telemetry on by default. No bait-and-switch.&lt;/p&gt;

&lt;p&gt;A quick, honest disclosure while we're here: I also help maintain &lt;a href="https://hashbrown.dev" rel="noopener noreferrer"&gt;Hashbrown&lt;/a&gt;, an MIT-licensed framework for agents that &lt;em&gt;run in the browser&lt;/em&gt;, for both Angular and React. People ask how the two relate, so — short version: Hashbrown is for browser-running, LLM-driven frontend agents. Threadplane is for production chat and generative UI on top of server-side runtimes like LangGraph and AG-UI. Different lanes. I'm genuinely glad both exist, and I think the Angular community is better off with more open tools in it, not fewer. 💚&lt;/p&gt;

&lt;h2&gt;
  
  
  Try it this week
&lt;/h2&gt;

&lt;p&gt;That's the pitch. Here's the part where you go build something.&lt;/p&gt;

&lt;p&gt;Install the LangGraph adapter and the chat UI:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm &lt;span class="nb"&gt;install&lt;/span&gt; @threadplane/langgraph @threadplane/chat
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Wire &lt;code&gt;provideAgent()&lt;/code&gt;, drop in &lt;code&gt;&amp;lt;chat&amp;gt;&lt;/code&gt;, and you've got a streaming agent UI in about thirty seconds. From there, add interrupts when you need a human in the loop, add generative UI when text isn't enough, and swap to the AG-UI adapter if that's your backend.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The docs, quickstarts, and live demos are at &lt;strong&gt;&lt;a href="https://threadplane.ai" rel="noopener noreferrer"&gt;threadplane.ai&lt;/a&gt;&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;The code is on GitHub at &lt;strong&gt;&lt;a href="https://github.com/cacheplane/angular-agent-framework" rel="noopener noreferrer"&gt;cacheplane/angular-agent-framework&lt;/a&gt;&lt;/strong&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you're building agents in Angular, I'd love to know what you ship — and what's still missing. Open an issue, tell me where it falls short, or just tell me it saved you from writing that streaming service a fourth time.&lt;/p&gt;

&lt;p&gt;Let's give Angular the agent frontend it deserves.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>angular</category>
      <category>agents</category>
    </item>
    <item>
      <title>Agentic Memory and What It Means for Web Apps</title>
      <dc:creator>Brian Love</dc:creator>
      <pubDate>Wed, 18 Mar 2026 23:02:39 +0000</pubDate>
      <link>https://dev.to/blove/agentic-memory-and-what-it-means-for-web-apps-2hea</link>
      <guid>https://dev.to/blove/agentic-memory-and-what-it-means-for-web-apps-2hea</guid>
      <description>&lt;p&gt;Memory is becoming one of the most important design surfaces in agentic software.&lt;/p&gt;

&lt;p&gt;Not because models suddenly became databases.&lt;br&gt;
And not because storing more transcripts is the same thing as making a system smarter.&lt;/p&gt;

&lt;p&gt;It matters because memory changes what kind of software we are building.&lt;/p&gt;

&lt;p&gt;A stateless LLM can answer.&lt;br&gt;
A system with agentic memory can improve.&lt;/p&gt;

&lt;p&gt;That is a different class of product.&lt;/p&gt;

&lt;p&gt;For me, the core idea is simple:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;memory turns LLMs from stateless responders into stateful systems&lt;/li&gt;
&lt;li&gt;memory is a form of non-parametric learning&lt;/li&gt;
&lt;li&gt;the hard problem is no longer storing more context&lt;/li&gt;
&lt;li&gt;the hard problem is deciding what should be remembered, when, and in what form&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you are building fullstack agentic web applications, this is the shift to pay attention to.&lt;/p&gt;

&lt;h2&gt;
  
  
  tl;dr
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Agentic memory is not just retrieval. It is an agent capability to store, retrieve, update, summarize, and delete knowledge over time.&lt;/li&gt;
&lt;li&gt;This gives us a practical form of continual learning without fine-tuning model weights.&lt;/li&gt;
&lt;li&gt;For web apps, memory changes architecture, not just prompting. It affects UX, data modeling, evaluation, governance, and trust.&lt;/li&gt;
&lt;li&gt;The right production model is usually typed memory, selective retrieval, background consolidation, and immutable raw history behind derived memory.&lt;/li&gt;
&lt;li&gt;Memory is becoming an agent policy surface. That means memory quality will matter as much as model quality.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Angular Agent Framework
&lt;/h2&gt;

&lt;p&gt;Check out &lt;a href="https://threadplane.ai" rel="noopener noreferrer"&gt;threadplane - Agent UI for Angular&lt;/a&gt; at threadplane.ai for building agentic fullstack Angular applications using LangChain.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why memory changes everything
&lt;/h2&gt;

&lt;p&gt;Most LLM applications started as stateless request-response systems.&lt;/p&gt;

&lt;p&gt;That was fine for summarization, classification, and one-shot chat.&lt;br&gt;
It is not enough for software that is supposed to improve over time.&lt;/p&gt;

&lt;p&gt;As soon as you want an agent to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;remember user preferences&lt;/li&gt;
&lt;li&gt;reuse successful workflows&lt;/li&gt;
&lt;li&gt;avoid repeated failures&lt;/li&gt;
&lt;li&gt;carry state across sessions&lt;/li&gt;
&lt;li&gt;personalize behavior without retraining&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;you need memory.&lt;/p&gt;

&lt;p&gt;And not memory in the casual sense of "we saved the conversation somewhere."&lt;/p&gt;

&lt;p&gt;You need a system where the agent can actively manage what it knows.&lt;/p&gt;

&lt;p&gt;That is what makes the memory &lt;em&gt;agentic&lt;/em&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  What agentic memory actually is
&lt;/h2&gt;

&lt;p&gt;Agentic memory is a system where an agent can decide to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;store something&lt;/li&gt;
&lt;li&gt;retrieve something&lt;/li&gt;
&lt;li&gt;update something&lt;/li&gt;
&lt;li&gt;summarize something&lt;/li&gt;
&lt;li&gt;delete something&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That last point matters.&lt;br&gt;
If the system can only append, it does not really have memory discipline.&lt;br&gt;
It has a log.&lt;/p&gt;

&lt;p&gt;This is why I think the right framing is:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Memory is not storage. It is a control surface for reasoning.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;That is the real shift.&lt;/p&gt;

&lt;h2&gt;
  
  
  Agentic memory is like cramming for a test
&lt;/h2&gt;

&lt;p&gt;One of the more important ideas here is that memory gives us a form of continual learning without changing model weights.&lt;/p&gt;

&lt;p&gt;The model does not need to be fine-tuned every time it learns something useful.&lt;br&gt;
It can improve by pulling the right memories into context at inference time.&lt;/p&gt;

&lt;p&gt;That is why I think of memory as test-time learning.&lt;/p&gt;

&lt;p&gt;Different systems approach it differently, but the common idea is the same:&lt;br&gt;
the agent gets better because it can reuse abstractions learned from prior experience.&lt;/p&gt;

&lt;p&gt;That is a much more practical path for product teams than constant retraining.&lt;/p&gt;

&lt;h2&gt;
  
  
  The three memory types that matter
&lt;/h2&gt;

&lt;p&gt;I think it is useful to separate memory into three buckets:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Semantic memory&lt;/li&gt;
&lt;li&gt;Episodic memory&lt;/li&gt;
&lt;li&gt;Procedural memory&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  1. Semantic memory
&lt;/h3&gt;

&lt;p&gt;Semantic memory is facts, preferences, constraints, and stable knowledge.&lt;/p&gt;

&lt;p&gt;Examples:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;preferred output format&lt;/li&gt;
&lt;li&gt;user role&lt;/li&gt;
&lt;li&gt;account rules&lt;/li&gt;
&lt;li&gt;domain terminology&lt;/li&gt;
&lt;li&gt;known business constraints&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This is the memory type that drives correctness and personalization.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Episodic memory
&lt;/h3&gt;

&lt;p&gt;Episodic memory is past experiences.&lt;/p&gt;

&lt;p&gt;Examples:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;a successful prior resolution for a similar support issue&lt;/li&gt;
&lt;li&gt;a failed workflow and the correction that fixed it&lt;/li&gt;
&lt;li&gt;a previous user interaction pattern&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This is the memory type that helps reasoning by analogy.&lt;br&gt;
It is how agents get a practical form of "I have seen something like this before."&lt;/p&gt;

&lt;h3&gt;
  
  
  3. Procedural memory
&lt;/h3&gt;

&lt;p&gt;Procedural memory is behavior.&lt;/p&gt;

&lt;p&gt;Examples:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;preferred prompts&lt;/li&gt;
&lt;li&gt;tool-use patterns&lt;/li&gt;
&lt;li&gt;routing rules&lt;/li&gt;
&lt;li&gt;safety policies&lt;/li&gt;
&lt;li&gt;execution instructions&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This is the memory type that improves consistency.&lt;/p&gt;

&lt;p&gt;I think this separation matters because different memory types want different storage, retrieval, and evaluation strategies.&lt;/p&gt;

&lt;p&gt;If you flatten them all into one vector store, you are usually making retrieval worse.&lt;/p&gt;

&lt;h2&gt;
  
  
  What this means for web apps
&lt;/h2&gt;

&lt;p&gt;This is the part I care about most.&lt;/p&gt;

&lt;p&gt;Agentic memory is not just an infra feature for backend agents.&lt;br&gt;
It changes how web apps should be designed.&lt;/p&gt;

&lt;p&gt;A web app with agentic memory is not just rendering model output.&lt;br&gt;
It is participating in a learning loop.&lt;/p&gt;

&lt;p&gt;The frontend becomes the place where memory is created, corrected, and validated.&lt;/p&gt;

&lt;p&gt;That has a few practical implications.&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Web apps become memory surfaces
&lt;/h3&gt;

&lt;p&gt;The frontend sees things the model and backend often do not:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;what the user accepted&lt;/li&gt;
&lt;li&gt;what they edited&lt;/li&gt;
&lt;li&gt;what they rejected&lt;/li&gt;
&lt;li&gt;how long they hesitated&lt;/li&gt;
&lt;li&gt;where they retried&lt;/li&gt;
&lt;li&gt;when they abandoned&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Those are memory candidates.&lt;/p&gt;

&lt;p&gt;Not all of them should be stored.&lt;br&gt;
But the web app is where those signals become visible.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Personalization becomes a first-class product system
&lt;/h3&gt;

&lt;p&gt;Personalization used to mean feature flags, settings, and saved preferences.&lt;/p&gt;

&lt;p&gt;Now it also means memory.&lt;/p&gt;

&lt;p&gt;The agent should be able to remember:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;how a person likes information presented&lt;/li&gt;
&lt;li&gt;what defaults they repeatedly choose&lt;/li&gt;
&lt;li&gt;what kinds of actions they permit or avoid&lt;/li&gt;
&lt;li&gt;what vocabulary is normal in their context&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That is a better product experience.&lt;br&gt;
It is also a new governance problem.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. Multi-session coherence becomes a UX expectation
&lt;/h3&gt;

&lt;p&gt;Once users see an agent remember important context, they start expecting continuity.&lt;/p&gt;

&lt;p&gt;That means the web app needs to help answer questions like:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;what should persist across sessions?&lt;/li&gt;
&lt;li&gt;what should expire?&lt;/li&gt;
&lt;li&gt;what should be editable by the user?&lt;/li&gt;
&lt;li&gt;what should be visible as remembered state?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This is why memory is also a UX problem, not just a systems problem.&lt;/p&gt;

&lt;h3&gt;
  
  
  4. Context engineering becomes product infrastructure
&lt;/h3&gt;

&lt;p&gt;I think "context engineering" is one of the most useful phrases in this space.&lt;/p&gt;

&lt;p&gt;The problem is no longer just fitting more tokens into a prompt.&lt;br&gt;
The problem is selecting the right abstractions.&lt;/p&gt;

&lt;p&gt;Bad memory systems create:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;context poisoning&lt;/li&gt;
&lt;li&gt;distraction&lt;/li&gt;
&lt;li&gt;token waste&lt;/li&gt;
&lt;li&gt;conflicting guidance&lt;/li&gt;
&lt;li&gt;brittle personalization&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Good memory systems do the opposite:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;selective retrieval&lt;/li&gt;
&lt;li&gt;summarization&lt;/li&gt;
&lt;li&gt;distillation&lt;/li&gt;
&lt;li&gt;isolation by scope&lt;/li&gt;
&lt;li&gt;time-aware filtering&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This is why I would argue:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The problem is no longer remembering more. It is remembering the right abstractions.&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Reflection is where memory becomes learning
&lt;/h2&gt;

&lt;p&gt;One of the most important loops in agent systems is:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;act&lt;/li&gt;
&lt;li&gt;observe&lt;/li&gt;
&lt;li&gt;critique&lt;/li&gt;
&lt;li&gt;store&lt;/li&gt;
&lt;li&gt;reuse&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;That is reflection.&lt;/p&gt;

&lt;p&gt;In practice, a lot of the gains in agent quality come from this loop.&lt;br&gt;
The agent does something, observes success or failure, stores the useful lesson, and applies it later.&lt;/p&gt;

&lt;p&gt;This is why grounded reflection matters so much.&lt;br&gt;
If the critique comes from real environment feedback, user behavior, or verifiable outcomes, the memory is much more useful than a purely self-generated summary.&lt;/p&gt;

&lt;p&gt;This is also why the web app matters so much.&lt;br&gt;
It is often the best place to observe the real outcome.&lt;/p&gt;

&lt;h2&gt;
  
  
  The architecture I would actually ship
&lt;/h2&gt;

&lt;p&gt;If I were building agentic memory into a web app today, I would not start with one giant memory store.&lt;/p&gt;

&lt;p&gt;I would use a layered design:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Short-term thread memory&lt;/li&gt;
&lt;li&gt;Long-term typed memory&lt;/li&gt;
&lt;li&gt;Immutable raw history&lt;/li&gt;
&lt;li&gt;Background consolidation&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Short-term thread memory
&lt;/h3&gt;

&lt;p&gt;This is the active working set for the current task or session.&lt;/p&gt;

&lt;p&gt;Use it for:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;recent messages&lt;/li&gt;
&lt;li&gt;in-progress tool state&lt;/li&gt;
&lt;li&gt;temporary planning context&lt;/li&gt;
&lt;li&gt;current UI state&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This is hot memory.&lt;br&gt;
Fast in, fast out.&lt;/p&gt;

&lt;h3&gt;
  
  
  Long-term typed memory
&lt;/h3&gt;

&lt;p&gt;This is where semantic, episodic, and procedural memories live separately.&lt;/p&gt;

&lt;p&gt;Use it for:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;user preferences&lt;/li&gt;
&lt;li&gt;reusable examples&lt;/li&gt;
&lt;li&gt;learned task heuristics&lt;/li&gt;
&lt;li&gt;stable operating policies&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This is where I want stronger structure and stronger retrieval rules.&lt;/p&gt;

&lt;h3&gt;
  
  
  Immutable raw history
&lt;/h3&gt;

&lt;p&gt;Never trust repeated summarization as your only source of truth.&lt;/p&gt;

&lt;p&gt;Summaries drift.&lt;br&gt;
Compression loses nuance.&lt;br&gt;
Derived memory can get subtly wrong over time.&lt;/p&gt;

&lt;p&gt;So I want a raw, immutable log behind the optimized memory layer.&lt;/p&gt;

&lt;p&gt;That gives me:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;auditability&lt;/li&gt;
&lt;li&gt;rollback&lt;/li&gt;
&lt;li&gt;better debugging&lt;/li&gt;
&lt;li&gt;safer reprocessing&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Background consolidation
&lt;/h3&gt;

&lt;p&gt;Not every memory write should happen synchronously in the request path.&lt;/p&gt;

&lt;p&gt;Some should.&lt;br&gt;
Others should be consolidated later.&lt;/p&gt;

&lt;p&gt;That is the hot + cold model:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;synchronous writes for critical immediate context&lt;/li&gt;
&lt;li&gt;asynchronous consolidation for summarization, distillation, and indexing&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That is usually the right tradeoff between latency and memory quality.&lt;/p&gt;

&lt;h2&gt;
  
  
  Patterns I like
&lt;/h2&gt;

&lt;p&gt;There are a few patterns here that I think are especially practical.&lt;/p&gt;

&lt;h3&gt;
  
  
  Hot + cold memory
&lt;/h3&gt;

&lt;p&gt;Write immediately when the task needs it.&lt;br&gt;
Consolidate later when quality matters more than latency.&lt;/p&gt;

&lt;h3&gt;
  
  
  Distilled memory
&lt;/h3&gt;

&lt;p&gt;Do not store raw transcripts as the primary memory object if what you really need is a reusable abstraction.&lt;/p&gt;

&lt;p&gt;Store:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;the lesson&lt;/li&gt;
&lt;li&gt;the source&lt;/li&gt;
&lt;li&gt;the timestamp&lt;/li&gt;
&lt;li&gt;the confidence&lt;/li&gt;
&lt;li&gt;the scope&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That is much more useful than dumping an entire conversation into retrieval.&lt;/p&gt;

&lt;h3&gt;
  
  
  Immutable + derived memory
&lt;/h3&gt;

&lt;p&gt;I trust systems more when they keep both:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;immutable raw events&lt;/li&gt;
&lt;li&gt;derived summaries and optimized memories&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That is how you keep memory systems from becoming opaque.&lt;/p&gt;

&lt;h3&gt;
  
  
  Memory graphs
&lt;/h3&gt;

&lt;p&gt;Similarity search is useful, but it is not enough.&lt;/p&gt;

&lt;p&gt;Some memories are connected by:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;causality&lt;/li&gt;
&lt;li&gt;sequence&lt;/li&gt;
&lt;li&gt;dependency&lt;/li&gt;
&lt;li&gt;contradiction&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Graph-shaped memory is much better at expressing that than naive top-k vector retrieval.&lt;/p&gt;

&lt;p&gt;I expect more systems to move in this direction.&lt;/p&gt;

&lt;h2&gt;
  
  
  The production risks are real
&lt;/h2&gt;

&lt;p&gt;Memory makes systems better.&lt;br&gt;
It also makes them more dangerous.&lt;/p&gt;

&lt;p&gt;At least four risks matter immediately.&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Retrieval quality
&lt;/h3&gt;

&lt;p&gt;Just because something is semantically similar does not mean it is operationally relevant.&lt;/p&gt;

&lt;p&gt;Memory retrieval often misses:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;causal relevance&lt;/li&gt;
&lt;li&gt;implicit constraints&lt;/li&gt;
&lt;li&gt;temporal change&lt;/li&gt;
&lt;li&gt;contradictory updates&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This is why memory quality is usually more important than memory volume.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Memory drift
&lt;/h3&gt;

&lt;p&gt;If you repeatedly summarize summaries, you eventually distort the original meaning.&lt;/p&gt;

&lt;p&gt;That is why derived memory needs provenance and raw backing data.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. Security
&lt;/h3&gt;

&lt;p&gt;Memory injection is a real design concern.&lt;/p&gt;

&lt;p&gt;If an attacker can poison memory, they can shape future agent behavior.&lt;/p&gt;

&lt;p&gt;This means memory systems need:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;validation&lt;/li&gt;
&lt;li&gt;trust boundaries&lt;/li&gt;
&lt;li&gt;scoped access&lt;/li&gt;
&lt;li&gt;deletion paths&lt;/li&gt;
&lt;li&gt;source attribution&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  4. Evaluation
&lt;/h3&gt;

&lt;p&gt;A memory system can look impressive in a demo and still fail long-horizon tasks in production.&lt;/p&gt;

&lt;p&gt;We still need better evaluation for:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;multi-session behavior&lt;/li&gt;
&lt;li&gt;long-horizon execution&lt;/li&gt;
&lt;li&gt;memory usefulness over time&lt;/li&gt;
&lt;li&gt;robustness to stale or conflicting memories&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Memory governance is now part of application architecture
&lt;/h2&gt;

&lt;p&gt;This is the part I think teams will underestimate.&lt;/p&gt;

&lt;p&gt;As soon as memory affects behavior, governance matters.&lt;/p&gt;

&lt;p&gt;You need clear rules for:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;what gets stored&lt;/li&gt;
&lt;li&gt;who can access it&lt;/li&gt;
&lt;li&gt;how it decays&lt;/li&gt;
&lt;li&gt;how it is corrected&lt;/li&gt;
&lt;li&gt;how it is deleted&lt;/li&gt;
&lt;li&gt;how it is explained to the user&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This is true for enterprise software.&lt;br&gt;
It is even more true for consumer software.&lt;/p&gt;

&lt;p&gt;The best systems will not just remember well.&lt;br&gt;
They will remember responsibly.&lt;/p&gt;

&lt;h2&gt;
  
  
  My practical recommendations
&lt;/h2&gt;

&lt;p&gt;If you are building agentic memory into a web app now, this is the sequence I would use:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Separate semantic, episodic, and procedural memory.&lt;/li&gt;
&lt;li&gt;Keep immutable raw history behind derived memory.&lt;/li&gt;
&lt;li&gt;Prefer distilled memory objects over raw transcript retrieval.&lt;/li&gt;
&lt;li&gt;Add time, source, scope, and version to every stored memory.&lt;/li&gt;
&lt;li&gt;Use synchronous writes sparingly and background consolidation aggressively.&lt;/li&gt;
&lt;li&gt;Tune retrieval strategy by memory type instead of using one global approach.&lt;/li&gt;
&lt;li&gt;Evaluate on multi-session and long-horizon tasks, not only single-turn quality.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;That is the difference between "we added memory" and "we built a memory system."&lt;/p&gt;

&lt;h2&gt;
  
  
  Closing
&lt;/h2&gt;

&lt;p&gt;Agentic memory changes the role of the model.&lt;br&gt;
It also changes the role of the web app.&lt;/p&gt;

&lt;p&gt;The web app is no longer just a place where model output gets rendered.&lt;br&gt;
It is where memory is shaped, corrected, surfaced, and governed.&lt;/p&gt;

&lt;p&gt;That is why I think memory is going to become foundational to intelligent software.&lt;/p&gt;

&lt;p&gt;Not because remembering more is inherently better.&lt;br&gt;
But because the right memory architecture lets software learn without pretending every improvement requires retraining.&lt;/p&gt;

&lt;p&gt;Memory is becoming policy.&lt;br&gt;
And policy is becoming product behavior.&lt;/p&gt;

&lt;p&gt;That is what makes this interesting.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>webdev</category>
      <category>architecture</category>
    </item>
    <item>
      <title>Google A2UI: Fixed Schemas, Dynamic Schemas, and a Safe Fallback Strategy</title>
      <dc:creator>Brian Love</dc:creator>
      <pubDate>Wed, 18 Mar 2026 23:02:39 +0000</pubDate>
      <link>https://dev.to/blove/google-a2ui-fixed-schemas-dynamic-schemas-and-a-safe-fallback-strategy-284f</link>
      <guid>https://dev.to/blove/google-a2ui-fixed-schemas-dynamic-schemas-and-a-safe-fallback-strategy-284f</guid>
      <description>&lt;p&gt;Google's A2UI is one of the more interesting protocol ideas in agentic UI right now.&lt;/p&gt;

&lt;p&gt;Not because it lets a model generate arbitrary frontend code.&lt;br&gt;
That would be a fast way to move chaos across a trust boundary.&lt;/p&gt;

&lt;p&gt;It is interesting because it does the opposite.&lt;/p&gt;

&lt;p&gt;A2UI gives the agent a declarative way to describe UI while keeping rendering inside a trusted client-owned component system.&lt;/p&gt;

&lt;p&gt;That is the part that matters.&lt;br&gt;
Especially if you are building a real product instead of a demo.&lt;/p&gt;

&lt;p&gt;The practical question is not whether A2UI is good.&lt;br&gt;
The practical question is how to use it without turning your UI contract into a probabilistic event.&lt;/p&gt;

&lt;p&gt;For me, that comes down to one decision:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Fixed schema&lt;/li&gt;
&lt;li&gt;Dynamic schema&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;My recommendation is simple:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Use fixed schemas by default.&lt;/li&gt;
&lt;li&gt;Use dynamic schema overlays for the long tail.&lt;/li&gt;
&lt;li&gt;Validate everything.&lt;/li&gt;
&lt;li&gt;Retry a few times.&lt;/li&gt;
&lt;li&gt;Fall back deterministically.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
  
  
  tl;dr
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;A2UI is a protocol for agent-driven interfaces where the client owns rendering and the model emits declarative UI messages.&lt;/li&gt;
&lt;li&gt;A2UI v0.9 is more model-friendly than earlier versions because it is flatter, more prompt-friendly, and easier to validate.&lt;/li&gt;
&lt;li&gt;Most teams should start with fixed schemas because they are easier to test, easier to operate, and easier to trust.&lt;/li&gt;
&lt;li&gt;Dynamic schemas are useful, but only when they stay grounded in renderer-approved catalogs.&lt;/li&gt;
&lt;li&gt;The right production posture is fixed by default, dynamic overlays for the long tail, and deterministic fallback when validation fails.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
  
  
  The Angular Fullstack Agentic Frameowork
&lt;/h2&gt;

&lt;p&gt;Be sure to check out the &lt;a href="https://threadplane" rel="noopener noreferrer"&gt;Angular Agent Framework&lt;/a&gt; for building fullstack agentic applications using Angular. A2UI support will be landing soon!&lt;/p&gt;
&lt;h2&gt;
  
  
  Fullstack architecture sketch
&lt;/h2&gt;

&lt;p&gt;Before getting into fixed versus dynamic schema, this is the deployment shape I would use:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fl5jas8zz4jxxpxmjwkwk.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fl5jas8zz4jxxpxmjwkwk.png" alt="Animated fullstack architecture diagram for A2UI showing the trusted web client, the API and agent backend, and the observability layer." width="800" height="533"&gt;&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Web Client
  - trusted A2UI renderer
  - advertises supported catalogs
  - may advertise inline catalogs
  - sends actions and data model updates

API / Agent Backend
  - receives client capabilities
  - selects fixed vs dynamic policy
  - builds prompt from selected catalog
  - runs schema repair loop when dynamic
  - validates final payloads
  - streams safe A2UI messages to client

Observability
  - schema validation failures
  - payload validation failures
  - fallback frequency
  - per-intent success rate
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Why A2UI matters
&lt;/h2&gt;

&lt;p&gt;A2UI matters because it gives us a cleaner split between model behavior and frontend control.&lt;/p&gt;

&lt;p&gt;The model decides what interface should appear.&lt;br&gt;
The client decides how that interface is rendered.&lt;/p&gt;

&lt;p&gt;That is a much better contract than shipping arbitrary frontend code across the wire and pretending the security story will work itself out.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgwmd80wdja8ncvuhjfw2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgwmd80wdja8ncvuhjfw2.png" alt="Animated diagram of A2UI where the agent emits declarative messages, the backend validates the contract, and the trusted client renderer owns rendering." width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  Why v0.9 is the interesting version
&lt;/h2&gt;

&lt;p&gt;One caveat up front:&lt;br&gt;
A2UI v0.9 is still a draft, while v0.8 is the stable production release.&lt;/p&gt;

&lt;p&gt;So this is not a "ship and forget" protocol.&lt;br&gt;
You should pin versions and test contracts carefully.&lt;/p&gt;

&lt;p&gt;But v0.9 is still the version I would watch, because it is the version that feels much more usable for agent systems.&lt;/p&gt;

&lt;p&gt;The notable shifts are:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;a prompt-first design&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;createSurface&lt;/code&gt; replacing &lt;code&gt;beginRendering&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;a flat component model with a &lt;code&gt;component&lt;/code&gt; discriminator&lt;/li&gt;
&lt;li&gt;more standardized &lt;code&gt;updateDataModel&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;swappable catalogs instead of a single hardwired shape&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That makes the protocol easier to prompt, easier to generate, and easier to validate.&lt;br&gt;
That is the real win.&lt;/p&gt;
&lt;h2&gt;
  
  
  A quick note on what "schema" means here
&lt;/h2&gt;

&lt;p&gt;When people say "fixed schema" or "dynamic schema" in the context of A2UI, they usually mean something looser than a single JSON Schema file.&lt;/p&gt;

&lt;p&gt;In practice, the protocol is made up of separate artifacts:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;a server-to-client envelope&lt;/li&gt;
&lt;li&gt;shared common types&lt;/li&gt;
&lt;li&gt;one or more catalogs that define renderable components&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;So the real decision is usually this:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;do you give the model a fixed catalog contract?&lt;/li&gt;
&lt;li&gt;or do you dynamically select, narrow, or extend that contract for a specific request?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That is the framing that matters.&lt;/p&gt;
&lt;h2&gt;
  
  
  The protocol shape you are actually building around
&lt;/h2&gt;

&lt;p&gt;For a web app, the v0.9 lifecycle is fairly straightforward:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;The server sends &lt;code&gt;createSurface&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;The server sends &lt;code&gt;updateComponents&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;The server may send &lt;code&gt;updateDataModel&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;The client renders the surface and sends actions back.&lt;/li&gt;
&lt;li&gt;The server continues streaming updates as needed.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;A minimal shape looks like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"version"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"v0.9"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"createSurface"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"surfaceId"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"signup"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"catalogId"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"https://a2ui.org/specification/v0_9/basic_catalog.json"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"sendDataModel"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"version"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"v0.9"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"updateComponents"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"surfaceId"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"signup"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"components"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
          &lt;/span&gt;&lt;span class="nl"&gt;"id"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"root"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
          &lt;/span&gt;&lt;span class="nl"&gt;"component"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Column"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
          &lt;/span&gt;&lt;span class="nl"&gt;"children"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"title"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"email"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"submit"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
          &lt;/span&gt;&lt;span class="nl"&gt;"id"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"title"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
          &lt;/span&gt;&lt;span class="nl"&gt;"component"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Text"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
          &lt;/span&gt;&lt;span class="nl"&gt;"text"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"# Create account"&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
          &lt;/span&gt;&lt;span class="nl"&gt;"id"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"email"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
          &lt;/span&gt;&lt;span class="nl"&gt;"component"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"TextField"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
          &lt;/span&gt;&lt;span class="nl"&gt;"label"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Email"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
          &lt;/span&gt;&lt;span class="nl"&gt;"value"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"path"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"/user/email"&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
          &lt;/span&gt;&lt;span class="nl"&gt;"id"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"submit_label"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
          &lt;/span&gt;&lt;span class="nl"&gt;"component"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Text"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
          &lt;/span&gt;&lt;span class="nl"&gt;"text"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Continue"&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
          &lt;/span&gt;&lt;span class="nl"&gt;"id"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"submit"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
          &lt;/span&gt;&lt;span class="nl"&gt;"component"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Button"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
          &lt;/span&gt;&lt;span class="nl"&gt;"child"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"submit_label"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
          &lt;/span&gt;&lt;span class="nl"&gt;"action"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"event"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
              &lt;/span&gt;&lt;span class="nl"&gt;"name"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"submitSignup"&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
          &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The important implementation detail is that A2UI uses a flat list of components linked by IDs.&lt;br&gt;
That is a good choice because it is easier to emit, easier to diff, and easier to validate for:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;duplicate IDs&lt;/li&gt;
&lt;li&gt;missing &lt;code&gt;root&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;dangling references&lt;/li&gt;
&lt;li&gt;cycles&lt;/li&gt;
&lt;li&gt;orphaned components&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Those are exactly the boring details that determine whether a generative UI system survives contact with production.&lt;/p&gt;
&lt;h2&gt;
  
  
  Strategy 1: Fixed schema
&lt;/h2&gt;

&lt;p&gt;Fixed schema means your application chooses the catalog ahead of time and the model only emits valid instances of UI that conform to that contract.&lt;/p&gt;

&lt;p&gt;This is the default I would recommend for most teams.&lt;/p&gt;

&lt;p&gt;Use it when:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;the workflow is business-critical&lt;/li&gt;
&lt;li&gt;the UI shape is predictable&lt;/li&gt;
&lt;li&gt;you want strong testability&lt;/li&gt;
&lt;li&gt;analytics and event handling need to stay stable&lt;/li&gt;
&lt;li&gt;you do not want renderer behavior drifting between requests&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Examples:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;onboarding flows&lt;/li&gt;
&lt;li&gt;support triage&lt;/li&gt;
&lt;li&gt;approvals&lt;/li&gt;
&lt;li&gt;payments&lt;/li&gt;
&lt;li&gt;account management&lt;/li&gt;
&lt;li&gt;healthcare or compliance-heavy forms&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These are not the places where you want model creativity.&lt;/p&gt;
&lt;h3&gt;
  
  
  Why fixed schema works
&lt;/h3&gt;

&lt;p&gt;A fixed schema gives you a stable protocol boundary.&lt;br&gt;
That buys you:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;prompts are easier to reason about&lt;/li&gt;
&lt;li&gt;examples are easier to curate&lt;/li&gt;
&lt;li&gt;QA can build reusable fixtures&lt;/li&gt;
&lt;li&gt;regressions are easier to reproduce&lt;/li&gt;
&lt;li&gt;analytics stay more consistent&lt;/li&gt;
&lt;li&gt;frontend behavior remains predictable&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It also makes debugging much easier.&lt;br&gt;
When something breaks, you are usually debugging a bad payload, not a drifting contract and a bad payload at the same time.&lt;/p&gt;
&lt;h3&gt;
  
  
  My rule of thumb
&lt;/h3&gt;

&lt;p&gt;If the flow is revenue-critical, compliance-heavy, or operationally sensitive, start fixed.&lt;/p&gt;

&lt;p&gt;You can always loosen the system later.&lt;br&gt;
Going the other direction is usually painful.&lt;/p&gt;
&lt;h2&gt;
  
  
  Strategy 2: Dynamic schema
&lt;/h2&gt;

&lt;p&gt;Dynamic schema is where things get more interesting.&lt;br&gt;
It is also where teams get themselves into trouble.&lt;/p&gt;

&lt;p&gt;What I mean by dynamic schema is not "let the model invent whatever UI primitives it wants."&lt;/p&gt;

&lt;p&gt;That is not a schema strategy.&lt;br&gt;
That is giving up.&lt;/p&gt;

&lt;p&gt;In a production A2UI application, dynamic schema should still be renderer-owned.&lt;br&gt;
The client needs to know how to render every component the model is allowed to reference.&lt;/p&gt;

&lt;p&gt;So in practice, dynamic schema usually means one of three things:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Dynamic catalog selection from a trusted set&lt;/li&gt;
&lt;li&gt;Dynamic use of client-advertised inline catalogs&lt;/li&gt;
&lt;li&gt;Dynamic overlays that narrow or extend a trusted base catalog for a specific request&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;That third option is the one I would ship most often.&lt;/p&gt;
&lt;h2&gt;
  
  
  The dynamic pattern I recommend
&lt;/h2&gt;

&lt;p&gt;Do not let the model generate a brand new universe from scratch.&lt;/p&gt;

&lt;p&gt;Instead:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Start from a fixed trusted base catalog.&lt;/li&gt;
&lt;li&gt;Let the model generate a task-shaped overlay.&lt;/li&gt;
&lt;li&gt;Validate that overlay.&lt;/li&gt;
&lt;li&gt;Merge it into the base contract for prompting and validation.&lt;/li&gt;
&lt;li&gt;Fall back to the base contract if the overlay keeps failing.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;This gives you flexibility without losing control.&lt;br&gt;
Most products do not need unbounded UI generation.&lt;br&gt;
They need a safe way to adapt a known renderer contract to the long tail.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgzbyj9x9muo6q41e10kz.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgzbyj9x9muo6q41e10kz.png" alt="Animated diagram of the A2UI dynamic overlay loop showing fixed-by-default policy, overlay validation and repair, and deterministic fallback." width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  Why validation is non-negotiable
&lt;/h2&gt;

&lt;p&gt;A2UI v0.9 is more prompt-friendly.&lt;br&gt;
It is not a security model.&lt;/p&gt;

&lt;p&gt;If you allow a model to shape any part of the UI contract, then validation becomes part of the product, not an implementation detail.&lt;/p&gt;

&lt;p&gt;At minimum, a serious pipeline should validate two things:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;The schema contract itself&lt;/li&gt;
&lt;li&gt;The final A2UI payload generated against that contract&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;That separation matters because a valid overlay does not guarantee a valid payload.&lt;/p&gt;

&lt;p&gt;For dynamic schema in particular, I would validate:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;overlay structure&lt;/li&gt;
&lt;li&gt;component and property compatibility&lt;/li&gt;
&lt;li&gt;child reference types&lt;/li&gt;
&lt;li&gt;topology integrity&lt;/li&gt;
&lt;li&gt;final payload instances against the selected catalog&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Without this layer, dynamic schema quickly turns into "the backend forwards malformed intent and hopes the renderer is charitable."&lt;/p&gt;
&lt;h2&gt;
  
  
  The architecture I would actually ship
&lt;/h2&gt;

&lt;p&gt;If I were building a fullstack agent web app around A2UI, this is the high-level policy I would use.&lt;/p&gt;
&lt;h3&gt;
  
  
  1. Fixed by default
&lt;/h3&gt;

&lt;p&gt;Use a fixed catalog for the majority of flows.&lt;br&gt;
Keep the happy path boring.&lt;/p&gt;

&lt;p&gt;That is where stability and predictable UX come from.&lt;/p&gt;
&lt;h3&gt;
  
  
  2. Dynamic for the long tail
&lt;/h3&gt;

&lt;p&gt;Use dynamic overlays only for workflows that are genuinely exploratory, tenant-specific, or too variable for one static prompt contract.&lt;/p&gt;

&lt;p&gt;This keeps the flexible path available without making the whole system probabilistic.&lt;/p&gt;
&lt;h3&gt;
  
  
  3. Dynamic means task-shaped, not unbounded
&lt;/h3&gt;

&lt;p&gt;Restrict dynamic behavior to things like:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;narrowing allowed components&lt;/li&gt;
&lt;li&gt;adding task-specific examples or constraints&lt;/li&gt;
&lt;li&gt;selecting from trusted custom catalogs&lt;/li&gt;
&lt;li&gt;merging safe overlays over a base catalog&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Do not let the model invent component semantics the client never negotiated.&lt;/p&gt;
&lt;h3&gt;
  
  
  4. Validate, repair, retry, fallback
&lt;/h3&gt;

&lt;p&gt;The loop should be:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Generate candidate overlay&lt;/li&gt;
&lt;li&gt;Validate it&lt;/li&gt;
&lt;li&gt;If invalid, feed the error back to the model&lt;/li&gt;
&lt;li&gt;Retry a few times&lt;/li&gt;
&lt;li&gt;Fall back to fixed if it still fails&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;I would cap retries at around five attempts.&lt;/p&gt;

&lt;p&gt;Past that point, you are not repairing the schema.&lt;br&gt;
You are negotiating with entropy.&lt;/p&gt;

&lt;p&gt;At a high level, the control flow should look like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;user request
  -&amp;gt; choose fixed or dynamic policy
  -&amp;gt; if dynamic:
       generate candidate overlay
       validate overlay
       if invalid:
         return validation error to model
         retry up to N times
       if still invalid:
         fall back to fixed catalog
  -&amp;gt; generate final A2UI payload
  -&amp;gt; validate final payload
  -&amp;gt; stream to client
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The implementation should be just as explicit:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;MAX_SCHEMA_ATTEMPTS&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt;


&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;resolve_catalog&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;request_text&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;str&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;client_capabilities&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;dict&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="bp"&gt;None&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="n"&gt;fixed_catalog&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;get_fixed_catalog&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;client_capabilities&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="ow"&gt;not&lt;/span&gt; &lt;span class="nf"&gt;should_use_dynamic_schema&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;request_text&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;fixed&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;fixed_catalog&lt;/span&gt;

    &lt;span class="n"&gt;last_error&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="bp"&gt;None&lt;/span&gt;
    &lt;span class="n"&gt;last_overlay&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="bp"&gt;None&lt;/span&gt;

    &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;_&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="nf"&gt;range&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;MAX_SCHEMA_ATTEMPTS&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="n"&gt;overlay&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;llm_generate_overlay&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
            &lt;span class="n"&gt;request_text&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;request_text&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="n"&gt;client_capabilities&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;client_capabilities&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="n"&gt;previous_error&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;last_error&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="n"&gt;broken_schema&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;last_overlay&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="p"&gt;)&lt;/span&gt;

        &lt;span class="k"&gt;try&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
            &lt;span class="n"&gt;selected_catalog&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;validate_overlay&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;overlay&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;client_capabilities&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
            &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;dynamic&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;selected_catalog&lt;/span&gt;
        &lt;span class="k"&gt;except&lt;/span&gt; &lt;span class="nb"&gt;Exception&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="n"&gt;exc&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
            &lt;span class="n"&gt;last_error&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;str&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;exc&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
            &lt;span class="n"&gt;last_overlay&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;overlay&lt;/span&gt;

    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;fallback-fixed&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;fixed_catalog&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  5. Validate the final payload too
&lt;/h3&gt;

&lt;p&gt;Even after the schema contract passes, validate the generated A2UI payload before it reaches the client.&lt;/p&gt;

&lt;p&gt;Schema validation and instance validation are separate responsibilities.&lt;br&gt;
Treat them that way.&lt;/p&gt;

&lt;h3&gt;
  
  
  6. Cache successful overlays
&lt;/h3&gt;

&lt;p&gt;If a task-shaped overlay validates and performs well for a repeated intent, cache it by tenant, task family, and capability set.&lt;/p&gt;

&lt;p&gt;That reduces latency, prompt cost, and repeated schema thrash.&lt;/p&gt;

&lt;h3&gt;
  
  
  7. Treat all agent output as untrusted
&lt;/h3&gt;

&lt;p&gt;This should be obvious, but it is still worth stating directly.&lt;/p&gt;

&lt;p&gt;Agent messages, UI payloads, and model-shaped schema overlays are all untrusted input.&lt;/p&gt;

&lt;p&gt;That means:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;validation&lt;/li&gt;
&lt;li&gt;sanitization&lt;/li&gt;
&lt;li&gt;strict renderer boundaries&lt;/li&gt;
&lt;li&gt;strong CSP and isolation where relevant&lt;/li&gt;
&lt;li&gt;no casual trust just because the output happens to be JSON-shaped&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  A useful mental model
&lt;/h2&gt;

&lt;p&gt;I think the cleanest way to reason about A2UI is this:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;the renderer is trusted&lt;/li&gt;
&lt;li&gt;the model is constrained&lt;/li&gt;
&lt;li&gt;the backend is the enforcer&lt;/li&gt;
&lt;li&gt;fallback is deterministic&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That is the architecture.&lt;br&gt;
Once you see it that way, the fixed-versus-dynamic decision gets much easier.&lt;/p&gt;

&lt;h2&gt;
  
  
  When to use which approach
&lt;/h2&gt;

&lt;p&gt;My practical rule is simple.&lt;/p&gt;

&lt;p&gt;Use fixed schema when you want reliability.&lt;br&gt;
Use dynamic overlays when variability is real and the value justifies the complexity.&lt;/p&gt;

&lt;p&gt;In practice:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;fixed for core trusted workflows&lt;/li&gt;
&lt;li&gt;dynamic for the long tail&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Per surface, not per company.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;A2UI v0.9 is a meaningful step forward for agent-driven interfaces.&lt;/p&gt;

&lt;p&gt;The flatter structure, prompt-first posture, swappable catalogs, and explicit lifecycle make it much more usable than older "generate a giant nested object and pray" approaches.&lt;/p&gt;

&lt;p&gt;But the big lesson is not that everything should become dynamic.&lt;br&gt;
The big lesson is that agent-driven UI still needs architecture.&lt;/p&gt;

&lt;p&gt;The posture I would use is:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;fixed schemas for stable, high-confidence workflows&lt;/li&gt;
&lt;li&gt;dynamic overlays for the long tail&lt;/li&gt;
&lt;li&gt;strict validation in the middle&lt;/li&gt;
&lt;li&gt;repair loops for recoverable failures&lt;/li&gt;
&lt;li&gt;deterministic fallback when the model cannot produce a safe contract&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That gives you flexibility without surrendering control.&lt;br&gt;
And in agent systems, control is the thing that lets creativity survive production.&lt;/p&gt;

&lt;h2&gt;
  
  
  References
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://a2ui.org/" rel="noopener noreferrer"&gt;A2UI homepage&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://developers.googleblog.com/introducing-a2ui-an-open-project-for-agent-driven-interfaces/" rel="noopener noreferrer"&gt;Google Developers Blog: Introducing A2UI&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://a2ui.org/specification/v0.9-a2ui/" rel="noopener noreferrer"&gt;A2UI Protocol v0.9&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://a2ui.org/specification/v0.9-evolution-guide/" rel="noopener noreferrer"&gt;A2UI v0.8.1 to v0.9 evolution guide&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://a2ui.org/quickstart/" rel="noopener noreferrer"&gt;A2UI quickstart&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://a2ui.org/guides/renderer-development/" rel="noopener noreferrer"&gt;A2UI renderer development guide&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://a2ui.org/guides/custom-components/" rel="noopener noreferrer"&gt;A2UI custom component catalogs guide&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://a2ui.org/specification/v0.9-a2ui/#validator-compliance-custom-catalogs" rel="noopener noreferrer"&gt;A2UI v0.9 validator compliance and custom catalogs&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://raw.githubusercontent.com/google/A2UI/main/agent_sdks/python/agent_development.md" rel="noopener noreferrer"&gt;A2UI Python SDK agent development guide&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://raw.githubusercontent.com/google/A2UI/main/agent_sdks/python/README.md" rel="noopener noreferrer"&gt;A2UI Python SDK README&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>ai</category>
      <category>webdev</category>
      <category>architecture</category>
    </item>
    <item>
      <title>The Frontend Reward Loop for Agentic Software</title>
      <dc:creator>Brian Love</dc:creator>
      <pubDate>Wed, 18 Mar 2026 23:02:37 +0000</pubDate>
      <link>https://dev.to/blove/the-frontend-reward-loop-for-agentic-software-4cig</link>
      <guid>https://dev.to/blove/the-frontend-reward-loop-for-agentic-software-4cig</guid>
      <description>&lt;p&gt;I have been thinking about this after reading the rLLM work on post-training language agents.&lt;/p&gt;

&lt;p&gt;The big idea in that work is right: if agents are going to improve, they need a loop.&lt;br&gt;
Not just inference.&lt;br&gt;
A loop of action, feedback, and improvement.&lt;/p&gt;

&lt;p&gt;What I want to argue in this post is simple:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;The frontend is the best place to collect the heuristics for that loop.&lt;/li&gt;
&lt;li&gt;Most teams should push prompt augmentation much further before training an offline reward model.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  tl;dr
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Agent quality is now a feedback-loop problem, not only a model-size problem.&lt;/li&gt;
&lt;li&gt;The frontend is the only place where intent, correction, and outcome are visible together.&lt;/li&gt;
&lt;li&gt;Product heuristics can drive real gains without starting with offline reward-model training.&lt;/li&gt;
&lt;li&gt;Prompt augmentation gets most teams very far on short and medium-horizon workflows.&lt;/li&gt;
&lt;li&gt;Move to offline RL only when prompt gains flatten or long-horizon credit assignment becomes the bottleneck.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Fullstack Agentic Applications
&lt;/h2&gt;

&lt;p&gt;Be sure to check out the &lt;a href="https://threadplane.ai" rel="noopener noreferrer"&gt;Angular Agent Framework&lt;/a&gt; for building fullstack agentic applications.&lt;/p&gt;

&lt;h2&gt;
  
  
  From static intelligence to live behavior
&lt;/h2&gt;

&lt;p&gt;Reasoning models can do very well on static tasks.&lt;br&gt;
Agentic software lives in dynamic tasks.&lt;/p&gt;

&lt;p&gt;That means we care less about one-shot correctness and more about behavioral quality over a sequence of steps:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Did the system choose a sensible next action?&lt;/li&gt;
&lt;li&gt;Did the user need to undo or rewrite it?&lt;/li&gt;
&lt;li&gt;Did the workflow actually complete?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This is why post-training agents matter.&lt;br&gt;
And this is why product teams need to treat interaction data as first-class infrastructure.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why the frontend is the best reward surface
&lt;/h2&gt;

&lt;p&gt;The backend can tell us what was called.&lt;br&gt;
The model logs can tell us what token came next.&lt;br&gt;
Only the frontend can reliably tell us whether the user felt the action was useful.&lt;/p&gt;

&lt;p&gt;The frontend gives us a dense stream of behavior signals:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Accept vs reject&lt;/li&gt;
&lt;li&gt;Minor edit vs full rewrite&lt;/li&gt;
&lt;li&gt;One-shot completion vs retry loops&lt;/li&gt;
&lt;li&gt;Continue vs abandon&lt;/li&gt;
&lt;li&gt;Agent flow vs human escalation&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These are not perfect labels.&lt;br&gt;
They are heuristics.&lt;br&gt;
But they are high signal and available immediately.&lt;/p&gt;

&lt;p&gt;In practice, this is the best early reward surface most teams have.&lt;/p&gt;

&lt;h2&gt;
  
  
  A practical heuristic set
&lt;/h2&gt;

&lt;p&gt;If I were starting today, I would implement four buckets.&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Correction heuristics
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Edit distance between agent output and final submitted value&lt;/li&gt;
&lt;li&gt;Undo/revert frequency after agent actions&lt;/li&gt;
&lt;li&gt;Manual overwrite rate&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  2. Friction heuristics
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Time-to-next-meaningful-action&lt;/li&gt;
&lt;li&gt;Retry count for same intent&lt;/li&gt;
&lt;li&gt;Dead-end path frequency&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  3. Outcome heuristics
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Task completion rate&lt;/li&gt;
&lt;li&gt;Reopen/regression rate&lt;/li&gt;
&lt;li&gt;SLA-aware completion time&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  4. Trust heuristics
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Delegation rate for repeat tasks&lt;/li&gt;
&lt;li&gt;Human escalation rate&lt;/li&gt;
&lt;li&gt;Opt-out after poor outcomes&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;No single metric is enough.&lt;br&gt;
A composite score is usually better than betting on one proxy.&lt;/p&gt;

&lt;h2&gt;
  
  
  The part I want to challenge: do we need offline reward models first?
&lt;/h2&gt;

&lt;p&gt;Usually, no.&lt;/p&gt;

&lt;p&gt;I think most teams can get much further than expected with prompt augmentation before training a separate reward model offline.&lt;/p&gt;

&lt;p&gt;When I say prompt augmentation, I mean the full runtime strategy:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Better task framing&lt;/li&gt;
&lt;li&gt;Better context packing from recent user behavior&lt;/li&gt;
&lt;li&gt;Better tool constraints and checks&lt;/li&gt;
&lt;li&gt;Better fallback prompts for low-confidence cases&lt;/li&gt;
&lt;li&gt;Better routing between prompt variants&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This is still behavior optimization.&lt;br&gt;
It is just inference-time optimization.&lt;/p&gt;

&lt;p&gt;For many product workflows, that is enough to unlock most early gains.&lt;/p&gt;

&lt;h2&gt;
  
  
  How far prompt augmentation gets us
&lt;/h2&gt;

&lt;p&gt;Prompt augmentation gets us very far on:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Bounded workflows&lt;/li&gt;
&lt;li&gt;Clear completion criteria&lt;/li&gt;
&lt;li&gt;Frequent user corrections&lt;/li&gt;
&lt;li&gt;Fast evaluation loops&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Examples:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Internal support triage&lt;/li&gt;
&lt;li&gt;Structured drafting and form completion&lt;/li&gt;
&lt;li&gt;Actionable summarization&lt;/li&gt;
&lt;li&gt;Multi-step UI workflows with explicit completion states&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Where it starts to fail:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Long trajectories with delayed outcomes&lt;/li&gt;
&lt;li&gt;Heavy credit assignment ambiguity&lt;/li&gt;
&lt;li&gt;High cost/latency from complex inference-time strategies&lt;/li&gt;
&lt;li&gt;Persistent instability across prompt variants&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That is when offline trajectory training and RL become worth the investment.&lt;/p&gt;

&lt;h2&gt;
  
  
  Recommended rollout
&lt;/h2&gt;

&lt;p&gt;If you are building agentic product features now, this is the sequence I would use:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Instrument frontend interaction events with stable task/session IDs.&lt;/li&gt;
&lt;li&gt;Define a small heuristic scorecard (correction, friction, outcome, trust).&lt;/li&gt;
&lt;li&gt;Use that scorecard to drive prompt and routing updates weekly.&lt;/li&gt;
&lt;li&gt;Build an eval flywheel with holdouts and regression checks.&lt;/li&gt;
&lt;li&gt;Introduce offline reward-model training only after improvements plateau.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;This keeps teams moving quickly while preserving a path to deeper optimization.&lt;/p&gt;

&lt;h2&gt;
  
  
  Guardrails
&lt;/h2&gt;

&lt;p&gt;None of this works well without guardrails.&lt;/p&gt;

&lt;p&gt;At minimum:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Privacy-safe event collection&lt;/li&gt;
&lt;li&gt;Anti-gaming checks for proxy metrics&lt;/li&gt;
&lt;li&gt;Correctness-weighted objectives (not just speed)&lt;/li&gt;
&lt;li&gt;Human review samples to calibrate heuristic drift&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If we do not add guardrails, we optimize the dashboard instead of the product.&lt;/p&gt;

&lt;h2&gt;
  
  
  Closing
&lt;/h2&gt;

&lt;p&gt;The backend can train the policy.&lt;br&gt;
But the frontend is where the reward signal is born.&lt;/p&gt;

&lt;p&gt;If we want agents that improve from real human interaction, we need to treat frontend behavior as training infrastructure.&lt;/p&gt;

&lt;p&gt;And we should be honest about sequencing:&lt;br&gt;
Start with prompt augmentation.&lt;br&gt;
Push it hard.&lt;br&gt;
Then add offline RL when the data proves you need it.&lt;/p&gt;

&lt;h2&gt;
  
  
  Using Angular &amp;amp; LangChain together?
&lt;/h2&gt;

&lt;p&gt;Check out the &lt;a href="https://stream-resource.dev" rel="noopener noreferrer"&gt;the Enterprise Streaming Resource for LangChain and Angular&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  References
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;rLLM: &lt;a href="https://pretty-radio-b75.notion.site/rLLM-A-Framework-for-Post-Training-Language-Agents-21b81902c146819db63cd98a54ba5f31" rel="noopener noreferrer"&gt;A Framework for Post-Training Language Agents&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;rLLM Docs: &lt;a href="https://rllm-project.readthedocs.io/en/stable/" rel="noopener noreferrer"&gt;rLLM Project Documentation&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Sutton and Silver: [Welcome to the Era of Experience](&lt;a href="https://storage.googleapis.com/deepmind-media/Era-of-Experience%20/The%20Era%20of%20Experience%20Paper.pdf" rel="noopener noreferrer"&gt;https://storage.googleapis.com/deepmind-media/Era-of-Experience%20/The%20Era%20of%20Experience%20Paper.pdf&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>ai</category>
      <category>webdev</category>
      <category>architecture</category>
    </item>
  </channel>
</rss>
