agui-dotnet-integration-tests
Skill16k starsChanged 9 months agoMITView on GitHub
Write integration tests for the AG-UI .NET SDK. USE FOR: adding a new AG-UI event type and covering it end-to-end, testing SSE or protobuf streaming through the hosting pipeline, verifying AGUIChatClient maps events to ChatResponseUpdate, multi-turn conversation tests, parameterizing a test over Json/Protobuf transports, adding or updating a GettingStarted sample replay/Verify snapshot. Covers: WebApplicationFactory + DelegatingStreamingChatClient setup, IChatClient-based assertions with Assert.Collection, TransportFormat [Theory] (Json/Protobuf), recording/replay capture infrastructure, and the 8-capture-point Verify baselines. DO NOT USE FOR: unit tests of event serialization (use tests/AGUI.Abstractions.UnitTests) or stream-conversion unit tests (use tests/AGUI.Server.UnitTests).
Trending
More talk lately.about the whole repository
Who's talking about ag-ui-protocol/ag-ui
- strands-agents/harness-sdk“[FEATURE] AG-UI”GitHub · May 29, 2025 · 44 reactions
- A Hacker News story“Show HN: AG-UI Protocol – Bring Agents into Frontend Applications”Hacker News · May 13, 2025 · 36 points
- NousResearch/hermes-agent“Feature: Web UI Gateway — Local Browser-Based Interface with Streaming, Artifacts & Rich Rendering”GitHub · Mar 6, 2026 · 10 reactions
- langchain-ai/deepagents“AG-UI integration/demo”GitHub · Nov 5, 2025 · 8 reactions
- Effect-TS/effect“Feature request: AG-UI protocol support for effect/ai”GitHub · Jun 15, 2026 · 7 reactions
The biggest 5 of 56 mentions linking to the repository that our crawl found. Each line is their own headline.
See all 56
Talked about on GitHub, Bluesky and Hacker News (56 times).
On GitHub · 50
- May 29, 2025[FEATURE] AG-UI — strands-agents/harness-sdk44 reactions · 4 comments
- Mar 6, 2026Feature: Web UI Gateway — Local Browser-Based Interface with Streaming, Artifacts & Rich Rendering — NousResearch/hermes-agent10 reactions · 15 comments
- Nov 5, 2025AG-UI integration/demo — langchain-ai/deepagents8 reactions · 5 comments
- Jun 15, 2026Feature request: AG-UI protocol support for effect/ai — Effect-TS/effect7 reactions
- Aug 22, 2025Feature Request: Add AG-UI Protocol Support — HolmesGPT/holmesgpt7 reactions · 5 comments
45 more on GitHub
- Aug 12, 2026Make Copilot SDK consumable for end-users by adding first-class AG-UI protocol support — github/copilot-sdk5 reactions
- Apr 10, 2026FR : Integrations with the A2UI and AG‑UI Protocols — Chainlit/chainlit4 reactions · 2 comments
- Jun 27, 2025support agui protocol — langgenius/dify4 reactions · 3 comments
- Sep 14, 2026IPI-1211 · PLANNER-RELIABILITY — Upgrade the Mastra Bridge to 1.1.4 Before Re-Testing Intelligence — amoai-tech/ipixaisays it tested it3 reactions · 11 comments
- Aug 17, 2026[Question / Feature Request] Any plans or built-in support for AG-UI protocol integration? — google/adk-go3 reactions · 2 comments
- Sep 27, 2026IPI-1363 · Prevent malformed workspace context from crashing the Planner — amoai-tech/ipixai2 reactions · 6 comments
- Sep 20, 2026IPI-1259 · Show a visible Production Copilot error when an AI run drops — amoai-tech/ipixai2 reactions · 14 comments
- Jul 22, 2026fix(deps): bump @ag-ui/mastra to stable, prevent HITL interrupt strand (IPI-760) — amo-tech-ai/lumina-studio2 reactions · 14 comments
- Nov 16, 2025docs: pluralize add_langgraph_fastapi_endpoint due to ag-ui-protocol/ag-ui/pull/701 — CopilotKit/CopilotKit2 reactions · 4 comments
- Oct 17, 2025🚀 Feature Request: Agno shared state as adk-middleware — CopilotKit/CopilotKit2 reactions · 2 comments
- Jun 30, 2025feat: AG-UI adapter (toolsets) — pydantic/pydantic-ai2 reactions · 6 comments
- Nov 1, 2026chore(deps): bump @ag-ui/core from 1.0.2 to 1.0.3 — dungsil/keundal1 reaction · 1 comment
- Aug 31, 2026Bump jsondiffpatch, @ag-ui/mastra and @mastra/client-js — ovabor/worksync-frontend1 reaction · 2 comments
- Aug 20, 2026Tracking: our upstream comments on A2A #1992 and AG-UI #2148 — hukaichun/funduq1 reaction · 1 comment
- Apr 10, 2026🐛 Bug: [sdk-python] Intermediate messages from subgraphs appear in final MessagesSnapshotEvent — CopilotKit/CopilotKit1 reaction · 2 comments
- Mar 15, 2026Ensure glasses client is written correctly and perform gap analysis of design document and implement missing features — companionintelligence/CI-Mentra1 reaction
- Feb 22, 2026[FEAT] add Agno (AgnoOS) as a supported agent provider — tambo-ai/tambo1 reaction · 1 comment
- Oct 7, 2025为BotSharp添加AGUI兼容插件 — GreenShadeZhang/BotSharp1 reaction
- Jul 25, 2025https://github.com/ag-ui-protocol/ag-ui — mikkihugo/claude-code-zen1 reaction
- Jun 23, 2025[FEAT] Support AGUI — VoltAgent/voltagent1 reaction · 5 comments
- May 25, 2025AG-UI — mudler/LocalAGI1 reaction
- Nov 2, 2026chore(deps): bump the ag-ui-updates group across 1 directory with 2 updates — 46ki75/elmethis0 reactions
- Nov 2, 2026Bump @ag-ui/client from 0.0.59 to 1.0.3 — govuk-once/govuk-chat-v20 reactions
- Nov 1, 2026Bump zod and @ag-ui/core in /chatbot-app/frontend — aws-samples/sample-reconciliation-agent0 reactions
- Nov 1, 2026Bump @ag-ui/client from 0.0.59 to 1.0.1 in /web — cfokit/cfokit0 reactions · 1 comment
- Oct 24, 2026Bump @ag-ui/client from 1.0.2 to 1.0.3 in /extensions/conversationalbi/runtime — sanderdw/iceberg-data-platform0 reactions
- Oct 23, 2026DEV: Bump @ag-ui/client from 0.0.59 to 1.0.3 in /architect-html — origam/origam0 reactions
- Oct 22, 2026[TASK] Progressive A2UI over AG-UI via a render_a2ui system tool — yaalalabs/agent-kernel0 reactions
- Oct 20, 2026chore: bump @ag-ui/client from 0.0.59 to 1.0.3 — 46ki75/internal0 reactions · 1 comment
- Oct 19, 2026build(deps): bump @ag-ui/client from 1.0.2 to 1.0.3 in /harness/web — roboalchemist/kicad-agent0 reactions
- Oct 15, 2026deps: bump @ag-ui/client from 0.0.59 to 1.0.2 — d2k-klin/reelhive0 reactions · 1 comment
- Oct 15, 2026deps: bump ag-ui-protocol from 0.1.22 to 1.0.0 — d2k-klin/reelhive0 reactions · 1 comment
- Oct 12, 2026Bump @ag-ui/client from 0.0.59 to 1.0.2 in /apps/portal — ovsec/agent-platform0 reactions
- Oct 11, 2026chore(deps): bump @ag-ui/client from 0.0.59 to 1.0.2 in /apps/admin — karthictu/casepilot0 reactions
- Oct 9, 2026build(deps): Bump @ag-ui/client from 0.0.59 to 1.0.2 in /src/web — devkimchi/battle-school-lunch0 reactions
- Oct 8, 2026ag-ui — hmafridy1-sketch/Hemel0 reactions
- Oct 5, 2026chore(deps): Bump @ag-ui/core from 0.0.57 to 1.0.1 in /server — dineshreddymeka/Agent-Marko0 reactions · 1 comment
- Oct 4, 2026build(deps): Bump ag-ui-protocol from 0.1.19 to 1.0.0 in /services/form-agent — angelmtenor/ai-circus-framework0 reactions
- Oct 4, 2026build(deps): Bump ag-ui-protocol from 0.1.19 to 1.0.0 in /services/rag-agent — angelmtenor/ai-circus-framework0 reactions
- Oct 4, 2026build(deps): Bump ag-ui-protocol from 0.1.19 to 1.0.0 in /services/assistant — angelmtenor/ai-circus-framework0 reactions
- Oct 4, 2026chore(deps): bump @ag-ui/core from 1.0.0 to 1.0.1 — c10366956/cyrene-cda0 reactions
- Oct 2, 2026Bump ag-ui-protocol from 0.1.19 to 1.0.0 — sidhasadhak/aughor0 reactions
- Sep 29, 2026chore(deps): bump @ag-ui/client from 0.0.59 to 1.0.2 in /chatbot-app/frontend — aws-samples/sample-strands-agent-with-agentcore0 reactions
- Sep 29, 2026chore(deps): bump @ag-ui/core from 0.0.59 to 1.0.2 in /chatbot-app/frontend — aws-samples/sample-strands-agent-with-agentcore0 reactions
- Sep 28, 2026build(deps): bump ag-ui-protocol from 0.1.22 to 1.0.0 — srtab/daiv0 reactions
On Bluesky · 5
- Aug 6, 2025with the emergence of early MCP-UI and AG-UI standards, the 2013 perspective of "cards are the future of the web" is set to ring true for a… — @ronan.design3 likes and reposts · 1 reply
- Oct 2, 2026📦 ag-ui-protocol / ag-ui ⭐ 16,187 (+68) 🗒 TypeScript AG-UI: the Agent-User Interaction Protocol. Bring Agents into Frontend Applications. — @github-trending-js.bsky.social1 likes and repost
- Jul 29, 2026📦 ag-ui-protocol / ag-ui ⭐ 15,003 (+48) 🗒 TypeScript AG-UI: the Agent-User Interaction Protocol. Bring Agents into Frontend Applications. — @github-trending-js.bsky.social1 likes and repost
- Jul 22, 2026github.com/ag-ui-protoc... [Related post:https://javapro.io/2026/07/16/solving-spring-ais-ui-challenge-with-ag-uis-java-sdk/] << ...open,… — @stefanofago.bsky.social1 likes and repost
- May 14, 2025github.com/ag-ui-protoc... — @detroitpro.bsky.social1 likes and repost
On Hacker News · 1
- May 13, 2025Show HN: AG-UI Protocol – Bring Agents into Frontend Applications36 points · 5 comments
In this repository15 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- agui-cross-sdk-paritySkill
- agui-dojoSkill
- agui-dotnet-agents-syncSkill
- agui-dotnet-code-reviewSkill
- agui-dotnet-cross-language-testsSkill
- agui-dotnet-feature-workflowSkill
- agui-dotnet-sample-stepSkill
- agui-dotnet-sdk-docsSkill
- agui-dotnet-transportSkill
- agui-dotnet-unit-testsSkill
- agui-dotnet-wire-typesSkill
- agui-playwright-validateSkill
- ag-ui-a2ui-integrationSkill
The file
We split this skill into the rules it gives an agent
2 rules. About 0 are common, 0 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 133
When you add a [Theory] test, prefer parameterizing over TransportFormat.
- Very specific: line 226
When a snapshot changes, review the .received.json diff, then accept (e.g.
≈ “Common” is an estimate: at least 1 in 5 of the 213,895 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
AG-UI .NET Integration Tests
End-to-end tests for the AG-UI .NET SDK that post RunAgentInput, stream events over the wire (SSE or protobuf), and assert behavior through the AGUIChatClient (IChatClient) abstraction.
Orientation
The canonical project layout, endpoint pattern, and naming live in
sdks/dotnet/AGENTS.md (project layout + endpoint pattern) and
sdks/dotnet/docs/architecture.md (the server/client pipeline). Read those first;
this skill covers only the integration-test mechanics on top of them.
One durable gotcha: the test project folder and csproj are named
tests/AGUI.Hosting.AspNetCore.IntegrationTests/ (kept after the server package was
renamed to AGUI.Server), but all types live in namespace AGUI.Server.IntegrationTests.
The ASP.NET hosting glue (AddAGUI, the negotiating endpoint, AGUIResults) lives in
samples/AGUI.Samples.Shared, and the protobuf formatter comes from AGUI.Protobuf.
Project Layout
tests/AGUI.Hosting.AspNetCore.IntegrationTests/ # namespace AGUI.Server.IntegrationTests
├── Infrastructure/
│ ├── IntegrationTestBase.cs # Two-tier base: generic <TEntryPoint> + non-generic (uses Program). Emit helpers, CollectUpdates, CreateClient(handler[, TransportFormat]), VerifyCaptures (8 capture points), recording load/save, id scrubbing.
│ ├── TransportFormat.cs # enum { Json, Protobuf } — selects the wire encoding the test client negotiates
│ ├── DelegatingStreamingChatClient.cs # Func-based IChatClient for inline server behavior
│ ├── CapturingChatClient.cs # IChatClient decorator that records server-side calls (ServerCallCapture)
│ ├── CapturingAGUITransport.cs # IAGUITransport decorator that records client-side turns (TurnCapture)
│ ├── ServerCallCapture.cs # RunAgentInput + ChatMessage[] + ChatOptions + ChatResponseUpdate[] per server call
│ ├── TurnCapture.cs # RunAgentInput + BaseEvent[] per client-side turn
│ ├── ChatResponseUpdateCaptureConverter.cs # JsonConverter that renders ChatResponseUpdate (+RawRepresentation) for snapshots
│ ├── AGUIEndpointExtensions.cs # Test-local MapAGUI: ToChatRequestContext + AsAGUIEventStreamAsync, returns AGUIResults.Events (negotiating)
│ ├── AGUIServerSentEventsResult.cs # Legacy SSE-only IResult (still present; the live endpoint uses AGUIResults instead)
│ ├── AGUICapabilitiesEndpointRouteBuilderExtensions.cs # Test-only AgentCapabilities publisher (the SDK ships no capabilities endpoint; the spec doesn't define one)
│ ├── Program.cs # Minimal host: AddAGUI() + register ProtobufEventStreamFormatter + DelegatingStreamingChatClient + MapAGUI("/agui")
│ └── VerifyConfig.cs # ModuleInitializer for Verify settings (DontScrubDateTimes, DiffRunner disabled)
├── RunLifecycleIntegrationTest.cs # Run lifecycle events [Theory Json/Protobuf]
├── TextStreamingIntegrationTest.cs # Text streaming + multi-turn [Theory Json/Protobuf]
├── ToolCallIntegrationTest.cs # Tool call events [Theory + one Json-only ToolCallResult fact]
├── ClientToolIntegrationTest.cs # Client (frontend) tools [Theory Json/Protobuf]
├── MixedToolInvocationIntegrationTest.cs # Mixed server+client tool batches (approval-flow) [Json-only, has Verify baselines]
├── FrontendToolReinvocationTest.cs # Frontend tool re-invocation [Json-only]
├── StateManagementIntegrationTest.cs # State snapshot/delta [Theory Json/Protobuf]
├── ReasoningIntegrationTest.cs # Thinking/reasoning events [Json-only]
├── ActivityIntegrationTest.cs # Activity snapshot/delta [Json-only]
├── CustomAndRawEventIntegrationTest.cs # Custom/raw events [Theory Json/Protobuf]
├── RawRepresentationFactoryIntegrationTest.cs # Custom RawRepresentation factory [Theory Json/Protobuf]
├── CapabilitiesEndpointIntegrationTest.cs # Capabilities endpoint (exercises the test-local helper) [Json-only]
├── TransportEquivalenceIntegrationTest.cs # Asserts Json and Protobuf decode to identical ChatResponseUpdate sequences
├── AGUIResultsTest.cs # Accept-header negotiation (proto vs SSE vs 406) for AGUIResults.Events
├── Samples/GettingStarted/
│ ├── StepNN_XyzTest.cs # Replay/snapshot test per sample (Step01..Step12)
│ ├── fixtures/{Sample}/*.recording.json # Recorded List<List<ChatResponseUpdate>> (one list per turn)
│ └── baselines/{Sample}/*.verified.json # Verify snapshots, one file per capture point (see below)
└── AGUI.Hosting.AspNetCore.IntegrationTests.csproj # references AGUI.Client, AGUI.Protobuf, AGUI.Samples.Shared + every Step01..Step12 Client/ServerArchitecture
IChatClient-based design
The server side always works with ChatResponseUpdate streams. The AG-UI hosting layer converts these to BaseEvent streams on the wire (SSE or protobuf). Tests verify behavior at the ChatResponseUpdate level, inspecting the underlying AG-UI event via update.RawRepresentation.
DelegatingStreamingChatClient pattern
Define server behavior inline via a Func<IEnumerable<ChatMessage>, ChatOptions?, CancellationToken, IAsyncEnumerable<ChatResponseUpdate>>:
var client = CreateClient((messages, options, ct) =>
EmitTextResponse("Hello!", ct), format);CreateClient builds a fresh AGUIChatClient over a WebApplicationFactory<Program> HTTP pipeline with DelegatingStreamingChatClient injected via ConfigureTestServices.
Two-tier base class
IntegrationTestBase<TEntryPoint>— generic base for anyProgram. ProvidesCollectUpdates,ExtractText, theEmit*helpers,VerifyCaptures, recording load/save, and snapshot id scrubbing.IntegrationTestBase— non-generic subclass ofIntegrationTestBase<Program>. Sets the.slnxcontent-root env var and exposes theCreateClientoverloads that injectDelegatingStreamingChatClient.
Host registration
Infrastructure/Program.cs registers the protobuf formatter so the server can answer either transport:
builder.Services.AddAGUI(); // AGUI.Samples.Shared
builder.Services.AddSingleton<IAGUIEventStreamFormatter, ProtobufEventStreamFormatter>(); // AGUI.ProtobufThe test endpoint mirrors the production shape but returns the negotiating result:
var events = chatClient.GetStreamingResponseAsync(ctx.Messages, ctx.ChatOptions, ct)
.AsAGUIEventStreamAsync(ctx, ct);
return AGUIResults.Events(events, httpContext, ct); // negotiates protobuf vs SSE from AcceptEmit helpers
All Emit* helpers yield ChatResponseUpdate (never BaseEvent); the pipeline converts them. They take a trailing [EnumeratorCancellation] CancellationToken ct = default:
EmitTextResponse(text, ct)— assistantTextContentEmitToolCallResponse(callId, name, args, ct)—FunctionCallContent,FinishReason = ToolCallsEmitToolCallWithResultResponse(callId, name, args, result, ct)— call update then aFunctionResultContentupdateEmitEmptyResponse(ct)— yields nothing
Transport parameterization (Json / Protobuf)
Most event-shape tests are [Theory] over TransportFormat:
[Theory]
[InlineData(TransportFormat.Json)]
[InlineData(TransportFormat.Protobuf)]
public async Task PostRun_TextContent_MapsToTextMessageEvents(TransportFormat format)
{
var client = CreateClient((messages, options, ct) =>
EmitTextResponse("Hello world!", ct), format);
var updates = await CollectUpdates(client, [new ChatMessage(ChatRole.User, "Hi")]);
// ...assert via update.RawRepresentation...
}How CreateClient(handler, format) works:
TransportFormat.Json→ default SSE transport (text/event-stream); no negotiation handler.TransportFormat.Protobuf→ inserts anAGUIEventStreamHandleradvertising[protobuf, sse](ProtobufEventStreamFormatter+SseEventStreamFormatter) into the clientHttpClientpipeline, so the request prefersapplication/vnd.ag-ui.event+protoand the response is decoded accordingly.
Assertions and Verify baselines are reused unchanged across both formats. Capture happens at the decoded event/ChatResponseUpdate layer, and the request is always JSON, so only the wire encoding differs. TransportEquivalenceIntegrationTest pins this invariant by running the same scenario over both formats and asserting the decoded update sequences are identical.
Intentionally Json-only tests
A few suites are plain [Fact] (Json only) because their events are not representable in the protobuf subset — encoding them would throw NotSupportedException:
ReasoningIntegrationTest(thinking/reasoning),ActivityIntegrationTest(activity snapshot/delta).- The
ToolCallResultscenario inToolCallIntegrationTest(FunctionResultContent→TOOL_CALL_RESULT, a .NET-only event). The rest of that file stays[Theory]. MixedToolInvocationIntegrationTest,FrontendToolReinvocationTest, andCapabilitiesEndpointIntegrationTestare also Json-only.
When you add a [Theory] test, prefer parameterizing over TransportFormat. Only fall back to a Json-only [Fact] when the scenario emits a .NET-only event with no proto representation — and add a one-line comment saying so.
Procedure: writing a new integration test
- Pick the file by event category (see layout table). New category →
{Category}IntegrationTest.cs : IntegrationTestBase. - Declare the class with the
WebApplicationFactory<Program>ctor:public sealed class MyFeatureIntegrationTest : IntegrationTestBase { public MyFeatureIntegrationTest(WebApplicationFactory<Program> factory) : base(factory) { } } - Write a
[Theory]overTransportFormat(or[Fact]if Json-only per above), callCreateClient(handler, format), drive a turn withCollectUpdates, and assert the event sequence withAssert.Collection, checkingu.RawRepresentationtypes/properties. - Multi-turn: enqueue handlers in a
Queue<Func<...>>and dequeue per call; pass the full message history (prior user + synthesized assistant messages) on later turns. - Tool calls: pass tools via
ChatOptions { Tools = [DummyClientTool] }(DummyClientToolis built withCreateToolDeclaration). - New reusable emitter → add it to
IntegrationTestBase.cs; yieldChatResponseUpdate, notBaseEvent.
[Theory]
[InlineData(TransportFormat.Json)]
[InlineData(TransportFormat.Protobuf)]
public async Task PostRun_FunctionCallContent_MapsToToolCallEvents(TransportFormat format)
{
var client = CreateClient((messages, options, ct) =>
EmitToolCallResponse("call-1", "get_weather",
new Dictionary<string, object?> { ["location"] = "Seattle" }, ct), format);
var updates = await CollectUpdates(client,
[new ChatMessage(ChatRole.User, "Hi")],
new ChatOptions { Tools = [DummyClientTool] });
Assert.Collection(updates,
u => Assert.IsType<RunStartedEvent>(u.RawRepresentation),
u =>
{
var fcc = Assert.Single(u.Contents.OfType<FunctionCallContent>());
Assert.Equal("get_weather", fcc.Name);
Assert.Equal("call-1", fcc.CallId);
},
u => Assert.Equal(ChatFinishReason.ToolCalls, u.FinishReason));
}Sample recording / replay tests
Samples/GettingStarted/StepNN_XyzTest.cs runs each sample as a real host and verifies the full MEAI↔AG-UI round-trip deterministically. Samples exist for Step01–Step13 (Step12 = parallel tool calls, Step13 = protobuf); replay tests currently cover Step01–Step12 plus MixedToolInvocation.
Key types
FakeChatClient— defined per sample server project (e.g.Step01_GettingStarted.Server), aQueue-of-handlersIChatClientused in replay mode.CapturingChatClient— wraps the real/fake serverIChatClient, records each call as aServerCallCapture(RunAgentInput, messages, options, updates).CapturingAGUITransport— wrapsIAGUITransport, records eachSendAsyncas aTurnCapture(RunAgentInput + emittedBaseEvents).
Pattern
Each test inherits IntegrationTestBase<StepNN_Xyz.Server.Program> and uses a local CreateCapturingClient:
public sealed class Step01_GettingStartedTest
: IntegrationTestBase<Step01_GettingStarted.Server.Program>
{
[Fact]
public async Task PostRun_MultiTurn_SynthesizesAssistantMessages()
{
var (aguiClient, transport, server) = CreateCapturingClient(turnCount: 2);
var clientMessages = new List<List<ChatMessage>>();
var clientUpdates = new List<List<ChatResponseUpdate>>();
await SampleClient.RunAsync(aguiClient, TextWriter.Null, clientMessages, clientUpdates);
await VerifyAllCaptures(transport, server, clientMessages, clientUpdates);
}
}- Replay vs record:
CreateCapturingClientcallsLoadRecording(testName). If a fixture exists it injects aFakeChatClientreplaying it; otherwise it wraps the app's realIChatClientandSaveRecordingwrites a fresh fixture. - Fixtures:
Samples/GettingStarted/fixtures/{Sample}/{TestMethod}.recording.json— a serializedList<List<ChatResponseUpdate>>(one inner list per turn).
The 8 capture points (baselines)
VerifyCaptures writes one Verify target per capture point per turn under Samples/GettingStarted/baselines/{Sample}/, named {TestMethod}#Turn_{NN}.{CC}.{Request|Response}.{Client|Server}.{AGUI|NET}.verified.json. The eight points trace the full round-trip in order:
| CC | Direction | Side | Format | Field |
| 01 | Request | Client | NET | client.chatMessages (app → AGUIChatClient) |
| 02 | Request | Client | AGUI | client.runAgentInput (client → wire) |
| 03 | Request | Server | AGUI | server.runAgentInput (wire → endpoint) |
| 04 | Request | Server | NET | server.chatMessages (endpoint → LLM) |
| 05 | Response | Server | NET | server.chatResponseUpdates (LLM → endpoint) |
| 06 | Response | Server | AGUI | server.events (endpoint → wire) |
| 07 | Response | Client | AGUI | client.events (wire → client) |
| 08 | Response | Client | NET | client.chatResponseUpdates (client → app) |
Volatile ids (call_, msg_, run_, GUIDs, …) are scrubbed to stable *_Id_N placeholders, and createdAt/totalTokenCount are stripped, so baselines are deterministic. Because capture is at the decoded layer, the same baselines hold for protobuf runs.
Updating baselines
When a snapshot changes, review the .received.json diff, then accept (e.g. dotnet test --environment VERIFY_ACCEPT=true). When adding a sample test, the first record-mode run generates both the fixture and the baselines — review them before committing.
Key rules
- Parameterize over
TransportFormatwith[Theory]/[InlineData]unless the events are .NET-only (then[Fact]+ comment). Assert.Collectionfor event sequences — validates count, order, and properties together.- Assert on
u.RawRepresentationto inspect the underlying AG-UI event; emit helpers yieldChatResponseUpdate, notBaseEvent. CreateClientreturnsAGUIChatClient(notHttpClient); drive turns withCollectUpdates.- No agent classes — use
DelegatingStreamingChatClient+ inline handler; multi-turn uses aQueue<Func<...>>. - The pipeline wraps RunStarted/RunFinished — emit helpers don't produce lifecycle events.
- One test file per event category; name
{Category}IntegrationTest.cs. - Sample tests inherit
IntegrationTestBase<StepNN_Xyz.Server.Program>, useCreateCapturingClient(record/replay), and verify all 8 capture points viaVerifyCaptures. - Use current names: package
AGUI.Server, namespaceAGUI.Server.IntegrationTests, ASP.NET glue (AGUIResults,AddAGUI) fromAGUI.Samples.Shared.
Build & run
From sdks/dotnet/:
dotnet test tests/AGUI.Hosting.AspNetCore.IntegrationTests/Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

