Skip to content

feat: phase 9 — OllamaLlmClient with health probe and mockito test suite#8

Merged
macaris64 merged 1 commit intomainfrom
phase-9-ollama-client
Apr 18, 2026
Merged

feat: phase 9 — OllamaLlmClient with health probe and mockito test suite#8
macaris64 merged 1 commit intomainfrom
phase-9-ollama-client

Conversation

@macaris64
Copy link
Copy Markdown
Owner

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

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>
@macaris64 macaris64 merged commit f000ea9 into main Apr 18, 2026
4 checks passed
@macaris64 macaris64 deleted the phase-9-ollama-client branch April 18, 2026 21:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant