fix(cli): remove dead peer turn session helpers and their test-only callers - #2575
Open
1688mengdie wants to merge 1 commit into
Open
fix(cli): remove dead peer turn session helpers and their test-only callers#25751688mengdie wants to merge 1 commit into
1688mengdie wants to merge 1 commit into
Conversation
callers After the upstream transactional session rollback rework, the session-level turn cleanup moved into the Agent Runtime rollback path and no production caller is left for PeerTurnTracker::drain_session_turns: a full-crate grep finds zero non-test references, and the upstream CI build logs report the method (plus its two private helpers session_tree_keys and remove_completed_background_sources_for_session) as dead code. Following the upstream BREAKING semantics that already accepted removing session-scoped helpers, delete the three dead symbols and the four tests that exclusively exercise drain_session_turns: - draining_a_parent_session_after_root_completion_returns_the_active_child_only - draining_a_child_session_releases_its_early_follow_up_reservation - draining_a_sibling_child_does_not_release_another_childs_reservation - explicit_drains_quarantine_removed_turn_ids No allow(dead_code) suppression is introduced. Test: cargo check --locked -p bitfun-cli exit 0 with the three dead_code warnings gone; cargo test -p bitfun-cli --bin bitfun peer_host exit 0. AI: implemented with AI assistance, lightly tested (cargo check + targeted unit tests).
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
Fixes #2569
Delete the dead session-scoped turn helpers in
src/apps/cli/src/peer_host/state.rstogether with their test-only callers:PeerTurnTracker::drain_session_turns(zero non-test references left)session_tree_keys(private helper of the above)remove_completed_background_sources_for_session(private helper of the above)drain_session_turns:draining_a_parent_session_after_root_completion_returns_the_active_child_only,draining_a_child_session_releases_its_early_follow_up_reservation,draining_a_sibling_child_does_not_release_another_childs_reservation,explicit_drains_quarantine_removed_turn_idsAfter the upstream transactional session rollback rework, session-level turn cleanup moved into the Agent Runtime rollback path; the CI logs report all three symbols as dead code (see issue #2569 for the run evidence with file:line and rule names).
Type and Areas
Type: bug fix (dead code removal, no behavior change)
Areas: Rust CLI
Motivation / Impact
No direct user-facing change. Live peer-turn functionality is untouched:
PeerTurnDrain,interrupt_event_stream,drain_peer_turns,peer_turns_for_cancellationand all remaining peer-host tests stay. The crate stops carrying three dead symbols and four orphaned tests, and the CI logs stop reporting the three dead_code warnings on every full run.Verification
cargo check --locked -p bitfun-clion Windows: exit 0, the three dead_code warnings gone.cargo test --locked -p bitfun-cli --bin bitfun peer_hoston Windows: 77 passed, 0 failed (the remaining peer-host test suite is intact after the four drain-only tests were removed).Reviewer Notes
#[allow(dead_code)]suppression.Checklist