(code=3221226505, signal=null). Most recent error: memory allocation of 524288 bytes failed note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Open 💬 10 comments Opened Apr 8, 2026 by Monster-DP
💡 Likely answer: A maintainer (github-actions[bot], contributor)
responded on this thread — see the highlighted reply below.
What version of the Codex App are you using (From “About Codex” dialog)?
26.325.3894.0
What subscription do you have?
API KEY
What platform is your computer?
WIN11
What issue are you seeing?
老是崩溃,我的就是开子代理容易崩溃,经常遇到。
<img width="1453" height="1019" alt="Image" src="https://github.com/user-attachments/assets/c6581a65-e412-4213-8397-3a59f4469b32" />
What steps can reproduce the bug?
不知道如何复现,多开几个子代理运行?我不确定。
What is the expected behavior?
不崩溃
Additional information
_No response_
10 Comments
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
Thanks for the report. The screenshot/error is consistent with the Codex engine aborting on out-of-memory: on Windows the Rust allocator abort can appear as code=3221226505 / 0xc0000409, and the 524288-byte allocation is likely just the allocation that finally failed.
The most likely trigger is subagent memory multiplication: full-context spawned agents load/fork the parent rollout, reconstruct it into their own in-memory model history, and run as separate Codex sessions. A few sub-agents from a large parent thread can therefore consume much more memory than expected.
Could you add logs/session details via
/feedback, and also share:[agents].max_threadsThat should let us confirm the OOM path and distinguish it from the other Windows crash/restart-loop issues.
同时运行的子代理 2个3个?我不确定,我是直接挂后台让他全自动运行的。
我没有改过
[agents].max_threads。代理是否在生成时包含完整上下文/叉上下文, 这个我不确定。
经过长时间的对话才会崩溃。
下面是我的系统提示词
`
你是本仓库唯一主 Agent / 主编排 Agent / 技术编排中枢。
你的职责是统筹、拆解、派发、审核、验证、提交、合回、清理和持续推进。
你的角色是“项目总负责人 / 项目经理 / 技术编排中枢”,不是一线执行开发。
【核心身份定位】
【模型与派发规则】
gpt-5.4gpt-5.4spawn_agent【全盘接管但不亲自实现】
git状态与 diff【主 Agent 禁止事项】
request_user_input【仓库与输出约束】
D:\Mix\code\auto-novelgit commit message必须使用中文AGENTS.md的阅读顺序、实现边界、真源优先级与回写顺序【总目标与连续推进原则】
DV-*、RUN-REAL-*、RB-REAL-*、EB-*都只是里程碑,不是停点【新会话强制启动步骤】
EXECUTION-PLAN.mdTASK-CARDS.mdgit状态AGENTS.md指定的默认阅读入口【superpower 技能调用规则】
using-superpowersbrainstormingwriting-plansusing-git-worktreesdispatching-parallel-agentssubagent-driven-developmenttest-driven-developmentsystematic-debuggingrequesting-code-reviewverification-before-completionfinishing-a-development-branch【子代理使用原则】
【每个子代理任务必须明确】
【子代理异常恢复硬规则】
如果子代理出现以下任一情况:
429running很久无结论BLOCKEDNEEDS_CONTEXT主 Agent 必须执行以下流程:
10s3次如果
3次后仍失败:【防空转 / 防死循环规则】
3/3重试仍失败,认定为“平台层阻塞”,不得无限重派【高优先级改道规则】
如果发现以下情况:
则:
【质量控制】
【验证与提交规则】
【关闭与资源控制】
【阶段性汇报格式】
每次阶段性汇报固定包含:
如果发生子代理异常,还必须额外汇报:
【项目特定提醒】
`
Could you share the logs and session through
/feedback?/feedback没有用无法导出<img width="3456" height="2040" alt="Image" src="https://github.com/user-attachments/assets/600ea6dd-5102-4dad-b450-9407b6582b24" />
019d7a34-0f7a-7a61-bdbb-c3b1199d87e8
<img width="3456" height="2040" alt="Image" src="https://github.com/user-attachments/assets/39259f38-1351-4447-aa82-80f2faad97fe" />
same issue
codex-cli 0.128.0
<img width="2545" height="783" alt="Image" src="https://github.com/user-attachments/assets/b2d26405-7005-457f-8e1f-a59e0105cc32" />
I am getting the exact same issue.
<img width="702" height="418" alt="Image" src="https://github.com/user-attachments/assets/54f55f52-5355-4208-bff2-084e79a51f84" />
same question!
But i run a command in Windows PowerShell:
And i found
So when i change
defaulttoflex, the codex can use.Adding a current recurrence from a sustained Windows Desktop Codex session that appears to be the same crash family, but with a reduced error payload.
Environment/pattern:
Crash text shown by the app:
What makes this hard to recover from:
Expected behavior:
RUST_BACKTRACE=1.