fix(cmux-tui): clear base clippy reds from #30361, #30362 and #30363

Merged
LA
4d ago
+36-29

Summary

cmux-tui-rust-check.sh clippy (-D warnings) is red on feat-cmux-next at 16b7cc288ba3, so every PR's Rust lint run is red for reasons it didn't cause. This fixes those lints forward. Each culprit is a whole feature, so a revert would drop far more than a lint; every change here is behavior-neutral.

CulpritLintFix
#30361type_complexity, cmux-host cloud/github_repos_tests.rs:130name the fake's state tuple (type FakeState)
#30361collapsible_if, acpmux agent_tools.rs:590, cloud_repo_mcp.rs:155; cmux-tui-core cloud_repos/engine.rs:241-242, cloud_repos/runtime.rs:150let chains; same conditions in the same order, same short-circuit
#30361semicolon_if_nothing_returned, cloud_repos/runtime.rs:279add the ;
#30361nonminimal_bool, cmux-tui cli/cloud_repo.rs:122,125!x.is_some_and(p) becomes x.is_none_or(!p); same accepted values
#30362dead_code, cmux-host identity.rs:61 enrolled (macOS only)its only caller is the Linux host loop (linux/mod.rs:594), so compile it under #[cfg(any(target_os = "linux", test))]; its wire-name imports move into the function, and identity/tests.rs imports the two names it writes
#30363redundant_clone, cmux-tui-core server/agent_session_folders.rs:281Some(first); first is not used after it
#30363items_after_test_module, acpmux server/remote_guard.rs:1058move mod cloud_chat_tests to the end of the file, unchanged

No #[allow] added.

Since this opened, #30528 landed the same let-chain collapses in agent_tools.rs, cloud_repo_mcp.rs, cloud_repos/engine.rs and runtime.rs. This branch merges cleanly with feat 4dd06291c13, and those four files then match feat, so the net change is the other six files.

Not base, so not here: acpmux/src/host_load.rs:15 CPU_WINDOW is new in #30437; the agent_session_turn unnecessary qualification and let_and_return errors are new in #30371.

Testing

Red: cmux-ci run --class isolated --os linux --script scripts/ci/cmux-tui-rust-check.sh --arg clippy --ref 16b7cc288ba3fa192349421f2744b2832801ac56 (job 5efcdf7d37b3bb4dbea46bf9) fails with every Linux lint above. The macOS-only enrolled error is in the macOS clippy logs of #30437 and #30371 merge heads (fleet jobs d949981d1a522a054039a07a, d01e984ab3724f1fa8a37890).

Green at merged head aece679ba202 (feat 5a273091bbe merged in; the 3 conflicted files take feat's version, which already has #30528's let-chains and #30478's get() reads):

Green at the earlier head 2cb1eb6c572d:

  • Linux clippy (--os linux ... --arg clippy): job 959c3e7902541b6742d97c71, passed.
  • macOS clippy (--os macos ... --arg clippy): job dd4d4f1bf226f47ffd26fe8c, passed.
  • Linux test cloud_repo (the CLI validation that changed): job 25ffc3f6778f74722cf80f17, passed.
  • Linux full test in 4 shards at e32fc14 (same tree except the two cloud_repo.rs lines): jobs a1b2e5a0, 0e93ccb2, e3276522, 34da764e. One shard passed. The others failed only on tests this PR doesn't change, which are base reds:
    • cmux-tui cli::cloud_help::tests::help_lists_exactly_the_offered_cloud_verbs
    • cmux-tui cli::tests::remote_cli_docs::cloud_help_lists_every_offered_cloud_action
    • cmux-tui::cli agent_session_start::a_first_chat_on_the_callers_own_cloud_vm_starts_in_its_trusted_work_folder
    • cmux-agent-pane-policy::typescript the_allowlist_is_what_the_page_sends
    • acpmux server::remote_guard::cloud_chat_tests::cloud_peer_uses_a_durable_chat_folder. This PR moves the module but doesn't change it. It fails the same way at the tip 16b7cc2 (job 499640aa315de6c7776312d0, exit 100).

Observed / Not run

Observed: the fleet jobs above (clippy red at the tip, clippy green on both platforms at the head, tests as listed). Not run: a full test run at 2cb1eb6 itself; the only change after e32fc14 is the two cloud_repo.rs lines, covered by the cloud_repo filter run. Not built or run on this host.

Changelog

none

Proof

No capture: Rust lint fixes, no UI change.