Problem
When running WebBrain as a browser extension against Ollama on localhost, LLM calls fail with 403 unless Ollama is started with extension origins allowed:
OLLAMA_ORIGINS="*" ollama serve
# or tighter:
OLLAMA_ORIGINS="chrome-extension://*,moz-extension://*" ollama serve
This is not a WebBrain planner bug — the browser sends Origin: chrome-extension://<id> (or moz-extension://…), which recent Ollama versions reject by default. Related: #33.
What breaks locally without this
- Manual extension testing with Ollama (Act mode, planner gate, etc.)
- New E2E verifier for planner v1 (
test/planner-verify.mjs, npm run test:planner) — planner gate never emits plan_review because the planning LLM call 403s first
npm run test:anonymous and node scripts/dev.mjs when Ollama is the configured provider
curl / terminal probes to http://localhost:11434 still work — only extension-origin requests are blocked.
Docs gap
- README only says
ollama serve + set base URL — no OLLAMA_ORIGINS mention (README.md ~line 69).
- Website FAQ says localhost usually doesn't need CORS — true for normal web pages, misleading for extensions (extension origin ≠
http://localhost).
test/README.md documents test:anonymous but not test:planner or the Ollama prerequisite for any extension E2E run.
- Code already surfaces a helpful 403 hint in
src/chrome/src/providers/openai.js — but users hit it before reading docs.
Context
Discovered while validating planner v1 for #165 (PR #178). Unit tests pass (npm test — planner parse/format). Full headed E2E blocked until Ollama allows extension origins.
Proposed fixes
Workaround (today)
Quit Ollama app if it holds port 11434, then:
OLLAMA_ORIGINS="*" ollama serve
npm run test:planner # or node scripts/dev.mjs for manual testing
Environment
- macOS, Ollama desktop app default install
- Chrome MV3 extension (unpacked
src/chrome/)
- Ollama OpenAI-compatible endpoint
http://localhost:11434/v1
Problem
When running WebBrain as a browser extension against Ollama on localhost, LLM calls fail with 403 unless Ollama is started with extension origins allowed:
This is not a WebBrain planner bug — the browser sends
Origin: chrome-extension://<id>(ormoz-extension://…), which recent Ollama versions reject by default. Related: #33.What breaks locally without this
test/planner-verify.mjs,npm run test:planner) — planner gate never emitsplan_reviewbecause the planning LLM call 403s firstnpm run test:anonymousandnode scripts/dev.mjswhen Ollama is the configured providercurl/ terminal probes tohttp://localhost:11434still work — only extension-origin requests are blocked.Docs gap
ollama serve+ set base URL — noOLLAMA_ORIGINSmention (README.md ~line 69).http://localhost).test/README.mddocumentstest:anonymousbut nottest:planneror the Ollama prerequisite for any extension E2E run.src/chrome/src/providers/openai.js— but users hit it before reading docs.Context
Discovered while validating planner v1 for #165 (PR #178). Unit tests pass (
npm test— planner parse/format). Full headed E2E blocked until Ollama allows extension origins.Proposed fixes
OLLAMA_ORIGINSto the Ollama quick-start block (Chrome + Firefox READMEs too)test/README.md: documentnpm run test:planner, headed Chromium requirement, andOLLAMA_ORIGINSprerequisiteOLLAMA_ORIGINSeven when Ollama runs on the same machine as the browserscripts/dev.mjs/ test runners print a one-line warning if a probe withOrigin: chrome-extension://testgets 403 from configured Ollama URLWorkaround (today)
Quit Ollama app if it holds port 11434, then:
Environment
src/chrome/)http://localhost:11434/v1