[codex] Add relay OpenAI fallback for non-Claude models#17
Open
Ge-Shun wants to merge 1 commit into
Open
Conversation
e9e37fb to
1a0fcb7
Compare
Author
|
Updated the PR after real-machine testing: relay/openai now preserves upstream streaming for non-Claude models and converts OpenAI SSE chunks to Anthropic SSE. This avoids the 524 timeout seen when Claude Science sends the full 26-tool request to gpt-5.5. |
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
CSSWITCH_RELAY_MODEL.{base_url}/v1/chat/completionsand reuse the existing Anthropic-to-OpenAI bridge.{base_url}/v1/messagesrelay path.Why
Relay providers can expose GPT/OpenAI-compatible models in
/v1/models, but those models may reject Anthropic/v1/messagescalls with 403. This lets CSSwitch use those models through the provider's OpenAI-compatible chat completions endpoint while preserving existing Claude relay behavior.Validation
python3 -m py_compile proxy/csswitch_proxy.py proxy/dsml_shim.py proxy/qwen_proxy.py test/test_proxy_units.pypython3 test/test_proxy_units.pysh test/run_all.shwith local port access: Python/Node/main script suites passed; existingdoctorops script has one unrelated key-present assertion mismatch (CSSWITCH_KEY_PRESENTvsDEEPSEEK_API_KEYtest setup).