Skip to content

triage routing: debug dump always shows first-tier provider model, not actual selected tier model #2229

@bug-ops

Description

@bug-ops

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 when tier="expert" routes to gpt-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_tier field to TriageRouter (updated after each classify call) and use the corresponding provider in debug_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.

Metadata

Metadata

Assignees

Labels

P2High value, medium complexitybugSomething isn't workingllmzeph-llm crate (Ollama, Claude)

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions