-
Notifications
You must be signed in to change notification settings - Fork 2
triage routing: debug dump always shows first-tier provider model, not actual selected tier model #2229
Copy link
Copy link
Closed
Labels
P2High value, medium complexityHigh value, medium complexitybugSomething isn't workingSomething isn't workingllmzeph-llm crate (Ollama, Claude)zeph-llm crate (Ollama, Claude)
Description
Summary
TriageRouter::debug_request_json always delegates to tier_providers.first() (the simple tier provider), making debug dumps misleading when a higher tier is selected at runtime.
Root Cause
// crates/zeph-llm/src/router/triage.rs:581
// Return the debug JSON of the first tier provider (best effort; tier unknown statically).
self.tier_providers
.first()
.map_or(serde_json::Value::Null, |(_, p)| {
p.debug_request_json(messages, tools, stream)
})The comment acknowledges this limitation, but it means operators can't use debug dumps to verify which tier was actually used or what model received the request.
Impact
- MEDIUM: misleading debug dumps during triage routing — always shows
"model": "gpt-4o-mini"even whentier="expert"routes togpt-4o - Makes it impossible to audit tier routing decisions via debug dumps
- LLM serialization gate verification unreliable for triage routing configs
Observed
Debug dump from expert-tier query shows "model": "gpt-4o-mini" (the simple tier provider), while logs show tier="expert" provider="openai". The actual API call uses gpt-4o but the dump records gpt-4o-mini.
Fix Direction
Capture the actual tier selection result at call time and record it in the debug dump. Options:
- Add a
last_selected_tierfield toTriageRouter(updated after each classify call) and use the corresponding provider indebug_request_json - Record tier selection in a per-request debug annotation alongside the dump
- Add a triage-specific dump section showing tier + actual provider used
Discovered in CI-210 (2026-03-27) during live triage routing verification.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
P2High value, medium complexityHigh value, medium complexitybugSomething isn't workingSomething isn't workingllmzeph-llm crate (Ollama, Claude)zeph-llm crate (Ollama, Claude)