[codex] fix: improve local LM Studio connection errors#12013
[codex] fix: improve local LM Studio connection errors#12013yzlu0917 wants to merge 1 commit intocontinuedev:mainfrom
Conversation
💡 Codex Reviewcontinue/core/llm/llms/Ollama.ts Line 514 in 3ecc016 This change now attaches The proxy guidance prompt is now gated by ℹ️ 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". |
Summary
apiBasefromlocalhostto127.0.0.1in both core and openai-adaptersBaseLLM.fetch()for refused local connectionsllm/streamChatreturns friendly connection errors instead of a genericConnection error.messageWhy
Continuealready had provider-specific connection guidance for local Ollama and Lemonade setups, but LM Studio users still often saw a genericConnection error.. That was made worse by two additional issues: LM Studio still defaulted tolocalhost, which can hit IPv6 loopback resolution problems on some systems, and the VS CodestreamChatpath returned before its friendlier error mapping ran.This change makes local LM Studio setup more reliable by default and surfaces actionable errors when the local server is unavailable.
Validation
npm run vitest -- llm/index.fetch.vitest.ts llm/llms/OpenAI-compatible.vitest.ts llm/llms/OpenAI-compatible-core.vitest.tsincorenpm test -- src/test/main.test.tsinpackages/openai-adaptersvitestagainstextensions/vscode/src/webviewProtocol.vitest.tsusing the repository's existing core vitest installCloses #11818
Summary by cubic
Improves LM Studio local connection reliability and error clarity. Addresses #11818 by defaulting to 127.0.0.1 and surfacing friendly ECONNREFUSED messages in core and the VS Code webview.
apiBasetohttp://127.0.0.1:1234/in core andpackages/openai-adapters.127.0.0.1/localhostto a specific LM Studio message inBaseLLM.fetch().llm/streamChatvia centralized message mapping.Written for commit 3ecc016. Summary will update on new commits.