fix: add per-model structured output opt-out - #1424
Conversation
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
✅ Deterministic PR hygiene checks passed. |
Wibias
left a comment
There was a problem hiding this comment.
Request changes based on a full review of the current head.
Merge blockers / required fixes:
-
noStructuredOutputModelsis documented and implemented as an exact per-model escape hatch, but the adapter usesmodelInList(). That helper intentionally family-matches colon-tagged variants (fooalso matchesfoo:variant). This can disableresponse_formatfor sibling/variant models that were not explicitly listed, which breaks the mixed-capability-gateway contract this PR is introducing. Use exact equality for this field (for examplelist.includes(parsed.modelId)) or a dedicated exact-match helper, and add a negative regression provingfoodoes not matchfoo:structured. -
Persisted
config.jsonand Management API PATCH normalize this field differently. PATCH trims and deduplicates entries, but schema/config loading only verifies thatentry.trim()is nonblank and preserves the original string. A manually persisted value such as" deepseek-v4-flash "is accepted but will not match the runtime model id. Normalize trim/dedupe at the config boundary so every management surface has identical semantics.
I did not find a security vulnerability in this PR, but the first issue is a direct contract violation and should be fixed before merge. After fixes, refresh onto current dev and rerun exact-head CI.
Summary
response_formattranslation as the default for routedopenai-chatmodels.noStructuredOutputModels, so only exact listed model ids omit the field.Closes #1415
Verification
nice -n 10 taskset -c 0-1 bun test tests/openai-chat-hardening.test.ts tests/chat-completions-endpoint.test.ts tests/management-provider-validation.test.ts— 138 pass, 0 fail.nice -n 10 taskset -c 0-1 bun run typecheck— passed.nice -n 10 taskset -c 0-1 bun run privacy:scan— passed.cd docs-site && bun install --frozen-lockfile && bun run build— passed, 221 pages built.nice -n 10 taskset -c 0-1 bun run test— 10,680 pass, 10 skip, 1 unrelated baseline failure inCodex autostart shim > Unix shim exports persisted service API token before running Codex.9c051342d7ff7ad81b71911e359ad5935eaaf235(34 pass, 1 fail intests/codex-shim.test.ts); this patch does not modify that subsystem.9c88233a37a99e0eb93dc1555dc2d522761f3184.Checklist