Skip to content

fix(llm): delegate context_window() in SubProvider (#1473)#1498

Merged
bug-ops merged 2 commits intomainfrom
sub-provider-context-window
Mar 9, 2026
Merged

fix(llm): delegate context_window() in SubProvider (#1473)#1498
bug-ops merged 2 commits intomainfrom
sub-provider-context-window

Conversation

@bug-ops
Copy link
Owner

@bug-ops bug-ops commented Mar 9, 2026

Summary

SubProvider in crates/zeph-llm/src/orchestrator/router.rs implements LlmProvider but did not override context_window(). The default trait implementation returns None, which caused a silent chain failure: auto_budget_tokens() returned 0, context_manager.budget was set to None, and prepare_context() skipped all context enrichment — semantic recall, graph recall, summaries, and cross-session memories never ran when using the orchestrator provider.

Changes

  • Added context_window() delegation to impl LlmProvider for SubProvider
  • Added 4 unit tests covering Ollama, Claude, and OpenAi variants

Related

Test plan

  • cargo +nightly fmt --check passes
  • cargo clippy --workspace --features full -- -D warnings passes
  • cargo nextest run --config-file .github/nextest.toml --workspace --features full --lib --bins passes (4941/4941)
  • All 4 new sub_provider_context_window_* tests pass

@github-actions github-actions bot added bug Something isn't working size/M Medium PR (51-200 lines) documentation Improvements or additions to documentation llm zeph-llm crate (Ollama, Claude) rust Rust code changes and removed bug Something isn't working size/M Medium PR (51-200 lines) labels Mar 9, 2026
@github-actions github-actions bot added bug Something isn't working size/M Medium PR (51-200 lines) labels Mar 9, 2026
@bug-ops bug-ops merged commit c1643cd into main Mar 9, 2026
18 checks passed
@bug-ops bug-ops deleted the sub-provider-context-window branch March 9, 2026 22:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working documentation Improvements or additions to documentation llm zeph-llm crate (Ollama, Claude) rust Rust code changes size/M Medium PR (51-200 lines)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

SubProvider::context_window() returns None — breaks auto_budget and graph recall

1 participant