Repository navigation
Commit 37cd730
fix(chat): keep the structured-output opt-out exact on the native chat wire
`noStructuredOutputModels` is documented, in every locale, as "Exact model IDs
whose `openai-chat` endpoint rejects `response_format`. Only an exact
requested-model match omits the field; structured-output translation stays
enabled for every other `openai-chat` model." The Responses ingress enforces
that, and tests/openai-chat-hardening.test.ts already pins a `:tag` sibling
keeping the field there.
The native Chat passthrough added in #1467 matched through `modelInList`
instead, which also matches the pre-colon prefix. On a provider that serves
Ollama-style tags -- ollama-cloud ships `gpt-oss:120b`, `qwen3-coder:480b`,
`qwen3.5:397b`, `gemma4:31b` -- a `noStructuredOutputModels: ["gpt-oss"]`
entry therefore stripped `response_format` from `gpt-oss:120b` on
/v1/chat/completions while /v1/responses kept it. The caller asked for JSON
and silently got prose, on a model the operator never opted out.
That is the failure #1424 called out when it chose the exact boundary:
a wider match "would silently return prose for siblings that support JSON
Schema". The sibling gates on the lines above keep `modelInList` --
`noVisionModels` is documented as tolerating an Ollama `:size` tag, this one
is not -- so the comment now says why this gate differs.
Four tests, next to the existing Responses-side assertions so the two
ingresses read as a pair: exact id opts out, a `:tag` sibling does not, the
full `:tag` id does when listed, and an unrelated model is untouched. The
`:tag` sibling case fails on current dev.
Co-Authored-By: Claude Opus 5 <[email protected]>1 parent 69650fa commit 37cd730
2 files changed
Lines changed: 38 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
116 | 116 | | |
117 | 117 | | |
118 | 118 | | |
119 | | - | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
120 | 124 | | |
121 | 125 | | |
122 | 126 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
| 2 | + | |
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| |||
792 | 792 | | |
793 | 793 | | |
794 | 794 | | |
| 795 | + | |
| 796 | + | |
| 797 | + | |
| 798 | + | |
| 799 | + | |
| 800 | + | |
| 801 | + | |
| 802 | + | |
| 803 | + | |
| 804 | + | |
| 805 | + | |
| 806 | + | |
| 807 | + | |
| 808 | + | |
| 809 | + | |
| 810 | + | |
| 811 | + | |
| 812 | + | |
| 813 | + | |
| 814 | + | |
| 815 | + | |
| 816 | + | |
| 817 | + | |
| 818 | + | |
| 819 | + | |
| 820 | + | |
| 821 | + | |
| 822 | + | |
| 823 | + | |
| 824 | + | |
| 825 | + | |
| 826 | + | |
795 | 827 | | |
0 commit comments