mirror of
https://github.com/ultraworkers/claw-code.git
synced 2026-06-05 17:26:10 +08:00
docs: add ROADMAP #833 — native Ollama provider support via OLLAMA_HOST
This commit is contained in:
@ -8011,3 +8011,6 @@ Original filing (2026-04-18): the session emitted `SessionStart hook (completed)
|
||||
**Fix applied.** Added `test_roadmap_next_id_fails_when_explicit_roadmap_path_is_missing`, proving an explicit missing ROADMAP path exits nonzero, keeps stdout empty, and reports both `ROADMAP not found` and the requested path on stderr. Added `tests/__init__.py` so `python3 -m unittest tests.test_roadmap_helpers` resolves this repository's tests package consistently.
|
||||
|
||||
**Verification.** `python3 -m unittest tests.test_roadmap_helpers`; `scripts/roadmap-check-ids.sh`; `scripts/roadmap-next-id.sh`.
|
||||
833. **DONE — Native Ollama provider support via `OLLAMA_HOST` env var** — PR #3213 showed the routing gap: local model names like `qwen3:8b` don't match any provider prefix and `OPENAI_BASE_URL` was the only workaround. Ollama users had to set two env vars (`OPENAI_BASE_URL` + `OPENAI_API_KEY`) and unset Anthropic vars. Fix: (1) `OLLAMA_HOST` env var takes priority over all other routing; when set, all models route to the local OpenAI-compatible endpoint; (2) no API key required — placeholder token used for Authorization header; (3) model names with colons/dots bypass strict `provider/model` syntax validation when `OLLAMA_HOST` is set; (4) `detect_provider_kind()` checks `OLLAMA_HOST` first in the routing cascade; (5) `ProviderClient` dispatch uses `from_ollama_env()` when `OLLAMA_HOST` is set; (6) `OLLAMA_CONFIG` constant added to `openai_compat.rs`; (7) `from_ollama_env()` method constructs client from env with no auth requirement; (8) updated `USAGE.md` and `docs/local-openai-compatible-providers.md` to recommend `OLLAMA_HOST` as the preferred env var; (9) added `test_ollama_host_bypasses_model_validation` unit test. Supersedes PR #3213 (which had a duplicate `if let` bug in `mod.rs`). [SCOPE: claw-code]
|
||||
|
||||
**Verification.** `cargo fmt --manifest-path rust/Cargo.toml --all -- --check`; `cargo test --manifest-path rust/Cargo.toml -p api -p rusty-claude-cli --bin claw`; `cargo test --manifest-path rust/Cargo.toml -p rusty-claude-cli --test output_format_contract`; dogfooded against mock OpenAI-compatible server with `OLLAMA_HOST=http://127.0.0.1:11434` — `claw --model "qwen3:8b" prompt "Reply exactly: HELLO_WORLD_123"` returned expected output; `claw --output-format json --model "qwen3:8b" prompt "test"` returned parseable JSON; `claw --output-format json doctor` returned `status: warn` (expected, no Anthropic creds); `claw --output-format json --model "qwen3:8b" status` returned `status: ok, model: qwen3:8b`; empty model still rejected with typed error.
|
||||
|
||||
Reference in New Issue
Block a user