fix(llm): correct triage routing debug dump and remove context bias#2244
Merged
fix(llm): correct triage routing debug dump and remove context bias#2244
Conversation
…2229, #2228) - debug_request_json now reads last_provider_idx (same pattern as last_usage) instead of always returning the first-tier provider; falls back to first when no request has been made yet (#2229) - removed msg_count/token_estimate from build_triage_prompt; classification now based on message content only, preventing long-session bias toward higher tiers (#2228)
0fdbb7e to
f6d9012
Compare
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
debug_request_jsonnow reflects the actual selected tier provider by readinglast_provider_idx(same atomic pattern aslast_usage()), instead of always returning the first-tier model. Falls back to first provider before any request is made. (triage routing: debug dump always shows first-tier provider model, not actual selected tier model #2229)msg_count/token_estimatefrombuild_triage_prompt; classification is now based on message content only, eliminating the long-session bias toward higher tiers. (triage routing: context size metadata biases complexity classification for simple queries in long conversations #2228)Tests
Two regression tests added to
crates/zeph-llm/src/router/triage.rs:debug_request_json_reflects_last_provider_after_chat— verifies dump reflects last-routed provider, not first-tierbuild_triage_prompt_has_no_context_size_metadata— asserts "messages" and "tokens" strings are absent from promptAll 6708 tests pass.
Checklist
cargo +nightly fmt --checkpassedcargo clippy --workspace --features full -- -D warningspassedcargo nextest run --workspace --features full --lib --bins6708/6708 passedCloses #2229
Closes #2228