feat(dart): decode REASONING_* events, ACTIVITY_DELTA, and ActivityMessage#1684
Open
WilliamKarolDiCioccio wants to merge 5 commits into
Conversation
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).
…vitySnapshotEvent
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 %.
|
@91jaeminjo is attempting to deploy a commit to the CopilotKit Team on Vercel. A member of the Team first needs to authorize it. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on
Depends on #1683 for
EventType.activitySnapshotbeing 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, multimodalUserMessagecontent) are silently passed through, not added to the typed model.Protocol additions
REASONING_*events:Start,End,MessageStart/MessageContent/MessageEnd,MessageChunk, andEncryptedValue(with the tool-call / message subtype enum).ACTIVITY_DELTAevent — JSON-Patch over activity state, with non-empty delta validation.ActivityMessagerole — included inMESSAGES_SNAPSHOTreplays.Field names, required/optional markers, and subtype enum values were verified against the Python
ag_uipydantic models (camelCase wire format with snake_case fallback preserved by the SDK's existing decoder).Test plan
dart testundersdks/community/dart/— 445 / 445 passing (+21 new tests covering round-trip serialization,BaseEvent.fromJsondispatch for all 7REASONING_*event types, non-empty delta validation, subtype enum parsing including invalid values,copyWithfor every new event class andActivityMessage, andReasoningMessageChunkEventoptional-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_typeon test literals).events.dart91.8 %,message.dart100 %.