Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: bb7732ada7
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| .receive::<EscalateResponse>() | ||
| .await | ||
| .context("failed to receive EscalateResponse")?; | ||
| drop(server_stream_guard); |
There was a problem hiding this comment.
Drop handshake guard before waiting for first response
Holding server_stream_guard across client.receive::<EscalateResponse>().await can deadlock the wrapper if the escalation server exits before replying. In that failure mode the daemon closes its copy of the server endpoint, but this process still has one open, so the client side never observes EOF and the await can block indefinitely. Previously the local server endpoint was dropped immediately after handshake, so a server crash surfaced as an error instead of a hang.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Addressed in d9abab2: the wrapper now drops the handshake guard immediately after sending the first EscalateRequest, and there is a new regression test covering the server-closes-before-replying EOF path.
d9abab2 to
d2e7700
Compare
7eced5c to
90e10bb
Compare
Why
PR #16047 exposed a real macOS zsh-fork bug, and fixing that runtime issue surfaced two follow-up stability problems on this stack:
turn_start_shell_zsh_fork_subcommand_decline_marks_parent_declined_v2test only budgeted 5 seconds for a login-shell flow that can legitimately emit an extra startup approval such as/usr/libexec/path_helper -son macOS before reaching the targetrmsubcommandscodex exec resume --lastwas willing to resume internal sub-agent rollouts, so a newer non-user-facing thread could win theupdated_atsort and steal the resume target from the visible sessionTaken together, those issues kept the PR red even after the macOS fd-handoff fix landed.
What Changed
shell-escalation/src/unix/escalate_client.rs, while still dropping the local guard before waiting for the server reply so EOF is not maskedtimeout_msto 15 seconds so login-shell startup approvals do not consume the entire command budget on slower macOS CI shardscodex-execresume lookup to top-level resumable thread sources (cli,vscode,exec, andapp-server) instead of considering sub-agent and unknown threadscodex-execregression coverage proving thatresume --lastignores a newer internal memory-consolidation rolloutHow I Verified
cargo test -p codex-shell-escalationcargo test -p codex-exec resume -- --nocapturecargo test -p codex-app-server --test all turn_start_shell_zsh_fork_subcommand_decline_marks_parent_declined_v2 -- --nocapturecargo test -q -p codex-app-server --test all turn_start_shell_zsh_fork_subcommand_decline_marks_parent_declined_v23 additional timesjust argument-comment-lint