buzz icon indicating copy to clipboard operation
buzz copied to clipboard

test(acp): harden permission mode regression coverage

Open maxitoon opened this issue 3 months ago • 0 comments

Summary

  • Add a regression test proving the permission-mode request is bounded when an agent accepts stdin but never responds.
  • Add positive end-to-end coverage proving an advertised non-default mode emits session/set_config_option with configId: "mode" and the requested wire value.
  • Add a negative end-to-end gate proving an unadvertised mode emits no session/set_config_option request.

This remains test-only and complementary to #4280, which owns the production-side support for stable configOptions mode advertisements. These tests pin the existing modes.availableModes gate and the existing bounded permission-mode request path; they do not add stable-advertisement behavior or change permission policy.

Related context

  • The current main permission API uses AcceptEdits; the tests were adapted from the published head's removed BypassPermissions value after #4609 merged.
  • #4098 is adjacent context only. Its latest analysis places the reported 60-second failure at session/new, not at the permission-mode setter. This PR does not claim to fix the session/new hang.
  • The subprocess tests are Unix-gated because they exercise the existing Bash/read -t ACP harness path.

Verification

  • cargo fmt --all -- --check
  • cargo test -p buzz-acp --lib permission_mode -- --nocapture — 11 passed
  • cargo test -p buzz-acp --lib — 692 passed
  • cargo test -p buzz-acp --all-targets — 692 library tests, 9 integration tests, and 0 binary tests passed
  • git diff --check

The temporary capture files use unique UUID-based paths and an RAII cleanup guard; subprocesses are explicitly shut down before assertions. No production files are changed.

maxitoon avatar Aug 03 '26 22:08 maxitoon