codex - 💡(How to fix) Fix Windows: long input-messages in turn-complete notify payload silently break notify in codex exec [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openai/codex#18309Fetched 2026-04-18 05:56:21
View on GitHub
Comments
1
Participants
2
Timeline
8
Reactions
0
Timeline (top)
labeled ×4renamed ×2commented ×1unlabeled ×1

On Windows, codex exec appears to silently fail when invoking notify for turn completion if the notify payload contains very large input-messages.

A short prompt works normally. A long prompt also completes normally from the user's perspective, but the configured .cmd notify script is never invoked, and codex exec prints no error.

This looks specifically related to the turn-complete notify payload, not to launching codex exec itself.

Error Message

A long prompt also completes normally from the user's perspective, but the configured .cmd notify script is never invoked, and codex exec prints no error. 3. If notify process creation fails, Codex should emit an explicit warning or error instead of failing silently. For 40000 and 112132, the inner exception is:

  • native error code: 206

Root Cause

The initial codex exec launch succeeds in both cases, because the prompt is provided through stdin rather than through the shell command line.

Code Example

@echo off
>>D:\t\n.log echo invoked
exit /b 0

---

Get-Content -Raw .\prompt-short.txt | codex exec --skip-git-repo-check --json -C .\workspace-short -c "notify=['D:/t/n.cmd']" -

---

Get-Content -Raw .\prompt-long.txt | codex exec --skip-git-repo-check --json -C .\workspace-long -c "notify=['D:/t/n.cmd']" -

---

cmd.exe /d /s /c D:\t\n.cmd <very-long-arg>
RAW_BUFFERClick to expand / collapse

Windows: long input-messages in turn-complete notify payload silently break notify in codex exec

Summary

On Windows, codex exec appears to silently fail when invoking notify for turn completion if the notify payload contains very large input-messages.

A short prompt works normally. A long prompt also completes normally from the user's perspective, but the configured .cmd notify script is never invoked, and codex exec prints no error.

This looks specifically related to the turn-complete notify payload, not to launching codex exec itself.

Codex version

codex-cli 0.121.0

Platform

  • Windows 11 Pro 64-bit
  • OS version: 10.0.26200 (build 26200)
  • PowerShell: 5.1.26100.8115

Minimal reproduction

This repro avoids making the initial codex exec command line itself too long.

  1. Create a tiny notify script:
@echo off
>>D:\t\n.log echo invoked
exit /b 0
  1. Run a short prompt through stdin:
Get-Content -Raw .\prompt-short.txt | codex exec --skip-git-repo-check --json -C .\workspace-short -c "notify=['D:/t/n.cmd']" -
  1. Confirm that D:\t\n.log gets a new line.

  2. Run a long prompt through stdin in the same way:

Get-Content -Raw .\prompt-long.txt | codex exec --skip-git-repo-check --json -C .\workspace-long -c "notify=['D:/t/n.cmd']" -

In my repro:

  • prompt-short.txt was small and worked normally
  • prompt-long.txt was about 111,840 characters
  • the equivalent turn-complete notify JSON payload was about 112,132 characters

Important detail

The initial codex exec launch succeeds in both cases, because the prompt is provided through stdin rather than through the shell command line.

The failure happens later, when Codex invokes notify for turn completion.

From the observed behavior, the turn-complete notify payload appears to include the original input-messages, so a large stdin prompt becomes a large notify payload on Windows.

Actual behavior

  • Short prompt:

    • the notify script is invoked
    • codex exec exits 0
    • no stderr output
  • Long prompt:

    • the notify script is never invoked
    • codex exec still exits 0
    • no stderr output
    • the Codex session completes normally and returns the final answer

This suggests the problem is not the initial codex exec invocation, but the later notify invocation using a completion payload that includes large input-messages.

Expected behavior

One of these should happen:

  1. Codex should avoid passing large turn-complete payloads to Windows .cmd notify commands via argv.
  2. Codex should use stdin, a temp file, or another transport for large notify payloads.
  3. If notify process creation fails, Codex should emit an explicit warning or error instead of failing silently.

Additional evidence

On the same machine, I separately reproduced Windows command-line length failures by manually launching:

cmd.exe /d /s /c D:\t\n.cmd <very-long-arg>

Results:

  • 400 chars: script invoked
  • 8000 chars: script invoked
  • 10000 chars: cmd.exe starts, script is not invoked, stderr = The command line is too long.
  • 30000 chars: same as above
  • 40000 chars: process creation fails
  • 112132 chars: process creation fails

For 40000 and 112132, the inner exception is:

  • type: System.ComponentModel.Win32Exception
  • native error code: 206
  • message: The filename or extension is too long

This strongly suggests the silent Codex failure is hitting the same underlying Windows command-line length limitation.

extent analysis

TL;DR

The issue can be worked around by modifying the codex exec command to handle large notify payloads, potentially by using stdin or a temporary file for payload transport instead of passing it as an argument.

Guidance

  • Investigate modifying the codex exec command to use an alternative method for passing large notify payloads, such as using stdin or a temporary file, to avoid hitting the Windows command-line length limitation.
  • Verify that the issue is indeed caused by the large notify payload by testing with different payload sizes and observing the behavior.
  • Consider adding error handling to the codex exec command to emit an explicit warning or error when notify process creation fails due to command-line length limitations.
  • Review the Windows command-line length limitations and how they apply to the codex exec command and the notify script invocation.

Example

No code snippet is provided as the issue is more related to the command-line length limitation and the behavior of the codex exec command rather than a specific code snippet.

Notes

The issue seems to be specific to Windows and the way codex exec handles large notify payloads. The solution may involve modifying the codex exec command or the notify script to handle large payloads in a way that avoids the command-line length limitation.

Recommendation

Apply a workaround by modifying the codex exec command to handle large notify payloads using an alternative method, as the root cause of the issue is the Windows command-line length limitation.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

FAQ

Expected behavior

One of these should happen:

  1. Codex should avoid passing large turn-complete payloads to Windows .cmd notify commands via argv.
  2. Codex should use stdin, a temp file, or another transport for large notify payloads.
  3. If notify process creation fails, Codex should emit an explicit warning or error instead of failing silently.

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING