Codex on Windows keeps tasks “running” indefinitely when Playwright (or npm scripts) spawn child processes

Resolved 💬 4 comments Opened Sep 5, 2025 by tm-iands Closed Nov 26, 2025

What version of the VS Code extension are you using?

0.4.3

Which IDE are you using?

VS Code​

What platform is your computer?

Microsoft Windows NT 10.0.26100.0 x64

What steps can reproduce the bug?

  1. The Codex task stays “running” forever even after the command printed output and should have finished.
  • Example command:

``powershell
pwsh -NoProfile -Command "[Console]::OutputEncoding=[System.Text.Encoding]::UTF8;

$env:CI='1'; npx playwright test tests/e2e/specs/dashboard-error-investigation.spec.ts
--project=chromium-debug --reporter=line --timeout=120000"
``

  • Playwright itself exits in a normal terminal, but inside Codex it never signals completion.
  1. For Playwright HTML report (npx playwright show-report), the process requires pressing Ctrl+C twice to stop.
  • In Codex, this prevents the task from finishing and blocks further runs.

What is the expected behavior?

  • Codex should detect when child processes (started by npx, Start-Process, etc.) finish and mark the task as complete.
  • A single Ctrl+C should be propagated correctly to terminate the Playwright process.
  • Tasks should not remain indefinitely “running”.

What do you see instead?

  • Tasks remain stuck in “running” state indefinitely.
  • HTML report requires Ctrl+C twice to exit.
  • This only occurs when running under Codex on Windows; normal PowerShell runs behave correctly.

Additional information

  • Workarounds attempted:
  • Setting $env:CI=1 and disabling interactive reporters
  • Adding --workers=1 and --max-failures=1
  • Wrapping commands in custom PowerShell scripts with timeouts and PID cleanup
  • These mitigate the issue but do not solve the root cause.

This seems to be specific to Codex’s process handling on Windows, since Playwright itself terminates normally when run outside Codex.

View original on GitHub ↗

This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗