Conversation
|
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 (2)
Included review availability: Your plan provides up to 12 included reviews per hour; 11 remain after this review. WalkthroughRequest logging now preserves absent session and correlation IDs as missing fields. Completed and cancelled request tests capture all tracing fields and verify absent, empty, and populated identifier values. The changelog documents the fix. ChangesRequest logging
Estimated code review effort: 2 (Simple) | ~10 minutes Merge Risk: ⚪ Minimal · up to Request logs now omit absent session and correlation IDs while retaining explicitly empty and populated values, improving diagnostic clarity without an identified current-head merge risk. Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 36.36% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 11 functions across 1 files. (1 skipped: 1 unsupported.)
Comment |
|
|
||
| // One terminal request event: its level, its message, and every other field it | ||
| // recorded. A field the event never recorded is a missing key, not an empty value. | ||
| type CapturedEvent = (Level, String, BTreeMap<String, String>); |
There was a problem hiding this comment.
I would make this a struct instead of tuple.
|
@nachiketb-nvidia can you review this one? |
|
@chethanuk could you switch the capture type to a named struct as requested in the open review thread? @nachiketb-nvidia gentle bump for review once that is updated. |
c83fb86 to
07a3daf
Compare
Signed-off-by: ChethanUK <chethanuk@outlook.com>
07a3daf to
1526379
Compare
What
.unwrap_or("")onsession_id/correlation_idinRequestLogContext::emitandemit_cancelled, so an absent id omits the field instead of logging it as empty.Why
The terminal request log renders
session_id=for both "no session was sent" and "an empty session was sent" — an operator can't tell them apart. This is part 3 of #301; parts 1 and 2 landed in #308.Closes #301.
Notes for reviewers
requested_model,selected_model, anderrorkeepunwrap_or("")on purpose:emit_cancelledhardcodesselected_model = "", so those three mean "absent implies empty" by design. The only non-test producer ofsession_id(resolve_path) never returnsSome("")today, so the empty-string test row is a regression guard rather than a live bug — the user-visible change is that an absent session stops printingsession_id=.Test plan
cargo test -p switchyard-server request_log— new test fails today (left: Some(""), right: None), 4 passed after the fixcargo fmt --all --checkcargo clippy -p switchyard-server --all-targets -- -D warningscargo test --workspace— 586 passed, 0 failed, 1 ignoredcargo clippy --workspacefails oncrates/prefill-router(chunks_exact), pre-existing and untouched here — reproduces onorigin/mainalone.Summary by CodeRabbit
Bug Fixes
Documentation