You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Codex Memories stage1 succeeds but global consolidation remains pending and no summary artifact is generated on Windows #23129
Codex Memories appears to be enabled and stage1 extraction is working, but global consolidation does not produce a summary artifact.
This may be related to #21884, but my local state is slightly different: stage1_outputs is not empty and raw memory files are being generated. The issue appears to be in the global consolidation / summary artifact step.
The following files/directories exist and are populated:
~/.codex/memories/raw_memories.md
~/.codex/memories/rollout_summaries/
The local state database also shows memory extraction output:
stage1_outputs: 24 rows
multiple memory_stage1 jobs are done
However, the following summary artifacts are not present:
~/.codex/memories/MEMORY.md
~/.codex/memories/memory_summary.md
The jobs table shows:
memory_consolidate_global with job_key = global
status: pending
last_success_watermark appears to be set
no generated summary artifact appears in ~/.codex/memories/
Some memory_stage1 jobs failed with:
Codex ran out of room in the model's context window. Start a new thread or clear earlier history before retrying.
Expected behavior
If stage1 memory extraction succeeds, Codex should either:
generate/update the summary artifact used by future sessions, or
surface a clear error explaining why global consolidation cannot complete.
Actual behavior
Raw memory files and rollout summaries are created, but the global summary artifact does not appear to be generated. The settings indicate Memories are enabled, but it is unclear whether future sessions can actually use the extracted memories.
Notes
This looks different from a complete memory extraction failure because stage1_outputs contains rows and raw_memories.md is populated. The problem seems to be at or after memory_consolidate_global.
So stage/thread-level extraction appears to be working, but the global consolidation / summary artifacts are not being refreshed.
This looks closely related to the issue described here: raw memory artifacts are generated, but MEMORY.md / memory_summary.md do not get updated. Happy to provide more logs or inspect local state if there is a recommended diagnostic command.
I'm experiencing the exact same thing as you @dufu1483 and I am on Ubuntu 24.04 Linux
drwxrwxr-x 6 user user 4096 Jun 18 23:09 .
drwxrwxr-x 12 user user 4096 Jul 6 20:59 ..
drwxrwxr-x 7 user user 4096 Jun 18 23:09 .git
-rw-rw-r-- 1 user user 42854 Jun 18 02:02 MEMORY.md
drwxrwxr-x 3 user user 4096 Jun 13 22:57 extensions
-rw-rw-r-- 1 user user 7958 Jun 18 02:01 memory_summary.md
-rw-rw-r-- 1 user user 69229 Jul 6 20:26 raw_memories.md
drwxrwxr-x 2 user user 4096 Jun 18 23:08 rollout_summaries
drwxrwxr-x 4 user user 4096 Jun 18 01:59 skills
My skills and rollout_summaries have not updated since June 18 but that's fine. However, MEMORY.md and memory_summary.md have not updated since June 18 either, even though raw_memories.md updated just fine today, and ~/.codex/memories/extensions/ad_hoc/notes/ updated just fine today with 4 new .md files too.
Still present on 0.145.0 (Windows 11), and I think I found the root cause for the missing summary artifact. Sharing analysis + reproduction + a fix outline per CONTRIBUTING.
TL;DR
Global consolidation runs a sub-agent that needs 1–2 minutes to finish. codex exec tears the process down as soon as its own turn ends, so the agent is cut off mid-work and the job is recorded as failed_agent. Giving the process enough lifetime makes the whole pipeline complete and produce both artifacts.
What I observed (0.145.0, Windows, ChatGPT auth)
Phase 1 works fine — memory_stage1 reaches done and raw_memories.md gets real content:
INFO codex_memories_write::phase1: memory stage-1 extraction complete:
1 job(s) claimed, 1 succeeded (1 with output, 0 no output), 0 failed
But memory_consolidate_global ends as failed_agent, and no MEMORY.md / memory_summary.md is written. Logs show the consolidation agent starting and issuing shell_command calls inside the memories root — it just never reaches a final status.
Ruled out by measurement, each tested separately: missing raw material, [windows] sandbox = "elevated", an explicit memories.consolidation_model, a stale lease blocking the job, and turn lengths of 20–30 s.
The deciding experiment
Same setup, but the main turn was made long enough for the background task to finish (a single shell call sleeping ~150 s):
memory_consolidate_global -> done
memories/MEMORY.md 1544 bytes (written by Codex)
memories/memory_summary.md 934 bytes (starts with "v1")
A new session then answered a question that was only ever stated in the earlier, consolidated session — and answered unknown with use_memories = false. So the full chain works; it is a lifetime problem, not a defect in extraction or consolidation logic.
This also explains the two different error codes:
last_error
meaning
failed_agent
sub-agent never reached a final status (loop_agent hits session_termination and returns AgentStatus::Errored)
failed_invalid_artifacts
agent finished, but validate_consolidation_artifacts failed — it requires MEMORY.mdandmemory_summary.md whose first line is exactly v1
I saw failed_invalid_artifacts in an interactive TUI run where phase 1 had produced nothing, i.e. the agent had no material to consolidate.
Why reproducing this is harder than it looks
Three additional conditions are silent — no log line, only a skipped_no_candidates metric — and they made this take a while to isolate:
push_thread_filters restricts candidates to threads.source IN ('cli','vscode') (INTERACTIVE_SESSION_SOURCES). A codex exec session writes source = 'exec' and is never eligible, so memories can only originate from interactive sessions.
min_rollout_idle_hours is .clamp(1, 48)-ed on load. Setting 0 in config.toml silently becomes 1, and the default is 6 — checking right after a session always finds nothing.
Jobs hold a one-hour lease. If the process dies mid-run, the row stays running with a future lease_until and a dead worker_id, blocking further attempts until it expires. (This may be what the pending row in the original report is about, though I could not verify that on 0.130.0.)
Fix outline
In increasing order of effort:
Do not treat process teardown as an agent failure. When loop_agent breaks because of session_termination, the job could be released back to pending instead of being marked failed_agent. As it stands, a normal codex exec run burns a retry attempt and puts the job into backoff for an hour, even though nothing actually went wrong.
Make the silent paths observable.skipped_no_candidates, the min_rollout_idle_hours clamp, and the source restriction are currently invisible at every log level; a single info!/warn! on each would have turned a multi-hour investigation into a two-minute one.
Not verified
I did not test on 0.130.0, so I cannot confirm that the pending state in the original report has the same cause. I also did not check macOS or Linux — the lifetime issue should be platform-independent, but the sandbox interactions may not be.
Reproduced on Windows 10 Home Single Language (build 19045) + Codex 0.146.0 stable (standalone installer via chatgpt.com/codex/install.ps1, install method = standalone, NOT AppX; previous alpha 0.146.0-alpha.3.1 had the same bug).
jobs table has 1 row, kind='memory_consolidate_global', status='done', started_at=1784906285, finished_at=1784906335, input_watermark=0, last_success_watermark=0, last_error=null. Job ran ~50 s, marked itself done with zero watermarks -- no rollouts were actually consumed.
stage1_outputs table: 0 rows.
~/.codex/sessions/2026/07/30/ contains 12 active rollout JSONL files (~6.0 MB) + 5 archived. state_5.sqlite.threads has 17 rows. So source data exists but is never fed into stage1.
codex features list confirms memories stable true. No override on/off mismatch. 31 stable+enabled feature flags.
codex doctor reports 17 ok / 1 idle / 0 warn / 0 fail -- nothing hints at the broken pipeline.
Crucially, there is no manual trigger. Subcommands tried: codex memory, codex features memory, codex recall, codex consolidate -- none exist in 0.146.0. So even with full awareness, an end user cannot force the pipeline to run.
A new in_app_updates feature flag (stable, true) shipped in 0.146.0 -- not sure if it touches the sub-agent lifecycle, but it appears new vs 0.145.0.
Lining up with @reze83's analysis: ~50-second wall-clock for the consolidate-global job matches a sub-agent being cut off mid-flight. Our job's done status with zero watermarks is exactly the symptom of the sub-agent returning early without writing to stage1_outputs.
Environment:
Codex 0.146.0 stable, standalone installer
Windows 10 Home Single Language (build 19045), MSVC toolchain
Activity
github-actions commentedon May 17, 2026
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
dufu1483 commentedon Jul 6, 2026
I’m seeing a very similar issue on Linux / remote CLI, so this may not be Windows-specific.
Environment:
0.142.5gpt-5.5~/.codex/config.tomlhas:Observed behavior:
~/.codex/memories/raw_memories.mdwas updated recently.~/.codex/memories/rollout_summaries/also received new summary files at the same timestamp.~/.codex/memories/MEMORY.mdand~/.codex/memories/memory_summary.mdremain stale and have not been updated since an older date.Example state:
So stage/thread-level extraction appears to be working, but the global consolidation / summary artifacts are not being refreshed.
This looks closely related to the issue described here: raw memory artifacts are generated, but
MEMORY.md/memory_summary.mddo not get updated. Happy to provide more logs or inspect local state if there is a recommended diagnostic command.ipkpjersi commentedon Jul 7, 2026
I'm experiencing the exact same thing as you @dufu1483 and I am on Ubuntu 24.04 Linux
My skills and rollout_summaries have not updated since June 18 but that's fine. However, MEMORY.md and memory_summary.md have not updated since June 18 either, even though raw_memories.md updated just fine today, and
~/.codex/memories/extensions/ad_hoc/notes/updated just fine today with 4 new .md files too.reze83 commentedon Jul 26, 2026
Still present on 0.145.0 (Windows 11), and I think I found the root cause for the missing summary artifact. Sharing analysis + reproduction + a fix outline per CONTRIBUTING.
TL;DR
Global consolidation runs a sub-agent that needs 1–2 minutes to finish.
codex exectears the process down as soon as its own turn ends, so the agent is cut off mid-work and the job is recorded asfailed_agent. Giving the process enough lifetime makes the whole pipeline complete and produce both artifacts.What I observed (0.145.0, Windows, ChatGPT auth)
Phase 1 works fine —
memory_stage1reachesdoneandraw_memories.mdgets real content:But
memory_consolidate_globalends asfailed_agent, and noMEMORY.md/memory_summary.mdis written. Logs show the consolidation agent starting and issuingshell_commandcalls inside the memories root — it just never reaches a final status.Ruled out by measurement, each tested separately: missing raw material,
[windows] sandbox = "elevated", an explicitmemories.consolidation_model, a stale lease blocking the job, and turn lengths of 20–30 s.The deciding experiment
Same setup, but the main turn was made long enough for the background task to finish (a single shell call sleeping ~150 s):
A new session then answered a question that was only ever stated in the earlier, consolidated session — and answered
unknownwithuse_memories = false. So the full chain works; it is a lifetime problem, not a defect in extraction or consolidation logic.This also explains the two different error codes:
last_errorfailed_agentloop_agenthitssession_terminationand returnsAgentStatus::Errored)failed_invalid_artifactsvalidate_consolidation_artifactsfailed — it requiresMEMORY.mdandmemory_summary.mdwhose first line is exactlyv1I saw
failed_invalid_artifactsin an interactive TUI run where phase 1 had produced nothing, i.e. the agent had no material to consolidate.Why reproducing this is harder than it looks
Three additional conditions are silent — no log line, only a
skipped_no_candidatesmetric — and they made this take a while to isolate:push_thread_filtersrestricts candidates tothreads.source IN ('cli','vscode')(INTERACTIVE_SESSION_SOURCES). Acodex execsession writessource = 'exec'and is never eligible, so memories can only originate from interactive sessions.min_rollout_idle_hoursis.clamp(1, 48)-ed on load. Setting0in config.toml silently becomes1, and the default is 6 — checking right after a session always finds nothing.runningwith a futurelease_untiland a deadworker_id, blocking further attempts until it expires. (This may be what thependingrow in the original report is about, though I could not verify that on 0.130.0.)Fix outline
In increasing order of effort:
loop_agentbreaks because ofsession_termination, the job could be released back topendinginstead of being markedfailed_agent. As it stands, a normalcodex execrun burns a retry attempt and puts the job into backoff for an hour, even though nothing actually went wrong.codex exec(deterministic completion point) would make this workable in automation — this overlaps with the request in CLI (headless/exec): synchronously generate memories for a specific session #29430.skipped_no_candidates, themin_rollout_idle_hoursclamp, and thesourcerestriction are currently invisible at every log level; a singleinfo!/warn!on each would have turned a multi-hour investigation into a two-minute one.Not verified
I did not test on 0.130.0, so I cannot confirm that the
pendingstate in the original report has the same cause. I also did not check macOS or Linux — the lifetime issue should be platform-independent, but the sandbox interactions may not be.Cryptamine-ai commentedon Jul 30, 2026
Reproduced on Windows 10 Home Single Language (build 19045) + Codex 0.146.0 stable (standalone installer via
chatgpt.com/codex/install.ps1, install method =standalone, NOT AppX; previous alpha0.146.0-alpha.3.1had the same bug).Concrete evidence on disk:
~/.codex/memories_1.sqlite(memories DB, integrity OK):jobstable has 1 row,kind='memory_consolidate_global',status='done',started_at=1784906285,finished_at=1784906335,input_watermark=0,last_success_watermark=0,last_error=null. Job ran ~50 s, marked itself done with zero watermarks -- no rollouts were actually consumed.stage1_outputstable: 0 rows.~/.codex/sessions/2026/07/30/contains 12 active rollout JSONL files (~6.0 MB) + 5 archived.state_5.sqlite.threadshas 17 rows. So source data exists but is never fed into stage1.codex features listconfirmsmemories stable true. No override on/off mismatch. 31 stable+enabled feature flags.codex doctorreports17 ok/1 idle/0 warn/0 fail-- nothing hints at the broken pipeline.codex memory,codex features memory,codex recall,codex consolidate-- none exist in 0.146.0. So even with full awareness, an end user cannot force the pipeline to run.A new
in_app_updatesfeature flag (stable, true) shipped in 0.146.0 -- not sure if it touches the sub-agent lifecycle, but it appears new vs 0.145.0.Lining up with @reze83's analysis: ~50-second wall-clock for the consolidate-global job matches a sub-agent being cut off mid-flight. Our job's
donestatus with zero watermarks is exactly the symptom of the sub-agent returning early without writing tostage1_outputs.Environment: