Skip to content

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

Closed

Description

@tm-iands

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:

      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.

  2. 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.

Activity

  1. added
    extension
    on Sep 5, 2025
  2. added
    bug
    windows-os
    on Sep 5, 2025
  3. machado2 commented on Sep 15, 2025

    @machado2

    I got the same problem, had codex fix itself

    #3649

  4. tm-iands commented on Sep 16, 2025

    @tm-iands
    Author

    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!

  5. machado2 commented on Sep 16, 2025

    @machado2

    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:

    "Some commands (e.g. test runners like Playwright) spawn grandchildren that inherit stdout/stderr. Those descendants may keep the inherited FDs open after the main child process exits. Our previous implementation waited for EOF on the pipes, so we could wait forever even though we already observed the child exit (or timeout), leaving Codex blocked."

    It will generate a wrapper in whatever you use to call playwright that handles the stdout and stderr problem

  6. added
    tool-calls
    and removed
    extension
    on Nov 9, 2025
  7. etraut-openai commented on Nov 26, 2025

    @etraut-openai
    Contributor

    This should be fixed in the most recent versions of codex.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugtool-callswindows-os

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions