Windows: long input-messages in turn-complete notify payload silently break notify in codex exec
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(build26200) - PowerShell:
5.1.26100.8115
Minimal reproduction
This repro avoids making the initial codex exec command line itself too long.
- Create a tiny notify script:
@echo off
>>D:\t\n.log echo invoked
exit /b 0
- 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']" -
- Confirm that
D:\t\n.loggets a new line.
- 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.txtwas small and worked normallyprompt-long.txtwas about111,840characters- the equivalent turn-complete notify JSON payload was about
112,132characters
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 execexits0- no stderr output
- Long prompt:
- the notify script is never invoked
codex execstill exits0- 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:
- Codex should avoid passing large turn-complete payloads to Windows
.cmdnotify commands via argv. - Codex should use stdin, a temp file, or another transport for large notify payloads.
- 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:
400chars: script invoked8000chars: script invoked10000chars:cmd.exestarts, script is not invoked, stderr =The command line is too long.30000chars: same as above40000chars: process creation fails112132chars: 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.
This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗