Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9b65a0cd60
ℹ️ 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".
576e61d to
5de0d38
Compare
Follow-up to #18178. This handles the straightforward await-holding cleanup first, without enabling the Clippy lint yet; the long-term goal is to enable the lint in a follow-up once the remaining cases are resolved or explicitly justified.
starr-openai
left a comment
There was a problem hiding this comment.
most changes were pretty trivial. for the ws outbound buffer it seems safe but perhaps the main thing to double check
Pretty sure it should be equivalent in that, in the previous version, I don't believe anyone could call |
Follow-up to #18178, where we called out enabling the await-holding lint as a follow-up.
The long-term goal is to enable Clippy coverage for async guards held across awaits. This PR is intentionally only the first, low-risk cleanup pass: it narrows obvious lock guard lifetimes and leaves
codex-rs/Cargo.tomlunchanged so the lint is not enabled until the remaining cases are fixed or explicitly justified. It intentionally leaves the active-turn/turn-state locking pattern alone because those checks and mutations need to stay atomic.Common fixes used here
These are the main patterns reviewers should expect in this PR, and they are also the patterns to reach for when fixing future
await_holding_*findings:.awaitafter the block.map.lock().await.remove(&id)are acceptable when the guard is only needed for that single mutation and the statement ends before any async work.Semaphoreonly when serialization is intentional across async work. The test serialization guards intentionally span awaited setup or execution, so using a semaphore communicates "one at a time" without holding a mutex guard.stdindirectly; the oldArc<Mutex<_>>did not protect shared access because nothing else had access to the writer.#[expect].What changed
Verification
just fix -p codex-core -p codex-app-server -p codex-rmcp-client -p codex-shell-escalation -p codex-utils-pty -p codex-utils-readinessjust clippy -p codex-corecargo test -p codex-core -p codex-app-server -p codex-rmcp-client -p codex-shell-escalation -p codex-utils-pty -p codex-utils-readinesswas run; the app-server suite passed, andcodex-corefailed in the local sandbox on six otel approval tests plussuite::user_shell_cmd::user_shell_command_does_not_set_network_sandbox_env_var, which appear to depend on local command approval/default rules andCODEX_SANDBOX_NETWORK_DISABLED=1in this environment.