fix(cli): remove cross-platform dead symbols in startup, runtime and external editor - #2574
Open
1688mengdie wants to merge 1 commit into
Open
fix(cli): remove cross-platform dead symbols in startup, runtime and external editor#25741688mengdie wants to merge 1 commit into
1688mengdie wants to merge 1 commit into
Conversation
external editor
Three CLI symbols have no remaining cross-platform consumer and show up as
dead-code/unused-import warnings in the upstream CI build logs:
- ui/startup.rs: drop the unused `bitfun_core_types::model::ModelMutation`
import. Upstream mutation handling goes through the model_selection
module; this import is pure refactoring leftover.
- runtime/mod.rs: remove the unused CliRuntimeContext::agent_event_source
method. Its only historical consumer (the embedded app server) was
removed upstream, so the whole crate has no caller left; the
_agent_event_queue_owner field keeps its underscore prefix and the
AgentEventSource import stays because the agent_runtime accessors still
need it.
- modes/chat/external_editor.rs: split
`use std::ffi::{OsStr, OsString}` into `#[cfg(windows)] use
std::ffi::OsStr;` plus an unconditional `use std::ffi::OsString;`.
OsStr is only consumed by the windows batch quoting helper, so non-
Windows builds reported the import as unused.
Adopted-from: taiji 228dd72 (startup.rs and runtime/mod.rs hunks) and
taiji ae12a76 (external_editor.rs OsStr split hunk).
Test: cargo check --locked -p bitfun-cli exit 0 with the three warnings
gone and no new warnings for runtime/mod.rs or external_editor.rs.
AI: implemented with AI assistance, lightly tested (cargo check only).
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 #2568
Remove three cross-platform dead/unused symbols in the CLI:
src/apps/cli/src/ui/startup.rs: delete the unusedbitfun_core_types::model::ModelMutationimport (pure refactoring leftover; upstream mutation handling goes through the model selection module).src/apps/cli/src/runtime/mod.rs: delete the unusedCliRuntimeContext::agent_event_sourcemethod (its only historical consumer, the embedded app server, was removed upstream). The_agent_event_queue_ownerfield keeps its underscore prefix and theAgentEventSourceimport stays — both still have live consumers.src/apps/cli/src/modes/chat/external_editor.rs: splituse std::ffi::{OsStr, OsString};into#[cfg(windows)] use std::ffi::OsStr;plus an unconditionaluse std::ffi::OsString;(OsStris only consumed by the Windows batch-quoting helper).See issue #2568 for the CI run evidence with file:line and rule names.
Type and Areas
Type: bug fix (build warnings cleanup)
Areas: Rust CLI
Motivation / Impact
No direct user-facing change. Removes 1 unused import, 1 dead method, and 1 platform-scoped import warning that pollute every full CI run of
main; the crate stops carrying dead symbols.Verification
cargo check --locked -p bitfun-clion Windows: exit 0, theModelMutationunused-import andagent_event_sourcedead_code warnings gone; no new warnings forruntime/mod.rsorexternal_editor.rs(theAgentEventSourceimport retained inruntime/mod.rsproduced no unused warning, confirming it still has live consumers). TheOsStrwarning only fires on unix compile units, which are covered by CI.external_editor.rssplit (no moreunused import: OsStron ubuntu/macos compile units) depends on the CI ubuntu/macos runners: the Rust Build Check / CLI Tests jobs should confirm it (n/a locally — no Linux/macOS machine available; the platform matrix in CI is exactly the place this gets verified).Reviewer Notes
#[allow]suppression is introduced.Checklist