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
💡 Likely answer: A maintainer (etraut-openai, contributor)
responded on this thread — see the highlighted reply below.
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?
- 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.
- 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=1and disabling interactive reporters - Adding
--workers=1and--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.
4 Comments
I got the same problem, had codex fix itself
https://github.com/openai/codex/pull/3649
Thanks a lot for jumping in and linking your PR! 🙏 I just read through #3649 and it really looks like the exact root cause of the issue I reported. I’ll try it out once it gets merged, but it’s already reassuring to know this is being addressed. Really appreciate you taking the time to fix and share this!
If you need it don't wait for someone to merge / fix it, codex will happily write you a workaround if you explain it the problem, that is:
It will generate a wrapper in whatever you use to call playwright that handles the stdout and stderr problem
This should be fixed in the most recent versions of codex.