Skip to content

fix(llm): delegate embed() to tier providers in TriageRouter (#2174)#2176

Merged
bug-ops merged 1 commit intomainfrom
2174-triage-embed-passthrough
Mar 26, 2026
Merged

fix(llm): delegate embed() to tier providers in TriageRouter (#2174)#2176
bug-ops merged 1 commit intomainfrom
2174-triage-embed-passthrough

Conversation

@bug-ops
Copy link
Copy Markdown
Owner

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

Summary

  • TriageRouter.embed() now delegates to the first embedding-capable tier provider instead of always returning EmbeddingNotSupported
  • TriageRouter.supports_embeddings() now reflects whether any tier provider supports embeddings (was hardcoded false)
  • Resolves tool schema filter being silently disabled when [llm] routing = "triage"

Root Cause

AgentBuilder::maybe_init_tool_schema_filter calls provider.embed() to build tool embeddings at startup. With routing = "triage", provider is a TriageRouter that wraps the underlying provider pool but returned EmbedUnsupported unconditionally — even when a tier provider (e.g., the fast provider with embedding_model = "text-embedding-3-small") fully supports embeddings.

Fix

TriageRouter::embed() iterates tier_providers to find the first embedding-capable provider and delegates to it. Falls back to triage_provider if it supports embeddings. Returns EmbedUnsupported only when no provider in the router can embed.

Test Plan

  • supports_embeddings_false_when_no_tier_supports_it
  • supports_embeddings_true_when_tier_supports_it
  • embed_delegates_to_first_embedding_capable_tier
  • embed_returns_error_when_no_tier_supports_embeddings
  • All 26 triage tests pass
  • cargo +nightly fmt --check — clean
  • cargo clippy --workspace --features full -- -D warnings — clean
  • cargo nextest run --workspace --features full --lib --bins — 6472/6472 passed

Closes #2174

…geRouter

When routing = "triage", TriageRouter wraps the provider pool but previously
returned EmbeddingNotSupported from embed(), causing the tool schema filter to
be silently disabled at startup.

TriageRouter.embed() now delegates to the first tier provider that reports
supports_embeddings() = true, then falls back to the triage provider, before
returning EmbedUnsupported. supports_embeddings() reflects tier provider
capability instead of hardcoding false.

Adds four unit tests covering the new delegation behavior.

Fixes #2174
@bug-ops bug-ops enabled auto-merge (squash) March 26, 2026 15:18
@github-actions github-actions bot added 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) labels Mar 26, 2026
@bug-ops bug-ops merged commit f68e38b into main Mar 26, 2026
25 checks passed
@bug-ops bug-ops deleted the 2174-triage-embed-passthrough branch March 26, 2026 15:27
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.

fix(core): tool schema filter disabled when routing=triage (triage router doesn't expose embeddings)

1 participant