fix(agent): restore skill matching and context population on TUI queries#1017
Merged
fix(agent): restore skill matching and context population on TUI queries#1017
Conversation
Two independent bugs caused skills and context to be absent when queries were entered through the TUI dashboard: 1. Skill matching fallback: when QdrantSkillMatcher returns an empty result set (embed error or Qdrant unavailable), rebuild_system_prompt now falls back to all registered skills instead of producing an empty active-skill list, keeping the agent functional. 2. Orchestrator context window detection: build_provider only handled AnyProvider::Ollama; ModelOrchestrator was never interrogated for a context window size. Add auto_detect_context_window to SubProvider and ModelOrchestrator and call it from build_provider so that auto_budget_tokens returns a non-zero value and prepare_context can inject semantic recall, summaries, and cross-session memories.
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.
Summary
QdrantSkillMatcherreturns an empty result set (embed error or Qdrant unavailable),rebuild_system_promptnow falls back to all registered skills instead of running with an empty active-skill listauto_detect_context_windowtoSubProviderandModelOrchestrator;build_providernow calls it forAnyProvider::Orchestratorso thatauto_budget_tokensreturns a non-zero value andprepare_contextinjects semantic recall, summaries, and cross-session memoriesRoot causes
scoredvec passed through unchanged → zero active skills, no fallbackAnyProvider::Ollamawas interrogated for context window size; orchestrator was silently skipped →context_budget = None→prepare_contextreturned early on every queryTest plan
cargo clippy --workspace -- -D warningspasses with zero warningscargo nextest run --workspace --lib --bins— 2963 tests pass