fix(copilot-acp): keep acp runtime off responses path

This commit is contained in:
helix4u 2026-04-12 18:47:14 -06:00 committed by Teknium
parent 063244bb16
commit 8680f61f8b
4 changed files with 110 additions and 7 deletions

View file

@ -705,13 +705,19 @@ class AIAgent:
except Exception:
pass
# GPT-5.x models require the Responses API path — they are rejected
# on /v1/chat/completions by both OpenAI and OpenRouter. Also
# auto-upgrade for direct OpenAI URLs (api.openai.com) since all
# GPT-5.x models often require the Responses API path — they are
# rejected on /v1/chat/completions by both OpenAI and OpenRouter.
# Also auto-upgrade for direct OpenAI URLs (api.openai.com) since
# newer tool-calling models prefer Responses there.
if self.api_mode == "chat_completions" and (
self._is_direct_openai_url()
or self._model_requires_responses_api(self.model)
if (
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://")
and (
self._is_direct_openai_url()
or self._model_requires_responses_api(self.model)
)
):
self.api_mode = "codex_responses"