chore(routers/http): remove dead code and trim stale comments#1651
chore(routers/http): remove dead code and trim stale comments#1651slin1237 wants to merge 1 commit into
Conversation
Remove provably-dead internal items from the PD router types and a dead parameter, and trim stale/restating comments, per the codebase audit (gw-routers-http) dead_code + comment_bloat findings. - pd_types: remove unused PDRouterError enum, api_path helper, and BatchRequestWithBootstrap struct (zero references repo-wide; bindings glob-import the crate root only, which does not re-export pd_types). - pd_router: drop the unread _start_time arg from execute_dual_dispatch_internal (and its now-unnecessary too_many_arguments expect). - pd_router: delete the stale "decode server" comments on get_server_info (it proxies to the first prefill worker) and the two repeated "static string keys" comments that restate the code. Signed-off-by: Simo Lin <25425177+slin1237@users.noreply.github.com>
|
Warning Review limit reached
More reviews will be available in 51 seconds. Learn how PR review limits work. Your organization has run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (2)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Code Review
This pull request cleans up unused code and parameters in the prefill-decode (PD) router. Specifically, it removes the unused PDRouterError enum, the api_path utility function, and the BatchRequestWithBootstrap struct from pd_types.rs. In pd_router.rs, it removes the unused _start_time parameter from execute_dual_dispatch_internal (allowing the removal of the clippy argument limit suppression) and cleans up several redundant comments. There are no review comments, so I have no feedback to provide.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
|
👋 The PR description doesn't fully follow
Please update the PR description so reviewers have the context they need. |
There was a problem hiding this comment.
Clean deletion-only PR. Verified all 4 removed items (PDRouterError, api_path, BatchRequestWithBootstrap, _start_time param) are unused repo-wide. Stale comments were correctly identified — get_server_info proxies to prefill, not decode. The clippy expect removal is correct (6 args, under the 7-arg threshold). No issues found.
Description
Problem: the HTTP/PD routers carry provably-dead internal code and stale comments flagged by the codebase audit (gw-routers-http) — an unused error enum, an unused URL helper, an unused bootstrap-wrapper struct, a dead function parameter, and comments that are either wrong or merely restate the code.
Solution: removed the dead internal items and trimmed the flagged comments. No behavior change.
From the codebase audit (gw-routers-http): dead_code + comment_bloat findings.
Changes
Dead code (4 internal items, all re-verified unused repo-wide incl. tests/benches/bindings/clients):
pd_types.rs: removed unusedPDRouterErrorenum (zero constructors anywhere),api_pathhelper (no callers), andBatchRequestWithBootstrapstruct (no references). Thesmgcrate is consumed only by the in-workspace bindings, which glob-import the crate root (use smg::*); the root does not re-exportpd_types, so thesepubitems are unreachable as external API.pd_router.rs: dropped the unread_start_time: Instantparameter fromexecute_dual_dispatch_internal(and its now-unnecessary#[expect(clippy::too_many_arguments)], which became unfulfilled at 6 args).Comments (4 lines, 3 sites):
pd_router.rsget_server_info: deleted two stale comments claiming server info comes from the "decode server" — the code proxies to the first prefill worker.pd_router.rsinject_bootstrap_into_value: removed the two repeated "Use static string keys to avoid per-request allocations" comments that restate the code (and are partially inaccurate, since theMapinsert still allocates an ownedStringkey).Kept (re-verified as live test/bench fixtures, not dead):
RequestWithBootstrap(used bybenches/request_processing.rs) andPDSelectionPolicy(used bytests/routing/test_pd_routing.rs).Net: 51 deletions across 2 files (deletion-heavy cleanup; well under 400 lines).
Test Plan
Gate run with sccache disabled, scoped to the
smgpackage (CI runs the full--all-featuresworkspace gate):cargo +nightly fmt --all— clean (pure deletions, no reformatting).RUSTC_WRAPPER="" cargo clippy -p smg --all-targets -- -D warnings:(only pre-existing workspace notes: non-root profiles, duplicate
main.rsbuild target — unrelated to this change)RUSTC_WRAPPER="" cargo test -p smg:cargo +nightly fmt --allcargo clippy --all-targets -- -D warnings