Skip to content

fix(cli): remove cross-platform dead symbols in startup, runtime and external editor - #2574

Open
1688mengdie wants to merge 1 commit into
GCWing:mainfrom
BitFun-SIG:fix/ci-warning-cli-dead-symbols
Open

fix(cli): remove cross-platform dead symbols in startup, runtime and external editor#2574
1688mengdie wants to merge 1 commit into
GCWing:mainfrom
BitFun-SIG:fix/ci-warning-cli-dead-symbols

Conversation

@1688mengdie

Copy link
Copy Markdown

Summary

Fixes #2568

Remove three cross-platform dead/unused symbols in the CLI:

  • src/apps/cli/src/ui/startup.rs: delete the unused bitfun_core_types::model::ModelMutation import (pure refactoring leftover; upstream mutation handling goes through the model selection module).
  • src/apps/cli/src/runtime/mod.rs: delete the unused CliRuntimeContext::agent_event_source method (its only historical consumer, the embedded app server, was removed upstream). The _agent_event_queue_owner field keeps its underscore prefix and the AgentEventSource import stays — both still have live consumers.
  • src/apps/cli/src/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).

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-cli on Windows: exit 0, the ModelMutation unused-import and agent_event_source dead_code warnings gone; no new warnings for runtime/mod.rs or external_editor.rs (the AgentEventSource import retained in runtime/mod.rs produced no unused warning, confirming it still has live consumers). The OsStr warning only fires on unix compile units, which are covered by CI.
  • The unix-side effect of the external_editor.rs split (no more unused import: OsStr on 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

  • Three files, net −4 lines (startup −1, runtime −4, external_editor −1/+3); no behavior change: only unreachable code and an unused import are removed, plus a precise cfg scope for a Windows-only symbol.
  • No #[allow] suppression is introduced.
  • AI-assisted change, lightly tested (cargo check on Windows only; cross-platform behavior verified by CI).

Checklist

  • This PR is focused and does not include secrets, temporary prompts, generated scratch files, or unrelated artifacts.
  • Relevant verification is recorded above, or skipped checks are explained.
  • User-facing strings, docs, and locales are updated where applicable. (n/a — no user-facing change)

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).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: unused import / dead method warnings in CLI startup.rs, runtime/mod.rs and external_editor.rs

1 participant