Write tool with large content causes exec-server relay disconnect → reconnect loop since 0.140+
Open 💬 0 comments Opened Jun 23, 2026 by czd1309070272
What version of Codex CLI is running?
0.141.0
What subscription do you have?
pro20x
Which model were you using?
gpt-5.5-codex
What platform is your computer?
windows
What terminal emulator and version are you using (if applicable)?
_No response_
Codex doctor report
What issue are you seeing?
## Environment
- Codex CLI version: 0.141.0 (also reproducible on 0.140.x)
- OS: Windows 11 Pro 10.0.26200
- Shell: Git Bash (MINGW64)
- Terminal: Windows Terminal
## Expected Behavior
File writes successfully.
## Actual Behavior
- Short files (under ~200 lines): works fine.
- Long files: Codex begins writing, then shows "Reconnecting", reconnects, retries the write, disconnects again →
infinite loop. The file never completes.
- Downgrading to 0.139.0 completely resolves the issue. Upgrading back to 0.140+ reproduces it consistently.
## Likely Related Changes
- #28286 (restore exec-server relay keepalives) — suggests keepalive handling changed around the threshold that breaks
large tool-call results
- #28234 (MCP tool timeout increased to 300s) — suggests timeout values were recently adjusted
- The large session memory/latency optimizations in 0.140/0.141 may have introduced a regression where large Write
tool call payloads exceed the relay timeout or trigger a premature keepalive disconnect
## Workaround
Downgrade to 0.139.0: npm install -g @openai/codex@0.139.0
What steps can reproduce the bug?
- Install latest Codex CLI (
npm install -g @openai/codex) - In any directory, start a codex session
- Ask it to write a long file (e.g., a 500+ line markdown document or a 300+ line code file)
What is the expected behavior?
_No response_
Additional information
_No response_