fix(libsy): fall back on efficient stream transport errors - #390
Conversation
Signed-off-by: Ting-Hong Shieh <32212900+ting-hong-shieh@users.noreply.github.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (1)
WalkthroughThe escalation classifier now falls back to the capable target after efficient-stream transport failures. Other aggregation failures remain typed ChangesEscalation stream fallback
Estimated code review effort: 3 (Moderate) | ~20 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
Comment |
ayushag-nv
left a comment
There was a problem hiding this comment.
Nice Catch. Thanks for the contribution. Approving
What
Why
The efficient client call completes as soon as it returns a stream handle. A transport error can surface later, while
into_agg()consumes that stream for the escalation judge. That error was converted toAlgorithmError, so the route returned HTTP 500 without calling the capable target.This change treats only a mid-stream transport failure as recoverable. Other aggregation errors keep their original client error type instead of silently changing targets.
Closes #388
How tested
cargo fmt --all --checkcargo clippy --workspace --all-targets -- -D warningscargo test -p switchyard-libsycargo test --workspaceChecklist
Notes for reviewers
The fallback is intentionally limited to
LlmClientError::Transport; invalid or malformed responses remain structured client-call failures.Summary by CodeRabbit