Skip to content

feat: AG-UI spec alignment + drift auto-remediation#149

Merged
jpr5 merged 6 commits intomainfrom
blitz/agui-drift-align/integration
May 3, 2026
Merged

feat: AG-UI spec alignment + drift auto-remediation#149
jpr5 merged 6 commits intomainfrom
blitz/agui-drift-align/integration

Conversation

@jpr5
Copy link
Copy Markdown
Contributor

@jpr5 jpr5 commented May 3, 2026

Summary

  • AG-UI type alignment: Add Interrupt, ResumeEntry, RunFinishedOutcome types from ag-ui PR #1569 (interrupt-aware run lifecycle). Add outcome to RunFinishedEvent, resume to RunAgentInput. Fix pre-existing gaps (Message.id required, encryptedValue/error fields, ToolDefinition.metadata, description required, RunAgentInput threadId/runId required). Add 6 missing builder functions.
  • Drift auto-remediation: drift-report-collector now covers AG-UI schema drift alongside HTTP API drift. Slack notifications properly distinguish AG-UI schema vs HTTP API drift vs infra errors. fix-drift.yml triggers remediation on AG-UI schema drift.

Test plan

  • 2612 tests pass, 36 skipped
  • Prettier clean
  • ESLint clean
  • AG-UI schema drift test passes against canonical source

@jpr5 jpr5 force-pushed the blitz/agui-drift-align/integration branch 3 times, most recently from 8d91f20 to df7ee99 Compare May 3, 2026 19:15
jpr5 added 6 commits May 3, 2026 12:21
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.
@jpr5 jpr5 force-pushed the blitz/agui-drift-align/integration branch from df7ee99 to 1d7bc60 Compare May 3, 2026 19:21
@jpr5 jpr5 merged commit 6d3443e into main May 3, 2026
23 checks passed
@jpr5 jpr5 deleted the blitz/agui-drift-align/integration branch May 3, 2026 19:22
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
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