Assertion failed in node-pty conpty.cc line 106: remove_pty_baton(baton->id)
What version of the Codex App are you using (From “About Codex” dialog)?
Latest windows version (there is no about codex dialog)
What subscription do you have?
Pro
What platform is your computer?
Windows 11 (10.0.26200)
What issue are you seeing?
When using Codex for Windows, a Microsoft Visual C++ Runtime Library assertion error dialog appears.
Error details:
Assertion failed!
Program: ...e_modules\node_pty\prebuilds\win32-x64\conpty.node
File: D:\a\_work\1\s\src\win\conpty.cc
Line: 106
Expression: remove_pty_baton(baton->id)
The dialog has Abort / Retry / Ignore buttons. This appears to be an issue with the node-pty conpty backend where a pty baton handle is being removed but fails the assertion check
Additional issue: "Failed to resume task"
When starting Codex and trying to continue/resume an existing task, a red error notification appears saying "Failed to resume task". This may be related to the assertion failure above..
Additional issue: "Error starting conversation"
After the above errors, attempting to start a new conversation/topic also fails with a red error notification saying "Error starting conversation". The app appears to be in a broken state where neither resuming existing tasks nor starting new ones works.
What steps can reproduce the bug?
- Open Codex for Windows app
- Try to resume/continue an existing task
- The assertion failed dialog appears (node-pty conpty.cc line 106)
- Click Abort/Ignore on the dialog
- Try to resume the task again -> "Failed to resume task" error
- Try to start a new conversation -> "Error starting conversation" error
- The app is now in a broken state and needs to be restarted
What is the expected behavior?
Codex should resume existing tasks and start new conversations without any assertion errors. The terminal/PTY should be created and managed without crashes.
Additional information
The assertion failure originates from node-pty's Windows ConPTY backend (conpty.cc line 106, expression: remove_pty_baton(baton->id)). This suggests a PTY handle is being freed while still referenced. After this assertion, the app enters a broken state where neither resuming tasks nor starting new conversations works. The session rollout log from ~/.codex/sessions/ shows only the initialization phase completed before the crash. The codex-tui.log did not contain errors for this timeframe.
4 Comments
The reason is most likely a misconfiguration in codex settings as this was the last thing i did to setup multi agents in codex
codex://threads/019ccdcd-3fe5-7723-9e4f-0620a2b87b34
When i run codex cli in the repo folder i indeed get a config error.
So this is what must have tripped Codex for Windows up.
PS C:\Users\rreit\source\repos\TheDutchRuler\Xtraworks> codex
Error loading configuration: agents.architect.config_file must point to an existing file at C:\Users\rreit\source\repos\TheDutchRuler\Xtraworks\.codex\.codex\agents\architect.toml: The system cannot find the path specified. (os error 3)
the issue is now fixed by claude
● All 15 config_file paths are fixed. The root cause was that Codex resolves config_file paths relative to the .codex/
directory where config.toml lives, so the .codex/ prefix doubled up. Changed all paths from .codex/agents/<name>.toml
→ agents/<name>.toml. Running codex should now load cleanly.
--
but the bug is still that Codex for Windows should not have crashed. It either should have diagnosed the issue and fixed it. or it should have just reverted to default with a warning message.
I can reproduce this on Windows when closing the Codex desktop app.
Version: 26.313.41514
Platform: Windows
Action: closing the Codex app window
Crash dialog:
Microsoft Visual C++ Runtime Library
Assertion failed!
Program: ...e_modules\node-pty\prebuilds\win32-x64\conpty.node
File: D:\a\_work\1\s\src\win\conpty.cc
Line: 106
Expression: remove_pty_baton(baton->id)
This happened during app shutdown, not while running my own C++ code.
It looks like a terminal/ConPTY shutdown bug in node-pty when the app closes.