fix: honor LLM_BASE_URL / EMBEDDING_BASE_URL env-var overrides in bootstrap-local#17
Open
djravine wants to merge 2 commits into
Open
fix: honor LLM_BASE_URL / EMBEDDING_BASE_URL env-var overrides in bootstrap-local#17djravine wants to merge 2 commits into
djravine wants to merge 2 commits into
Conversation
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…p-local Fixes bradwmorris#16. `ensureEnvValue` writes its literal `value` argument without consulting `process.env`, so any env-var overrides set by upstream callers (notably `install.sh --llm-port` / `--embedding-port`) were silently discarded — `.env.local` always landed on the hardcoded `8080`/`8081` defaults regardless of what the user passed at install time. Wrap both `LLM_BASE_URL` and `EMBEDDING_BASE_URL` calls with `process.env.X || '<default>'` in the `qwen-local` and `llama-cpp` branches. The `openai` branch doesn't write base URLs (OpenAI's endpoint is the SDK default), so it needs no change. The `qwen-local` branch is updated for defensive symmetry — nothing sets those env vars at install time today, but mirroring the override pattern keeps the behaviour consistent across local-LLM profiles (future-proofs against e.g. pointing Ollama at a non-default host). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This was referenced May 26, 2026
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.
Closes #16.
Summary
scripts/dev/bootstrap-local.mjswrites hardcodedLLM_BASE_URL/EMBEDDING_BASE_URLvalues to.env.localregardless of anyprocess.envoverrides —ensureEnvValue(key, value)never consults the environment.This is a latent bug on
maintoday (nothing currently sets those env vars at install time), but the in-flight #15 (one-line install scripts) is about to surface it: its--llm-port/--embedding-portflags propagate into the reachability check but get silently overwritten downstream when bootstrap-local lands its hardcoded defaults.Change
Four lines in
bootstrap-local.mjs— wrap theLLM_BASE_URL/EMBEDDING_BASE_URLcalls in both theqwen-localandllama-cppbranches withprocess.env.X || '<default>':The
openaibranch needs no change — it doesn't write base URLs (OpenAI uses the SDK default).The
qwen-localbranch is updated for defensive symmetry. Nothing sets those env vars at install time today, but mirroring the override pattern future-proofs against e.g. pointing Ollama at a non-default host and keeps the behaviour consistent across local-LLM profiles.Verification
Ran end-to-end in a clean
ubuntu:24.04container against this branch's working tree:Sequence: apt bootstrap → nvm + Node 20 → rsync working tree →
npm install→LLM_BASE_URL=http://127.0.0.1:9090/v1 EMBEDDING_BASE_URL=http://127.0.0.1:9091/v1 npm run setup:local -- --profile llama-cpp→ grep.env.localfor the BASE_URL lines.Without the fix the same flow produces the hardcoded
8080/8081defaults — confirmed earlier when the bug was originally identified.Follow-up
Once this merges, the
llama-cpp-with-mock-serversscenario inscripts/install-tests/linux-edge-cases.sh(introduced by #15) can be extended to additionally assert that.env.localends up with the custom URLs — making it a full end-to-end regression guard for both the install.sh env-var passing and this bootstrap-local override path. The scenario currently ships with an inlineLIMITATION:comment pointing at #16 explaining the deferred assertion.🤖 Generated with Claude Code