Skip to content

Add client-to-server error reporting (#9)#19

Merged
23min merged 3 commits intomainfrom
feature/client-error-reporting
Feb 11, 2026
Merged

Add client-to-server error reporting (#9)#19
23min merged 3 commits intomainfrom
feature/client-error-reporting

Conversation

@23min
Copy link
Owner

@23min 23min commented Feb 11, 2026

Summary

  • A2UIClientError protocol type: New class with Code, SurfaceId, Message, Path? — matches v0.9 client_to_server.json error schema
  • A2UIClientMessage.Error: Envelope now supports mutually exclusive action OR error field (both use JsonIgnore(WhenWritingNull))
  • SendErrorAsync: New method on A2UIStreamClient — same pattern as SendActionAsync (POST envelope, process response stream, capabilities header)
  • Server-side receiving: IA2UIAgent.HandleErrorAsync default interface method (no-op); middleware routes error POSTs to it
  • Python parity: Both POST handlers accept error envelopes with empty response

This completes all v0.3.0 items (A2UI v0.9 Spec Compliance).

Test plan

  • ErrorEnvelope_Serializes_WithVersionAndError — envelope structure
  • ErrorEnvelope_OmitsAction_WhenOnlyErrorSet — mutual exclusivity
  • ErrorEnvelope_OmitsError_WhenOnlyActionSet — backwards compatibility
  • ErrorEnvelope_IncludesPath_WhenProvided — VALIDATION_FAILED with path
  • ErrorEnvelope_OmitsPath_WhenNull — generic error omits path
  • ErrorEnvelope_HasExactlyTwoTopLevelProperties — version + error only
  • SendErrorAsync_SendsV09ErrorEnvelope — end-to-end POST
  • SendErrorAsync_IncludesCapabilitiesHeader — header present
  • SendErrorAsync_IncludesPath_ForValidationError — path in body
  • SendErrorAsync_OmitsPath_WhenNull — no path in body
  • SendErrorAsync_ProcessesResponseStream — dispatches server response
  • StreamClient_SendErrorAsync_NetworkError_Throws — error propagation
  • StreamClient_SendErrorAsync_ServerError_Throws — 5xx propagation
  • 214/214 tests pass, 0 warnings

🤖 Generated with Claude Code

23min and others added 3 commits February 11, 2026 14:33
Enable clients to report errors back to the server using the
mutually exclusive error field on the v0.9 message envelope.
Completes v0.3.0 spec compliance milestone.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Error demo agent (/agents/error-demo) with unknown component
  fallback UI and server-side error reporting round-trip
- Demo pages in both WASM and Server sample apps with nav links
- Python server parity for error demo endpoint
- ComponentRegistry warns only once per unknown type (HashSet)
- A2UIComponentRenderer warns only once per component instance
- Fix ObjectDisposedException in A2UIStreamClient.Dispose() when
  CancellationTokenSource was already disposed during circuit teardown

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@23min 23min merged commit 7c605b7 into main Feb 11, 2026
2 checks passed
@23min 23min deleted the feature/client-error-reporting branch February 11, 2026 21:18
@23min 23min mentioned this pull request Feb 11, 2026
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant