fix(examples-chat): disable strict mode on render_a2ui_surface#263
Merged
Conversation
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).
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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
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