acpmux: cli_agent tests run hermetic (hermetic_daemon_guard red on base)

Closed
TE
16d ago
+13-2

Summary

hermetic_daemon_guard is red on feat-cmux-next. tests/cli_agent.rs (added with acpmux cli-agent) spawns CARGO_BIN_EXE_acpmux with the host environment and defines no HERMETIC process. So every cmux-tui Rust run fails on it, and that red hides real ones (it showed up on #21896's full cargo test -p acpmux).

The cli-agent tests now start acpmux through daemon_env::command (stand-in agents, the bare system PATH, which has the cat, sh and sleep they run), on a scratch directory under CARGO_TARGET_TMPDIR.

Testing

On huge-blue (Linux):

  • cargo test -p acpmux --test hermetic_daemon_guard: 2 failed on the base (997e4ce6f9c), 2 passed here.
  • cargo test -p acpmux --test cli_agent: 5 passed.
  • cargo fmt -p acpmux --check clean.

Observed / Not run

  • Observed: the runs above.
  • Not run: macOS (CI runs it).

Changelog

none

🤖 Generated with Claude Code


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need.


Summary by cubic

Fixes hermetic_daemon_guard being red on feat-cmux-next by making the cli_agent tests hermetic. They previously spawned acpmux directly with the host environment and didn't declare a HERMETIC process, which made every cmux-tui Rust run fail on it and hid real failures. Now they start acpmux through daemon_env::command with a stand-in agent and run on a scratch directory under CARGO_TARGET_TMPDIR.