fix: respect OLLAMA_HOST env var for remote Ollama servers#82
Merged
Rishabh4275 merged 4 commits intoMar 2, 2026
Merged
Conversation
…te hosts When OLLAMA_HOST is set to a remote server address, Cobolt would try to run `ollama serve` locally, which fails because it attempts to bind to the remote IP address. This caused a crash on startup. Changes: - Add resolveOllamaHost() that prioritizes OLLAMA_HOST env var over stored config, handling both bare host:port and full URL formats - Add isRemoteOllamaHost() to detect non-local addresses - Skip spawning `ollama serve` when pointing to a remote host - Show a clear error message if the remote server is unreachable Closes platinum-hill#77
rishabhvaish
requested review from
CoderHam,
Rishabh4275,
gauravagerwala and
pulkitjuneja
as code owners
February 22, 2026 09:11
The test CI has been broken since windows-latest migrated to Server 2025 (missing Windows SDK for node-gyp/sqlite3 native compilation) and npm run package attempted electron-builder signing without certs. Changes: - Pin Windows runner to windows-2022 which has the full VS + Windows SDK needed for native module compilation - Replace npm run package with npm run build (package runs electron-builder with signing/notarization which fails without certs and is unnecessary for CI test validation) - Bump actions/checkout, setup-node, setup-python to latest major versions (v3→v4, v4→v5) - Split test steps into separate named steps for easier debugging
Rishabh4275
reviewed
Feb 25, 2026
Adds back the package step with GH_TOKEN env var as requested in review. Replaces the standalone build step since npm run package already includes npm run build internally.
Reviewer requested keeping the original combined "Run tests" step. Consolidates the separate Package, Lint, Type check, and Run tests steps back into the original single step that runs all four commands. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Rishabh4275
approved these changes
Mar 2, 2026
Rishabh4275
enabled auto-merge (squash)
March 2, 2026 04:06
Rishabh4275
disabled auto-merge
March 2, 2026 04:07
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
OLLAMA_HOSTenv var is set to a remote server addressOLLAMA_HOST, uses it as the connection URL, and skips spawningollama servelocally when the host is remoteRoot Cause
When
OLLAMA_HOSTis set (e.g.,100.106.67.57:11434),ollama servetries to bind to that remote IP locally, which fails with:The existing code always tried to spawn
ollama servewhen the server wasn't reachable, without considering that the user may have configured a remote host.Changes
resolveOllamaHost()OLLAMA_HOSTenv var (supports bothhost:portand full URL formats), falls back to stored configisRemoteOllamaHost()localhost,127.0.0.1,::1,0.0.0.0)initOllama()ollama servespawn when remote, shows clear error if remote server is unreachableCloses #77
Test plan
OLLAMA_HOSTto a remote server that is running Ollama → Cobolt should connect without spawning local serverOLLAMA_HOSTto a remote server that is NOT running → Cobolt should show a clear error message about unreachable remote serverOLLAMA_HOST→ Cobolt should behave as before (start localollama serveif needed)OLLAMA_HOST=localhost:11434→ Should still spawn local server if not running (treated as local)🤖 Generated with Claude Code