-
Notifications
You must be signed in to change notification settings - Fork 2
fix(core): tool schema filter disabled when routing=triage (triage router doesn't expose embeddings) #2174
Description
Summary
When [llm] routing = "triage", the tool schema filter is silently disabled at startup:
INFO tool schema filter disabled: embedding not supported by provider (embedding not supported by triage) provider="triage"
The agent still functions, but tool_count and always_on are not logged — all tools are always included in every context window instead of being semantically filtered.
Root Cause
AgentBuilder::with_tool_schema_filter calls provider.embed() to build tool embeddings at startup. When routing = "triage", self.provider is the triage router, which wraps the underlying provider pool but does not implement embed() itself — it returns LlmError::EmbeddingNotSupported.
The embedding model IS configured on the underlying provider (e.g. fast has embedding_model = "text-embedding-3-small"), but the builder never reaches it.
Impact
MEDIUM — tool schema filter (semantic tool selection, top_k filtering) is non-functional in triage mode. All tools included in every turn context = higher token usage, lower routing precision.
Proposed Fix
AgentBuilder::with_tool_schema_filter should resolve the embedding provider from the raw provider pool directly (bypassing the router), not from self.provider. The first provider in the pool that supports embeddings should be used for tool embedding initialization.