Repository navigation
Codex app-server repeatedly killed by SIGKILL after memory grows to ~27GB when handling large tool/log output #24048
Copy link
Copy link
Open
Labels
appIssues related to the Codex desktop appIssues related to the Codex desktop appapp-serverIssues involving app server protocol or interfacesIssues involving app server protocol or interfacesbugSomething isn't workingSomething isn't workingperformancetool-callsIssues related to tool callingIssues related to tool calling
Description
What version of the Codex App are you using (From “About Codex” dialog)?
Codex Desktop: please fill from "About Codex" VS Code Codex extension also installed: openai.chatgpt, version 26.519.32039 shown in VS Code Marketplace
What subscription do you have?
Please fill in your plan, e.g. ChatGPT Pro
What platform is your computer?
Darwin 24.5.0 arm64 arm macOS
What issue are you seeing?
Codex Desktop has repeatedly crashed today with:
(code=null, signal=SIGKILL)
The UI asks me to reload Codex. This happened multiple times on 2026-05-22, and once escalated into the whole computer becoming unstable/rebooting.
Observed error messages in the crash screen included:
(code=null, signal=SIGKILL).
Most recent error:
{"timestamp":"2026-05-22T07:26:01.761510Z","level":"WARN","fields":{"message":"could not find callback for Integer(1)"},"target":"codex_app_server::outgoing_message"}
{"timestamp":"2026-05-22T07:26:01.761563Z","level":"WARN","fields":{"message":"could not find callback for Integer(0)"},"target":"codex_app_server::outgoing_message"}
### What steps can reproduce the bug?
I do not have a minimal deterministic repro yet, but the bug happened repeatedly during a Codex crash investigation on 2026-05-22.
Observed pattern:
Run Codex Desktop on macOS.
Have the VS Code Codex extension installed/enabled at the same time, so both Codex Desktop and the VS Code extension may run app-server processes.
In a Codex session, investigate previous crashes or logs using commands that can produce large output, for example:
rg ~/.codex/sessions
/usr/bin/log show
ps -axo ...
Codex app-server memory grows very large.
Eventually the Codex UI shows: (code=null, signal=SIGKILL).
The UI asks to reload Codex. This happened multiple times in one day. In one case the whole computer became unstable and rebooted.
### What is the expected behavior?
Codex app-server should not be able to grow to tens of GB of memory due to tool/log output. Large command output should be capped, streamed, discarded, or backpressured before it is accumulated in app-server memory.
Suggested product-side fixes:
Add a hard output cap before app-server stores or serializes tool output.
Apply streaming discard/backpressure for terminal/log output.
Do not rely only on UI truncation; truncation should happen before backend memory accumulation.
Add memory budget isolation for tool output so one large command cannot kill the app-server.
Consider detecting high-risk commands that may emit unbounded output and require explicit confirmation or automatic output limiting.
If VS Code extension and Codex Desktop both run app-server processes, make this safer or clearer to users.
### Additional information
_No response_
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
appIssues related to the Codex desktop appIssues related to the Codex desktop appapp-serverIssues involving app server protocol or interfacesIssues involving app server protocol or interfacesbugSomething isn't workingSomething isn't workingperformancetool-callsIssues related to tool callingIssues related to tool calling
Activity
github-actions commentedon May 22, 2026
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
jshaofa-ui commentedon May 22, 2026
Proposed Solution: App-Server SIGKILL at ~27GB Memory
Root Cause
The app-server accumulates tool call results and log output in memory without:
Proposed Fix
File:
src/app-server/tool-executor.ts— Enforce tool result size limits:File:
src/app-server/session-manager.ts— Memory monitoring:Key Changes
src/app-server/tool-executor.ts: Add result size limits (1MB default)src/app-server/session-manager.ts: Memory monitoring + evictionsrc/app-server/tools/read-file.ts: Stream large file readssrc/app-server/health.ts: Periodic memory health checksFull solution:
solutions/codex-24048-app-server-sigkill-memory-fix.mdjshaofa-ui commentedon May 22, 2026
Proposed Solution: App-Server SIGKILL at ~27GB Memory
Root Cause
Unbounded memory accumulation across 5 paths:
ThreadHistoryBuilderaccumulates full turn history in memoryPendingCallbackEntryholds references to large tool outputsThreadState.current_turn_historyretains complete historyFix
cat,find,grep, etc.Key Code Change
Full solution:
solutions/codex-24048-app-server-27gb-sigkill-fix.mdw2jmoe commentedon May 27, 2026
This is a pretty important report⚠️
The key point here probably isn't just “large output”, but the absence of a hard execution/output boundary inside the app-server pipeline.
Once tool output becomes effectively unbounded, the system stops behaving like a controlled runtime and starts behaving like a memory sink.
Especially dangerous when:
Really agree with this part:
UI-side truncation alone usually comes too late.
The “tool output budget” idea also feels very important for long-running agent environments. Otherwise a single pathological command can destabilize the whole runtime.
Good catch 👍
docs(codex): record the worker-death investigation and its residual