You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 2baac5e
Browse filesBrowse the repository at this point in the historyBrowse files
authored
fix(api): add openAiStrictToolSchemas setting for OpenAI-compatible gateways (Zoo-Code-Org#1828)
* fix(api): add openAiStrictToolSchemas setting for OpenAI-compatible gateways
Some OpenAI-compatible gateways reject tool definitions with
strict: true (e.g. NInfer returns HTTP 400: "strict=true requires
generated function arguments to satisfy the declared JSON Schema").
Add the optional openAiStrictToolSchemas setting to the OpenAI
Compatible provider (default true, preserving current behavior).
When false, tools are sent with strict: false and the declared JSON
schema is passed through unchanged, matching the existing MCP tool
precedent.
Refs Zoo-Code-Org#1827
* fix(i18n): complete openAiStrictToolSchemas strings for all locales
* test(visual): update OpenAI Compatible baselines for strict tool schemas checkbox
* fix(api): clone tool schema properties before strict normalization
Strict conversion previously rewrote nullable types on the caller-owned property objects, so a tool array reused across a strict request and a later openAiStrictToolSchemas: false request would send the already-normalized schema. Clone each property before normalizing and add a regression test for nullable reuse. Also add request-path coverage for non-streaming and O3-family requests with the strict setting (CodeRabbit findings).
* chore: trigger CodeRabbit re-review / label reconcile
* Describe strict mode as optional for Chat Completions
Chat Completions does not require strict: true - strict mode is off unless the
function definition sets it. The description claimed it is required by OpenAI
and limited disabling to endpoints that reject strict schemas, which is not what
the setting does: it is a choice, and the default is strict.
Reworded all 18 locales to match the English wording.
* Regenerate the OpenAI visual snapshots for the reworded description
The provider settings story renders the description, so the committed snapshots
no longer match after the wording change. Regenerated with the visual docker
runner (the same image CI uses) so the baselines are not host-rendered.
* Fix grammatical agreement in the Russian description
нестрогое вызов -> нестрогий вызов: вызов is masculine, so the adjective must
agree.
* Fix Korean and Polish wording in the strict-schemas description
Korean: "스키마 준엄격 준수" is a garbled calque of "strict schema adherence";
it now reads as natural Korean ("스키마를 엄격하게 준수").
Polish: "niesurowego" means "not raw", not "non-strict"; corrected to
"nieścisłego", which matches the English "non-strict".
* Re-run CI after a flaky visual snapshot failure
The extension-host-visual job failed on the sidebar snapshot (1324 pixels) at
6c71575 while the same job passed at the previous head. The only change was
two locale strings, which the extension-host visual test does not render.
This empty commit re-runs the job.
* Cover the strict-schemas save round trip at the form layer
The component test only checked that the mocked setter received false,
so nothing proved the value reaches the persisted payload or comes back
from a loaded configuration. Add the round trip in SettingsView: a stored
false is restored instead of being replaced by the display default, a
change is buffered until Save, and Save carries the value through
upsertApiConfiguration. Saving an unrelated field must not materialise the
display default for a config that never stored the setting.
Co-Authored-By: Claude <[email protected]>
* test(openai): cover the strict flag on the O3-family streaming path
The streaming O3 branch builds its own request options, so the strict
argument was only asserted on the non-streaming path. Add the streaming case
with openAiStrictToolSchemas disabled: dropping the argument at the streaming
call now fails this test (verified by removing it and re-running).
* test(webview-ui): assert a toggled-on value reaches the upsert payload
The round-trip tests covered a stored value, persistence on Save, and the
unset case, but not the value the user sets during the session. Add the case
where the control is toggled on from a stored false and saved: the
upsertApiConfiguration payload must carry true.
* test(webview-ui): type the round-trip helpers instead of any
The round-trip tests introduced three any annotations. Use ProviderSettings
for the configuration, Pick<ApiOptionsProps, ...> for the mocked component
props, and keep the posted message as WebviewMessage so the payload access
stays typed.
* test(visual): regenerate the OpenAI Compatible baselines for the merged tree
The binary conflict against main could not be combined: Zoo-Code-Org#1847 changed the
sane-default values shown in this section (no max-token default, image support
off by default) and this PR adds the strict-tool-schemas checkbox. The
baselines here are the render of the merged tree, taken from the visual run
artifacts at this head, so they carry both changes.
---------
Co-authored-by: Eason Liang <[email protected]>
Co-authored-by: easonLiangWorldedtech <[email protected]>
Co-authored-by: Claude <[email protected]>
0 commit comments