Respect adapter endpoint routing in CLI stream retries#12516
Conversation
|
All contributors have signed the CLA ✍️ ✅ |
💡 Codex Reviewcontinue/gui/src/forms/AddModelForm.tsx Lines 75 to 77 in b3af874 If the user clicks the refresh icon and then switches providers before the request completes, this closure still compares against the provider value captured when the request started, so the condition is always true and the old provider's fetched models are inserted into the newly selected provider's model list. This can make the form offer models with the wrong continue/core/llm/fetchModels.ts Lines 180 to 181 in b3af874 When ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
|
I have read the CLA Document and I hereby sign the CLA Recheck |
Summary
Fixes #10474.
The CLI retry helper was routing Responses-capable model names directly to
llmApi.responsesStream()whenever that optional method existed. That bypassed the OpenAI adapter'sapiBaseguard, so OpenAI-compatible providers and proxies could be sent to/v1/responseseven when they only support/v1/chat/completions.This change keeps endpoint selection inside the adapter by having
chatCompletionStreamWithBackoff()delegate streaming calls to the requiredllmApi.chatCompletionStream()contract. The OpenAI adapter still uses the Responses API for official OpenAI endpoints when appropriate, but customapiBasevalues stay on the chat-completions path.Changes
responsesStream()routing branch.chatCompletionStream().responsesStream()directly.Verification
npm --prefix extensions/cli testnpm --prefix packages/openai-adapters test -- --runnpm --prefix extensions/cli run buildnpm --prefix extensions/cli run test:e2enpm --prefix extensions/cli run test:smokenpm --prefix extensions/cli run typecheckgit diff --checkI also ran two manual regression smokes:
apiBase, which hit/v1/chat/completionsonce and/v1/responseszero times;