Skip to content

test(examples-chat): regression coverage for GenUI emit coalescing (PR C)#299

Merged
blove merged 2 commits into
mainfrom
claude/genui-backend-coalescing
May 13, 2026
Merged

test(examples-chat): regression coverage for GenUI emit coalescing (PR C)#299
blove merged 2 commits into
mainfrom
claude/genui-backend-coalescing

Conversation

@blove
Copy link
Copy Markdown
Contributor

@blove blove commented May 13, 2026

Summary

Phase C of the progressive GenUI rendering redesign. Locks in the GenUI emit-node invariants with pytest. The backend coalescing + envelope reorder code already shipped in #255; this PR adds explicit regression coverage for both invariants.

  • `emit_generated_surface` returns 2 replacements: a `ToolMessage` keeping the upstream id + `tool_call_id`, and an `AIMessage` keeping the upstream tool-call AI's id. Post-merge thread is 3 messages, not 4.
  • The `AIMessage` replacement preserves `tool_calls`, `additional_kwargs`, and `response_metadata` from the upstream tool-call AI.
  • The wrapped JSONL envelopes are ordered `surfaceUpdate → beginRendering → dataModelUpdate × N` so the frontend surface store can materialize a surface (and reveal per-component fallbacks) before the bulk of data updates arrive.

Spec: `docs/superpowers/specs/2026-05-11-progressive-genui-bubble-coalescing-design.md`
Plan: `docs/superpowers/plans/2026-05-11-progressive-genui-bubble-coalescing.md`

Test plan

  • `cd examples/chat/python && python -m pytest tests/test_graph_smoke.py -v` — 25 passed (3 new in `TestEmitInPlaceCoalescing`)

blove and others added 2 commits May 13, 2026 09:56
…de wiring)

Three independent PRs per spec's phasing (order A → B → C):
- PR A — Surface store + catalog shape (lib only) [this branch]
- PR B — <a2ui-surface> per-component rendering (lib only)
- PR C — Backend coalescing + envelope reordering (Python only)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Asserts emit_generated_surface returns 2 replacements (3-message
thread post-merge, not 4), preserves the upstream tool-call AI's
id, tool_calls, additional_kwargs, response_metadata, and orders
the wrapped envelopes surfaceUpdate -> beginRendering -> dataModelUpdate.
@vercel
Copy link
Copy Markdown

vercel Bot commented May 13, 2026

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

Project Deployment Actions Updated (UTC)
cacheplane Ready Ready Preview, Comment May 13, 2026 5:11pm

Request Review

@blove blove merged commit ca0211b into main May 13, 2026
14 checks passed
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