fix(api): treat top_logprobs 0 as omit no-op on chat and Completions - #558
fix(api): treat top_logprobs 0 as omit no-op on chat and Completions#558seonghobae wants to merge 6 commits into
Conversation
… effort as omit
Buyer SDKs often send stream_options with only false flags, tool_choice:{},
and reasoning_effort:"" as optional defaults. Accept them as omit no-ops
while still fail-closing true stream_options flags without stream=true and
non-empty reasoning_effort. Tip honesty substrate re-ship; 849 unit pass.
SDK clients send user:null as an optional default. Treat null as omit on chat Completions, legacy Completions, Responses, embeddings, and batch embeddings. Empty/whitespace/non-string user still fail closed with invalid_user. Local full unit: 857 passed.
…l/response_format/endpoint as omit SDK clients and stringified optional controls may send empty or whitespace strings. Treat as omit no-ops on embeddings encoding_format, chat/Responses tool_choice and function_call, response_format, and batch embeddings endpoint. Non-empty unsupported values still fail closed. Local full unit: 865 passed.
SDK stringified empty controls for reasoning, Responses text, and include are treat-as-omit on chat Completions, legacy Completions, and Responses. Non-empty unsupported values still fail closed with named errors. Local full unit: 872 passed.
… as omit Legacy Completions has no tools surface. Treat SDK defaults tool_choice none/auto/empty-string/empty-object and function_call none/auto/empty-string as omit no-ops (parity with chat). Non-default controls and non-empty tools still fail closed with a chat migration path. Local full unit: 877 passed.
SDK clients may send top_logprobs:0 (no top alternatives). Treat 0 and null as omit on chat Completions and legacy Completions. Non-zero values still fail closed with invalid_top_logprobs. Local full unit: 881 passed.
|
Important Review skippedToo many files! This PR contains 122 files, which is 22 over the limit of 100. To get a review, reduce the PR to 100 files or fewer by splitting it into smaller PRs or changing its base branch. Upgrade to a paid plan to raise the limit. This review couldn't start because sufficient usage credits or metered capacity aren't available. Add credits or update usage-based reviews in the billing tab, then retry. ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (122)
You can disable this status message by setting the 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 |
Summary
top_logprobs: 0(and null) as omit no-ops on chat Completions and legacy Completions.top_logprobsstill fail closed withinvalid_top_logprobs.Test plan
pytest tests/test_top_logprobs_zero_omit_noop_http_honesty.py(+ related)pytest tests -q(881 passed)Product gates only: Full unit + Semgrep (Strix ignored). Independent non-author APPROVE still required.