Stabilize standalone user shell context test#23614
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ef68474214
ℹ️ 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".
| assert!( | ||
| session.reference_context_item().await.is_none(), | ||
| "standalone shell tasks should not mutate previous context" | ||
| ); |
There was a problem hiding this comment.
Wait for the shell task before asserting context state
With this change the assertion runs immediately after run_user_shell_command() returns, but the standalone shell work is executed in the task spawned by spawn_task; run_user_shell_command() can return before UserShellCommandTask::run has executed the code path that would mutate reference_context_item. In that interleaving, a regression that sets the baseline during the background shell task would still pass because the task is then aborted after the early assertion. Please wait for a deterministic signal that the spawned task has reached or completed the relevant shell execution path before checking the context state.
Useful? React with 👍 / 👎.
ef68474 to
d2c9132
Compare
Why
rust-ci-fullrun26140060917failedcodex-core::session::tests::run_user_shell_command_does_not_set_reference_context_itemonwindows-x64-shard-2after both nextest attempts timed out waiting forTurnComplete.That wait is not part of the invariant this test protects. The regression would happen when the standalone shell task is scheduled and seeds the regular-turn baseline; the test only needs to assert that
reference_context_itemremains unset afterrun_user_shell_command()returns.What Changed
run_user_shell_command_does_not_set_reference_context_item.Verification
26140060917/ job76885730325.git diff --check