From eaa2e320d911ce46704e55e18f5993e3e7ced408 Mon Sep 17 00:00:00 2001 From: bellman Date: Fri, 5 Jun 2026 12:27:08 +0900 Subject: [PATCH] =?UTF-8?q?docs:=20add=20ROADMAP=20#833=20=E2=80=94=20nati?= =?UTF-8?q?ve=20Ollama=20provider=20support=20via=20OLLAMA=5FHOST?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ROADMAP.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ROADMAP.md b/ROADMAP.md index 24ed7985..fe4c3a7d 100644 --- a/ROADMAP.md +++ b/ROADMAP.md @@ -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.