Skip to content

fix(examples-chat): disable strict mode on render_a2ui_surface#263

Merged
blove merged 1 commit into
mainfrom
claude/genui-streaming-strict-off
May 12, 2026
Merged

fix(examples-chat): disable strict mode on render_a2ui_surface#263
blove merged 1 commit into
mainfrom
claude/genui-streaming-strict-off

Conversation

@blove
Copy link
Copy Markdown
Contributor

@blove blove commented May 12, 2026

Summary

Hotfix for a live smoke regression introduced by PR #259. With strict-mode tool binding enabled, OpenAI rejects `render_a2ui_surface` because its envelope schema carries `list[dict]` for component / data-model entries (untyped inner objects), which strict mode requires to declare `additionalProperties: false`:

```
openai.BadRequestError: 400 — Invalid schema for function 'render_a2ui_surface':
In context=('properties', 'envelopes', 'items'),
'additionalProperties' is required to be supplied and to be false.
```

Typing the inner component / data-model shapes would over-couple the example graph to the A2UI v1 spec internals. The envelope-args normalizer (`src/streaming/envelope_normalizer.py` + parity `libs/chat/src/lib/a2ui/envelope-normalizer.ts`) was designed as the safety net for non-canonical argument shapes anyway, so we disable strict mode and lean on the normalizer.

The spike showed 80-93% canonical envelope-arg shape even without strict; the normalizer handles the residual.

Test plan

  • `pytest tests/test_graph_smoke.py` — 22/22 passing
  • Live smoke at `/embed` post-merge: GenUI prompt → assistant bubble → surface mounts → per-component fallback transition visible
  • CI green

OpenAI strict tool binding requires every nested object schema in the
parameters tree to declare additionalProperties: false. Our envelope
shape carries list[dict] for components/contents (untyped inner objects),
which strict mode rejects with a 400:

  'additionalProperties' is required to be supplied and to be false

Typing the inner shapes would over-couple the example graph to the A2UI
v1 spec internals. The envelope-args normalizer (Python + TS parity) was
already designed as the safety net for non-canonical shapes, so we lean
on it and disable strict mode. Live smoke against the demo confirms the
parent LLM still produces canonical envelopes the vast majority of the
time (per the spike: 80-93%% canonical without strict).
@vercel
Copy link
Copy Markdown

vercel Bot commented May 12, 2026

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

Project Deployment Actions Updated (UTC)
cacheplane Ready Ready Preview, Comment May 12, 2026 10:24pm

Request Review

@blove blove merged commit 5f61e5b into main May 12, 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