Codex gets stuck while performing pnpm test, since after running the tests vitest requires the user to press q to exit the testing dialog

Resolved 💬 4 comments Opened Sep 17, 2025 by adspiceprospice Closed Jan 17, 2026
💡 Likely answer: A maintainer (etraut-openai, contributor) responded on this thread — see the highlighted reply below.

What version of Codex is running?

0.4.10

Which model were you using?

gpt-5-codex-medium

What platform is your computer?

macos 26

What steps can reproduce the bug?

When the agent is working on a project with vitest testing suite and has to run the test suite to validate its work, it will get stuck after running the test, not moving on to the next step

What is the expected behavior?

_No response_

What do you see instead?

_No response_

Additional information

_No response_

View original on GitHub ↗

4 Comments

FaBeyyy · 11 months ago

run vitest runand not in watch mode

nicholaswmin · 11 months ago

Always mention in your AGENTS.md that it should use timeout <seconds> <cmd> for running commands, otherwise it ill get stuck; especially true on test suites.
node is notorious for it's quirky exit behaviour and there's a lot of people that don't know any better leaving open handles - that's bound to happen.

On macOS you have to install it by brew install coreutils.

sergx · 9 months ago

You can set time limit like this for 20 seconds
"test:unit": "(vitest && exit 0) & pid=$!; sleep 20 && kill $pid 2>/dev/null & wait $pid"

Or as a better option:
"test:unit": "vitest run"
in this case tests will be closed right after executing

etraut-openai contributor · 7 months ago

Closing out old bugs.