Assertion failed in node-pty conpty.cc line 106: remove_pty_baton(baton->id)

Open 💬 4 comments Opened Mar 8, 2026 by TheDutchRuler

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?

  1. Open Codex for Windows app
  2. Try to resume/continue an existing task
  3. The assertion failed dialog appears (node-pty conpty.cc line 106)
  4. Click Abort/Ignore on the dialog
  5. Try to resume the task again -> "Failed to resume task" error
  6. Try to start a new conversation -> "Error starting conversation" error
  7. 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.

View original on GitHub ↗

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