feat: AG-UI spec alignment + drift auto-remediation#149
Merged
Conversation
8d91f20 to
df7ee99
Compare
Add Interrupt, ResumeEntry, RunFinishedOutcome types from ag-ui PR #1569 (interrupt-aware run lifecycle). Add outcome to AGUIRunFinishedEvent, resume to AGUIRunAgentInput. Fix pre-existing gaps: Message.id and RunAgentInput.threadId/runId now required, ToolDefinition.description required, add metadata/encryptedValue/error fields. Add AGUIMessageRole union covering all 7 protocol roles.
Add 6 convenience builders: buildActivityDelta, buildToolCallChunk, buildRawEvent, buildCustomEvent, buildReasoningChunk, buildReasoningEncryptedValue. Update makeRunFinished for outcome/result. Harden writeAGUIEventStream: log all caught errors (not just TypeError/RangeError), preserve user-supplied timestamps. Fix buildCompositeResponse to omit RUN_FINISHED when inner events contain RUN_ERROR (protocol compliance). Reset regex lastIndex before test().
Recorder: handle SSE data: lines without space after colon per spec.
Serialize predicate fixtures as __NO_USER_MESSAGE__ sentinel instead of
producing catch-all {} on disk. Return actual HTTP status from proxy
(was always boolean). Mock: include JSON parse error detail in 400
response. Use returned status code in journal (was hardcoded 200).
Add all missing AG-UI event type exports to index.ts (reasoning, step, thinking, raw, custom, chunk + AGUIBuildOpts, matchesAGUIFixture, AGUIReasoningEncryptedValueSubtype, AGUIMessageRole). Wire agui-stub.ts into tsdown.config.ts entry array and package.json exports/typesVersions as ./agui subpath, matching ./a2a, ./mcp, ./vector pattern.
drift-report-collector: clone canonical ag-ui repo via fs.existsSync, run schema drift test, merge into single report; exit 1 if skipped. test-drift.yml: extract notify job, distinguish AG-UI vs HTTP drift; use jq for safe Slack JSON. fix-drift.yml: clone ag-ui, continue-on- error on autofix with success() guard on PR creation, fix Slack text. fix-drift.ts: correct agui-handler.ts references, add SDK type to prompt, flexible changelog title, ENOENT-specific catch, reorder badge checks, exit code 4 for no-changes, wrap version bump in try/catch. Update BUILDER_TO_SKILL_SECTION test coverage.
Fix skipIf to check both canonicalExists and aimockExists. Fix field regex for multi-arg Zod types (comma truncation). Add recursive resolveParentFields for multi-level inheritance. Strip comment lines before field matching. Parse base fields dynamically from canonical BaseEventSchema and aimock AGUIBaseEvent with hardcoded fallback.
df7ee99 to
1d7bc60
Compare
4 tasks
jpr5
added a commit
that referenced
this pull request
May 3, 2026
## Summary Pre-existing hardening items surfaced during CR on PR #149. - **agui-recorder.ts**: Log client write failures (was bare catch), add console.warn fallback for parseSSEEvents when no logger, forward upstream content-type on non-2xx instead of SSE headers - **agui-mock.ts**: Wrap readBody in try/catch (was unguarded await), default logger to "warn" instead of "silent" - **agui-types.ts**: Add `logLevel` option to AGUIMockOptions - **logger.ts**: Add "warn" log level with proper hierarchy (silent < warn < info < debug) - **cli.ts + types.ts**: Accept "warn" in LogLevel union and CLI validation ## Test plan - [x] 2682 tests pass - [x] Prettier clean - [x] ESLint clean - [x] tsc --noEmit clean
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.
Summary
outcometo RunFinishedEvent,resumeto RunAgentInput. Fix pre-existing gaps (Message.id required, encryptedValue/error fields, ToolDefinition.metadata, description required, RunAgentInput threadId/runId required). Add 6 missing builder functions.Test plan