The GPT-5 auto-upgrade logic unconditionally overrode api_mode to codex_responses for any model starting with gpt-5, even when the user explicitly set api_mode=chat_completions. Custom proxies that serve GPT-5 via /chat/completions became unusable. Fix: check api_mode is None before the override fires. If the caller passed any explicit api_mode, it is final -- no auto-upgrade. Closes #10473
This commit is contained in:
@ -721,8 +721,11 @@ class AIAgent:
|
||||
# Responses there. ACP runtimes are excluded: CopilotACPClient
|
||||
# handles its own routing and does not implement the Responses API
|
||||
# surface.
|
||||
# When api_mode was explicitly provided, respect it — the user
|
||||
# knows what their endpoint supports (#10473).
|
||||
if (
|
||||
self.api_mode == "chat_completions"
|
||||
api_mode is None
|
||||
and self.api_mode == "chat_completions"
|
||||
and self.provider != "copilot-acp"
|
||||
and not str(self.base_url or "").lower().startswith("acp://copilot")
|
||||
and not str(self.base_url or "").lower().startswith("acp+tcp://")
|
||||
|
||||
Reference in New Issue
Block a user