Skip to content

fix(agent): gate the cache test helper like its only caller - #157

Merged
peterj merged 1 commit into
agentdesktop-dev:mainfrom
LutzLange:upstream/fix-153-linux-only-test-helper
Oct 8, 2026
Merged

peterj merged 1 commit into
agentdesktop-dev:mainfrom
LutzLange:upstream/fix-153-linux-only-test-helper

Conversation

@LutzLange

Copy link
Copy Markdown
Contributor

Fixes #153.

CredentialCache::get is only called from the llm_proxy test module, which is gated to Linux. On macOS and Windows the helper was compiled without a caller, so make check (clippy -D warnings) failed with method get is never used. The helper now carries the same cfg(all(test, target_os = "linux")) as the module, as @jagansanikommu suggested in the issue (thanks for the analysis).

Checked on Linux: cargo fmt --check, cargo clippy -p agentdesktop-agent --all-targets -- -D warnings, and the 41 llm_proxy tests pass. For the non-Linux case I turned the test module's gate off on Linux: before the change clippy reports the error from the issue, after it clippy passes. Not run on a real macOS or Windows host.

🤖 Generated with Claude Code

@jagansanikommu

Copy link
Copy Markdown
Contributor

Verified this on a real macOS host, since that was the gap you flagged.

macOS 27.0, arm64, Rust 1.98 (the pinned toolchain).

On main at 0a1bb78, before your change:

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

On this branch:

cargo clippy -p agentdesktop-agent --all-targets -- -D warnings   clean
cargo clippy --workspace --all-targets -- -D warnings             clean
cargo test -p agentdesktop-agent --lib                            333 passed

So the real-host case matches what your Linux simulation predicted, and make check passes on macOS with this applied. I have no Windows machine, so that half is still unverified — though it should follow, since the cause is the target_os gate rather than anything platform-specific beyond it.

Thanks for picking it up, and for the credit.

`CredentialCache::get` is used only by the llm_proxy test module, which is
compiled on Linux only. On macOS and Windows the helper had no caller, and
`make check` (clippy -D warnings) failed with `method get is never used`.
The helper now carries the same cfg as the module.

Fixes agentdesktop-dev#153.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@LutzLange
LutzLange force-pushed the upstream/fix-153-linux-only-test-helper branch from 23186cc to 95a4a79 Compare October 8, 2026 16:55
@peterj
peterj merged commit 771866d into agentdesktop-dev:main Oct 8, 2026
3 checks passed
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.

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

3 participants