Skip to content

feat(ag-ui): preserve streamed messages through snapshot reconciliation - #1166

Merged
blove merged 2 commits into
mainfrom
codex/ag-ui-message-observation
Sep 24, 2026
Merged

blove merged 2 commits into
mainfrom
codex/ag-ui-message-observation

Conversation

@blove

@blove blove commented Sep 24, 2026

Copy link
Copy Markdown
Contributor

AG-UI's private runtime can own protocol data but cannot yet accumulate streaming messages and reconcile an authoritative snapshot without losing omitted reasoning or corrected message fields.

Add two pure, private transformations: six normalized text/reasoning events build owned message records, and snapshots replace matching IDs while preserving established positions and event-only reasoning/activity when their role is omitted. Changed records capture complete portable data; unchanged records retain references. Metadata-only chunks are applied, incoming metadata is owned before the SDK's shallow merge, and invalid or duplicate targets fail atomically. A removed open target cannot silently receive later content or turn a callback failure into success.

Validation:

  • 160 private runtime tests, including 50 new unit and four actual HTTP cases; 498 existing legacy AG-UI tests. Semantic negative controls reproduce lost reasoning, stale snapshot records, missing streamed text and metadata, and invalid-target behavior.
  • Real HTTP covers incremental SDK CHUNK normalization, authoritative reconciliation, exact subsequent request bodies and physical closure after success or callback rejection.
  • Runtime/public types, lint (zero errors; 317 existing warnings), build, inventory, source boundaries, version consistency and diff checks passed. Both transformations passed fresh independent compliance and quality reviews; parent independently reran the combined runtime/types checks.
  • Independent Chromium, Chrome MCP and in-app browser proof: 12 snapshot-flow requests and nine incremental-message requests; every body verified, every connection closed, clean consoles and immutable prior observations.
  • Recorded deterministic Python-provider text/reasoning traces match the locked SDK after neutral accumulation and reconciliation. A separate tool trace comparison swaps only snapshot reconciliation; SDK streaming still handles tools in that comparison.

Snapshot replacement preserves retained positions rather than promising backend reorder; an empty snapshot preserves event-only roles. This does not expose a public session, implement tool execution or establish full AG-UI/React parity. Caller admission, child routing, state and other protocol families remain separate work. No dependency, public export, argument-schema, release or publication changes.

@vercel

vercel Bot commented Sep 24, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
threadplane Ready Ready Preview Sep 24, 2026 11:28pm UTC

Request Review

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Automated approval: this PR received an intelligent (AI) code review. See the review comments on this PR.

@github-actions

github-actions Bot commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @blove's task in 0s —— View job


I'll analyze this and get back to you.

@blove
blove enabled auto-merge (squash) September 24, 2026 23:24
@blove
blove merged commit aa188a7 into main Sep 24, 2026
77 of 78 checks passed

This branch was successfully deployed

1 active deployment
Preview – threadplane — f21094c8 Deployed Sep 24, 2026 by vercel[bot]
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