Skip to content

feat(dart): decode REASONING_* events, ACTIVITY_DELTA, and ActivityMessage#1684

Open
WilliamKarolDiCioccio wants to merge 5 commits into
ag-ui-protocol:mainfrom
WilliamKarolDiCioccio:contrib/dart-reasoning-and-activity-delta
Open

feat(dart): decode REASONING_* events, ACTIVITY_DELTA, and ActivityMessage#1684
WilliamKarolDiCioccio wants to merge 5 commits into
ag-ui-protocol:mainfrom
WilliamKarolDiCioccio:contrib/dart-reasoning-and-activity-delta

Conversation

@WilliamKarolDiCioccio
Copy link
Copy Markdown

Stacked on

Depends on #1683 for EventType.activitySnapshot being registered. Please merge #1683 first; once that lands the diff here will narrow to just the additions described below.

Summary

Minimum-viable update so the Dart client can decode every AG-UI event type and message role currently in the spec. Scoped to crash-prevention — fields not yet consumed by Dart consumers (e.g. encryptedValue, parentRunId, multimodal UserMessage content) are silently passed through, not added to the typed model.

Protocol additions

  • 7 REASONING_* events: Start, End, MessageStart / MessageContent / MessageEnd, MessageChunk, and EncryptedValue (with the tool-call / message subtype enum).
  • ACTIVITY_DELTA event — JSON-Patch over activity state, with non-empty delta validation.
  • ActivityMessage role — included in MESSAGES_SNAPSHOT replays.

Field names, required/optional markers, and subtype enum values were verified against the Python ag_ui pydantic models (camelCase wire format with snake_case fallback preserved by the SDK's existing decoder).

Test plan

  • dart test under sdks/community/dart/445 / 445 passing (+21 new tests covering round-trip serialization, BaseEvent.fromJson dispatch for all 7 REASONING_* event types, non-empty delta validation, subtype enum parsing including invalid values, copyWith for every new event class and ActivityMessage, and ReasoningMessageChunkEvent optional-field omission).
  • dart analyze — no new errors; 18 new info-level lints in test files (consistent with existing patterns: inference_failure_on_collection_literal / strict_raw_type on test literals).
  • Event-type enum count test bumped 26 → 34 to match the additions.
  • Line coverage on added executable lines: 92.7 % (177 / 191) — events.dart 91.8 %, message.dart 100 %.

alan runyan and others added 5 commits May 13, 2026 14:35
Based on Flutter's .gitignore, scoped to Dart package concerns.
Replace activities field with AG-UI spec fields: messageId, activityType,
content, replace. All required fields validated via requireField.
Fix pre-existing event type count test (25 -> 26).
Minimum-viable update to the Dart SDK so the client can decode every AG-UI
event type and message role the Soliplex backend emits today. Scoped to
crash-prevention only — silent-drop fields (encryptedValue, parentRunId,
multimodal UserMessage content, etc.) are tracked in soliplex/frontend#117.

Protocol additions:
- 7 REASONING_* events (Start, End, MessageStart/Content/End/Chunk,
  EncryptedValue with tool-call/message subtype)
- ACTIVITY_DELTA event (JSON-Patch over activity state)
- ActivityMessage role — included in MESSAGES_SNAPSHOT replays

Field names, required/optional markers, and subtype enum values verified
against the backend's ag_ui pydantic models (alias_generator=to_camel,
populate_by_name=True — both wire directions continue to work with HEAD's
existing snake_case fallbacks).

Tests: +21 covering round-trip serialization, BaseEvent.fromJson dispatch
for all 7 REASONING_* event types, non-empty delta validation, subtype
enum parsing (including invalid values), copyWith for every new event
class and ActivityMessage, and ReasoningMessageChunkEvent optional-field
omission. 445 tests pass. Line coverage on the additions: events.dart
91.8 %, message.dart 100 %.
@vercel
Copy link
Copy Markdown

vercel Bot commented May 14, 2026

@91jaeminjo is attempting to deploy a commit to the CopilotKit Team on Vercel.

A member of the Team first needs to authorize it.

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.

2 participants