Skip to content

agentHost: let tests shorten the Codex turn snapshot wait - #343817

Merged
Logan Ramos (lramos15) merged 1 commit into
mainfrom
lramos15/codex-snapshot-wait-test-speed
Oct 29, 2026
Merged

Logan Ramos (lramos15) merged 1 commit into
mainfrom
lramos15/codex-snapshot-wait-test-speed

Conversation

@lramos15

@lramos15 Logan Ramos (lramos15) commented Oct 23, 2026 •

Copy link
Copy Markdown
Member

Two tests in codexTurnDiff.integrationTest.ts deliberately keep a Codex turn running past the 30 s wait for its file snapshots (waitForTurnEdits in codexAgent.ts), so each took about 62 s:

  • a turn observed while it runs past the snapshot wait keeps its edits
  • a steered native turn running past the snapshot wait keeps both host turns' edits

Together they added about 2 min to every <OS> (run) / Electron job. That file was the slowest node.js integration test file, at 2.5–3.4 min.

The wait can now be overridden with VSCODE_AGENT_HOST_CODEX_TURN_EDITS_WAIT_MS, like the existing VSCODE_AGENT_HOST_SESSION_RELEASE_RETRY_MS integration test override, and those two tests use 1 s. Their turns stay paused until the test releases them, so they still outlast the wait. The other tests in the file keep the 30 s default, so they don't become timing-sensitive. The product default is unchanged.

Saves: about 1.9 min of runner time per Electron integration job, on every OS (about 6–7 runner-minutes per PR run). With the CI split PRs (#343812 to #343816) merged, this is no longer on the slowest path, so it mostly saves compute.

Validation

  • ./scripts/test-integration.sh --run src/vs/platform/agentHost/test/node/providerIntegration/codexTurnDiff.integrationTest.ts --grep "snapshot wait": 2 passing, in 6.4 s and 2.2 s (about 62 s each in CI).
  • ./scripts/test-integration.sh --run src/vs/platform/agentHost/test/node/providerIntegration/codexTurnDiff.integrationTest.ts: 21 passing in 40 s.
  • npm run eslint -- src/vs/platform/agentHost/common/agentService.ts src/vs/platform/agentHost/node/codex/codexAgent.ts src/vs/platform/agentHost/test/node/providerIntegration/codexTurnDiff.integrationTest.ts: clean.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The change is narrowly scoped, preserves default behavior and test synchronization, and has no unresolved findings.

No open issues 🎉

What changed in this PR

This PR reduces Codex integration-test runtime by allowing tests to shorten the file-snapshot wait, while preserving the 30-second product default.

Changes:

  • Adds an environment-variable override for the Codex turn snapshot wait.
  • Applies a 1-second wait only to the two timeout scenarios, retaining their explicit pause/release synchronization.
  • Leaves other tests on the default timeout, avoiding broader timing sensitivity.
File Description
src/​vs/​platform/​agentHost/​test/​node/​providerIntegration/​codexTurnDiff.integrationTest.ts Passes the shorter wait to the two timeout tests.
src/​vs/​platform/​agentHost/​node/​codex/​codexAgent.ts Reads the override with a 30-second fallback.
src/​vs/​platform/​agentHost/​common/​agentService.ts Declares and documents the override environment variable.

Review effort: Balanced

@lramos15
Logan Ramos (lramos15) force-pushed the lramos15/codex-snapshot-wait-test-speed branch 6 times, most recently from 734bc33 to b83c338 Compare October 25, 2026 23:05
Two Codex turn diff integration tests keep a turn running past the 30s wait
for its file snapshots, so each took about 62s and they added 2 min to every
Electron integration test run in CI. A new
VSCODE_AGENT_HOST_CODEX_TURN_EDITS_WAIT_MS override, like the existing session
release retry override, lets these two tests use a 1s wait. Their turns stay
paused until the test releases them, so they still outlast the wait. Locally
they now take 6.4s and 2.2s.

Co-authored-by: Copilot <[email protected]>
@lramos15
Logan Ramos (lramos15) force-pushed the lramos15/codex-snapshot-wait-test-speed branch from b83c338 to 29ce778 Compare October 26, 2026 11:36
@lramos15
Logan Ramos (lramos15) marked this pull request as ready for review October 29, 2026 13:59
@lramos15
Logan Ramos (lramos15) merged commit 7aa83d6 into main Oct 29, 2026
44 checks passed
@lramos15
Logan Ramos (lramos15) deleted the lramos15/codex-snapshot-wait-test-speed branch October 29, 2026 13:59
@vs-code-engineering vs-code-engineering Bot added this to the 1.145.0 milestone Oct 29, 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.

3 participants