mirror of
https://github.com/HKUDS/DeepTutor.git
synced 2026-12-06 12:00:36 +08:00
fix: require explicit OpenAI Codex selection
Stop generic OpenAI-compatible endpoints whose hostname contains codex from being routed through the OAuth-only backend. Add a provider-registry regression test.
This commit is contained in:
@@ -236,7 +236,6 @@ PROVIDERS: tuple[ProviderSpec, ...] = (
|
||||
env_key="",
|
||||
display_name="OpenAI Codex",
|
||||
backend="openai_codex",
|
||||
detect_by_base_keyword="codex",
|
||||
is_oauth=True,
|
||||
default_api_base="https://chatgpt.com/backend-api",
|
||||
),
|
||||
|
||||
@@ -8,3 +8,7 @@ def test_nvidia_nim_gateway_detection_by_key_and_base() -> None:
|
||||
assert spec.supports_stream_options is False
|
||||
assert find_gateway(api_key="nvapi-test-key") == spec
|
||||
assert find_gateway(api_base="https://integrate.api.nvidia.com/v1") == spec
|
||||
|
||||
|
||||
def test_openai_codex_is_not_detected_from_api_base() -> None:
|
||||
assert find_gateway(api_base="https://codex.example.com/v1") is None
|
||||
|
||||
Reference in New Issue
Block a user