fix(libsy): allow message_hash_fallback with classify_trigger = user_turn - #815
Conversation
…turn Signed-off-by: Deepak Jain <deepujain@users.noreply.github.com>
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository: NVIDIA-NeMo/Switchyard/.coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (4)
Included review availability: Your plan provides up to 12 included reviews per hour; 11 remain after this review. WalkthroughThe change expands ChangesMessage Hash Fallback
Priority: ⬇️ Low Estimated code review effort: 2 (Simple) | ~15 minutes Merge Risk: ⚪ Minimal · up to The classifier now supports message-hash fallback for user turns while continuing to reject every-request classification; validation, routing, tests, and documentation are aligned, with no actionable merge-blocking risk identified. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
A rabbit checks the trigger gate Comment |
There was a problem hiding this comment.
Looks good. This carries forward the runtime change from #519. Ayush had already reviewed that implementation and only asked for the routing guide and server README updates: #519 (review). Both are included here.
@ryan-lempka tagging you since this sits on the classify_trigger/AffinityRouter path you added. Holding the merge until the v0.3 freeze is lifted.
|
Thanks for the review. Noted that the merge is on hold until the v0.3 freeze lifts. |
|
Thanks for your contribution @deepujain ! |
What
Relaxes the classifier config validation so
message_hash_fallbackis accepted withclassify_trigger = "user_turn"in addition to"new_session". Only"every_request"is still rejected: it retains no target, so a fallback identity has nothing to key on. Docs updated indocs/reference/toml_schema.md,docs/routing_algorithms/llm_classifier_routing.md, andcrates/switchyard-server/README.md. Adds a regression test covering the accepted and rejected combinations.Why
Fixes the runtime half of #495. With
user_turnand no session id, every turn is classified, souser_turnbehaves likeevery_requestfor callers that send no session id.message_hash_fallbackwas meant to fix exactly that by keying the retained target on a hash of the first user message, but config validation rejected the combination. This also revives the runtime change from #519, which was closed for inactivity with only the docs update outstanding; the requested docs are included here.Notes for reviewers
Start at
affinity_routerincrates/libsy/src/algorithms/llm_class.rs: the runtime already supports the combination, so this change only lifts the spurious validation rejection in the three validate sites. New test:message_hash_fallback_accepts_retaining_triggers. Local: cargo fmt clean, clippy -p switchyard-libsy clean, cargo test -p switchyard-libsy 314 passed.Summary by CodeRabbit
New Features
message_hash_fallbacknow supports classification on both new sessions and user turns.Bug Fixes
Documentation