[codex] align provider API endpoint contracts#70
Merged
Conversation
cafferychen777
commented
Jun 6, 2026
cafferychen777
left a comment
Owner
Author
There was a problem hiding this comment.
Full Code Review
Thoroughly reviewed all 28 changed files, ran all tests, and verified endpoint changes against current provider documentation.
Verified
- Qwen endpoint migration:
dashscope-us.aliyuncs.com/compatible-mode/v1/chat/completionsconfirmed as the current OpenAI-compatible US endpoint via official Alibaba Cloud documentation. DashScope region-specific keys + 3-endpoint fallback logic is correct. - MiniMax endpoint migration:
api.minimax.io/v1/chat/completionsconfirmed as the current endpoint via official MiniMax platform docs. Legacy.chatand.maxidomains superseded. - R refactoring: BaseAPIProcessor shared methods (
stop_for_http_error,post_chat_completions_request,extract_chat_completions_content,extract_error_message) faithfully reproduce original behavior while eliminating ~500 lines of duplication across 8 processors. - Input normalization:
trimws()/ case-insensitive matching at multiple entry points is defensive and correct. - URL validation: New
validate_base_url()properly rejects unsafe schemes, missing hostnames, userinfo, query strings, and fragments. - Endpoint probing: 401/403/404 now correctly trigger trying next endpoint (region-specific keys return these on wrong host).
- Heuristic JSON repair removal: Correct decision — regex repairs could corrupt valid JSON.
- Backward compatibility: Legacy Qwen
output.text/output.choicesand MiniMaxmessages[].textresponse formats retained as fallbacks.
Tests
- Python: 344 passed ✅
- R: 237 passed ✅
- ruff: clean ✅
LGTM — ready to merge.
cafferychen777
marked this pull request as ready for review
June 6, 2026 17:39
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.
What changed
Validation