From c529f2933377cacd5429616c6872503422cc331b Mon Sep 17 00:00:00 2001 From: user Date: Fri, 28 Aug 2026 02:35:27 +0800 Subject: [PATCH] fix(cli): remove cross-platform dead symbols in startup, runtime and 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 228dd7253 (startup.rs and runtime/mod.rs hunks) and taiji ae12a76c4 (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). --- src/apps/cli/src/modes/chat/external_editor.rs | 4 +++- src/apps/cli/src/runtime/mod.rs | 4 ---- src/apps/cli/src/ui/startup.rs | 1 - 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/src/apps/cli/src/modes/chat/external_editor.rs b/src/apps/cli/src/modes/chat/external_editor.rs index ec27b3901d..0cd228a675 100644 --- a/src/apps/cli/src/modes/chat/external_editor.rs +++ b/src/apps/cli/src/modes/chat/external_editor.rs @@ -1,4 +1,6 @@ -use std::ffi::{OsStr, OsString}; +#[cfg(windows)] +use std::ffi::OsStr; +use std::ffi::OsString; use std::io::Write; use std::path::PathBuf; use std::process::{Command, Stdio}; diff --git a/src/apps/cli/src/runtime/mod.rs b/src/apps/cli/src/runtime/mod.rs index c4bf40ce7b..98cca53f14 100644 --- a/src/apps/cli/src/runtime/mod.rs +++ b/src/apps/cli/src/runtime/mod.rs @@ -118,10 +118,6 @@ impl CliRuntimeContext { &self.agent_runtime } - pub(crate) fn agent_event_source(&self) -> AgentEventSource { - self._agent_event_queue_owner.runtime_source() - } - pub(crate) fn compatibility(&self) -> &CoreAgentRuntimeCompatibility { &self.compatibility } diff --git a/src/apps/cli/src/ui/startup.rs b/src/apps/cli/src/ui/startup.rs index 79e9708604..bb81dcea81 100644 --- a/src/apps/cli/src/ui/startup.rs +++ b/src/apps/cli/src/ui/startup.rs @@ -30,7 +30,6 @@ use crate::config::CliConfig; /// - Model/Agent/Session/Skill/Subagent selector popups /// - Random tips use anyhow::{anyhow, Result}; -use bitfun_core_types::model::ModelMutation; use bitfun_product_domains::agent_catalog::{SkillSummary, SubagentSummary}; use crossterm::event::{Event, KeyCode, KeyEvent, KeyEventKind, KeyModifiers}; use ratatui::{