Skip to content

make check fails on non-Linux hosts: cfg(test) helper whose only caller is Linux-gated #153

Description

@jagansanikommu

Found while running the local gate on macOS before pushing #99.

Summary

make check fails on a clean main on macOS, and would on Windows, because
clippy is run with -D warnings and one #[cfg(test)] helper has no caller
outside Linux.

error: method `get` is never used
   --> crates/agent/src/llm_proxy.rs:149:8
error: could not compile `agentdesktop-agent` (lib test) due to 1 previous error

Reproduced against upstream/main with no local changes applied, to be sure it
was not mine.

Root cause

The helper is compiled for every test build:

// crates/agent/src/llm_proxy.rs:147-152
/// A cached credential for the key and device, if one is still valid.
#[cfg(test)]
fn get(&self, key: &str, device_id: &str) -> Option<String> {

but the module that uses it is gated to Linux:

// crates/agent/src/llm_proxy.rs:1315
#[cfg(all(test, target_os = "linux"))]
mod tests

So on any non-Linux host get is compiled with no callers, dead_code fires,
and -D warnings turns it into an error.

Why CI does not catch it

Clippy only ever runs on the Linux job, where the test module is compiled and
the helper is used:

  • Test and lint — blacksmith-4vcpu-ubuntu-2404, runs make lint
  • Windows agent tests — windows-2025, runs only
    cargo nextest run --locked --package agentdesktop-agent --lib, no clippy
  • Container — make docker

So the failure is invisible to CI and visible to every contributor developing on
macOS or Windows, for whom the documented make check does not pass on a clean
checkout.

Suggested fix

Match the helper to its caller:

#[cfg(all(test, target_os = "linux"))]
fn get(&self, key: &str, device_id: &str) -> Option<String> {

Happy to send that as a PR if you want it — it is one line, so I did not assume.

A broader option, if you would like non-Linux breakage caught in future: add a
clippy step to the Windows job, or a macOS cargo clippy job. That is a bigger
call about CI minutes, which is yours rather than mine.

Activity

  1. added a commit that references this issue on Oct 8, 2026
    95a4a79
  2. added a commit that references this issue on Oct 8, 2026
    771866d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions