@setoelkahfi / sigit / commits / d511bb4

Fix Windows clippy: silence dead_code for Unix-only backend/provider

The interactive client (run_interactive in main.rs, mod tui in chat.rs) is #[cfg(unix)]. On Windows the binary runs ACP-only and drives onde directly, so the entire `backend` module and the provider-resolution path in `provider` are legitimately unused there. With `-D warnings` clippy turned 26 dead_code/unused_import warnings into errors on windows-msvc only. Gate the suppression to non-Unix targets so macOS and Linux builds keep full lint coverage: - backend.rs, provider.rs: module-level #![cfg_attr(not(unix), allow(dead_code))] - main.rs: #[cfg_attr(not(unix), allow(unused_imports))] on the backend import Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0114ejs5iB6iEjQkSrzLavne

Claude committed Jun 22, 2026 at 22:12 UTC d511bb4a46946edc8051324ba833d128af0912c3
3 files changed +17
src/backend.rs
+7
@@ -10,6 +10,13 @@
10 //!
11 //! The trait exposes neither `onde` nor OpenAI types, so the loop does not depend
12 //! on a specific backend.
13 +//!
14 +//! The whole backend seam is wired up only through the interactive client, which
15 +//! is `#[cfg(unix)]` (see `run_interactive` in `main.rs` and `mod tui` in
16 +//! `chat.rs`). On non-Unix targets the binary runs ACP-only and drives `onde`
17 +//! directly, so every item here is legitimately unused there. Suppress the
18 +//! dead-code lint on those targets only — Unix builds still get full coverage.
19 +#![cfg_attr(not(unix), allow(dead_code))]
20
21 use std::sync::Arc;
22
src/main.rs
+3
@@ -58,6 +58,9 @@ use agent_client_protocol::schema::{
58 use agent_client_protocol::{Agent, ByteStreams, Client, ConnectionTo, Responder};
59 use onde::inference::{ChatEngine, GgufModelConfig, ToolDefinition, ToolResult};
60
61 +// These back the interactive client (`run_interactive`), which is `#[cfg(unix)]`;
62 +// the import is unused on non-Unix targets that run ACP-only.
63 +#[cfg_attr(not(unix), allow(unused_imports))]
64 use crate::backend::{InferenceBackend, LocalBackend, OpenAiBackend};
65 use std::path::PathBuf;
66 use std::sync::atomic::{AtomicBool, Ordering};
src/provider.rs
+7
@@ -7,6 +7,13 @@
7 //! 2. siGit Code Cloud: used when the user is logged in (`sigit login`). The
8 //! endpoint and tier are built in, and the session token is the credential.
9 //! 3. On-device: no login and no override, so inference runs locally.
10 +//!
11 +//! Provider resolution is consumed only by the interactive client, which is
12 +//! `#[cfg(unix)]`. The display helpers (`cloud_tier_label`, `CLOUD_TIERS`) are
13 +//! still used cross-platform by `/models`, but the resolution path is dead on
14 +//! non-Unix targets, where the binary runs ACP-only and on-device. Suppress the
15 +//! dead-code lint there only — Unix builds keep full coverage.
16 +#![cfg_attr(not(unix), allow(dead_code))]
17
18 use std::path::PathBuf;
19