buzz
buzz copied to clipboard
test(acp): harden permission mode regression coverage
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_optionwithconfigId: "mode"and the requested wire value. - Add a negative end-to-end gate proving an unadvertised mode emits no
session/set_config_optionrequest.
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
mainpermission API usesAcceptEdits; the tests were adapted from the published head's removedBypassPermissionsvalue 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 thesession/newhang. - The subprocess tests are Unix-gated because they exercise the existing Bash/
read -tACP harness path.
Verification
cargo fmt --all -- --checkcargo test -p buzz-acp --lib permission_mode -- --nocapture— 11 passedcargo test -p buzz-acp --lib— 692 passedcargo test -p buzz-acp --all-targets— 692 library tests, 9 integration tests, and 0 binary tests passedgit 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.