fix(chat-completions): normalize provider thinking aliases#424
Open
stemirkhan wants to merge 1 commit intoSoju06:mainfrom
Open
fix(chat-completions): normalize provider thinking aliases#424stemirkhan wants to merge 1 commit intoSoju06:mainfrom
stemirkhan wants to merge 1 commit intoSoju06:mainfrom
Conversation
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
thinking/enable_thinkingaliases into the canonicalreasoningpayloadWhy
Fixes #205.
Some OpenAI-compatible clients reuse provider-specific reasoning controls when switching their
base_urltocodex-lb. Those aliases were leaking through to the upstream ChatGPT backend unchanged, which caused avoidable upstream validation failures instead of a smooth compatibility path.This keeps the fix intentionally small:
enable_thinking: truemaps toreasoning.effort = "medium"thinkingpayloads are normalized to the same canonical shapereasoningstill wins over provider aliasesTesting
/home/temirkhan/codex-lb-my/codex-lb-upstream/.venv/bin/python -m pytest tests/unit/test_chat_request_mapping.py tests/unit/test_openai_requests.py tests/integration/test_openai_compat_features.py -qopenspec validate --specsNotes