Skip to content

fix(core) request_permissions tool flakey test - #20744

Closed
dylan-hurd-oai wants to merge 1 commit into
mainfrom
dh--rp--flake-1
Closed

fix(core) request_permissions tool flakey test#20744
dylan-hurd-oai wants to merge 1 commit into
mainfrom
dh--rp--flake-1

Conversation

@dylan-hurd-oai

Copy link
Copy Markdown
Contributor

Summary

Fixes a flaky macOS codex-core test:

approved_folder_write_request_permissions_unblocks_later_apply_patch

The test had two sources of nondeterminism:

  1. It inherited the ambient approvals_reviewer config when the test did not explicitly pass one. On
    machines configured with auto_review, the request_permissions tool call could be routed through
    Guardian instead of emitting the RequestPermissions event the test expected.
  2. expect_request_permissions_event treated any TurnComplete as a failure while waiting for the
    permissions request. In practice, unrelated completion events can be observed before the specific
    permissions event, causing the test to fail even though the expected request may still arrive.

This change makes the test deterministic by defaulting test turns to ApprovalsReviewer::User unless a
subcase explicitly overrides it, and by waiting for the specific RequestPermissions call id. The strict
auto-review subcase also now provides two mocked Guardian allow responses, matching the two review
requests made on that path.

Testing

Ran the test 5 times:
cargo test -p codex-core --test all approved_folder_write_request_permissions_unblocks_later_apply_patch -- --nocapture

@dylan-hurd-oai
dylan-hurd-oai requested a review from a team as a code owner May 2, 2026 05:50
@github-actions

Copy link
Copy Markdown
Contributor

Closing this pull request because it has had no updates for more than 14 days. If you plan to continue working on it, feel free to reopen or open a new PR.

@github-actions github-actions Bot closed this May 17, 2026
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.

2 participants