feat: phase 9 — OllamaLlmClient with health probe and mockito test suite#8
Merged
feat: phase 9 — OllamaLlmClient with health probe and mockito test suite#8
Conversation
Implements Phase 9 of the LLM bridge milestone (M3):
- `OllamaLlmClient` behind the `ollama` feature flag using reqwest
- `POST /api/generate` for inference (non-streaming, stream:false)
- `GET /api/tags` health probe with graceful degradation matrix
- `HealthStatus::{Healthy, ModelMissing, UnexpectedStatus}` enum
- Model tag matching accepts both "llama3" and "llama3:latest" forms
- Per-request timeout via reqwest Client builder; 0 = no timeout
- `pub mod ollama` gated under `#[cfg(feature = "ollama")]` in lib.rs
- 18 inline unit tests covering wire type deserialization, serialization,
constructor, and HealthStatus (100% line coverage on ollama.rs)
- 25 mockito integration tests in tests/phase9_integration.rs covering
happy path, HTTP error paths, parse errors, health probe variants,
connection-refused degradation, and Phase 8+9 composer pipeline
- 2 live-daemon smoke tests marked `#[ignore]` for explicit opt-in
- `examples/phase9.rs` demonstrates graceful degradation without a daemon
CI results: 411 tests (2 ignored), 0 failures · 98.13% line coverage ·
`cargo fmt --check` and `cargo clippy --workspace --all-features -D warnings` clean
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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.
Implements Phase 9 of the LLM bridge milestone (M3):
OllamaLlmClientbehind theollamafeature flag using reqwestPOST /api/generatefor inference (non-streaming, stream:false)GET /api/tagshealth probe with graceful degradation matrixHealthStatus::{Healthy, ModelMissing, UnexpectedStatus}enumpub mod ollamagated under#[cfg(feature = "ollama")]in lib.rs#[ignore]for explicit opt-inexamples/phase9.rsdemonstrates graceful degradation without a daemonCI results: 411 tests (2 ignored), 0 failures · 98.13% line coverage ·
cargo fmt --checkandcargo clippy --workspace --all-features -D warningsclean