codex - 💡(How to fix) Fix Memories enabled but no stage-1 outputs generated because imported threads keep has_user_event=0 [1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openai/codex#17490Fetched 2026-04-12 13:27:47
View on GitHub
Comments
0
Participants
1
Timeline
6
Reactions
0
Author
Participants
Timeline (top)
labeled ×4unlabeled ×2

With features.memories = true, Codex appears to have session/thread data available, but the memory startup pipeline never produces any stage-1 outputs or filesystem memory artifacts.

In the affected setup:

  • memory feature is enabled
  • thread/session rows exist in the state DB
  • first_user_message is populated for CLI threads
  • memory_mode is enabled
  • but has_user_event remains 0 for all inspected threads

As a result, no threads appear eligible for memory extraction, and the memory pipeline never produces outputs.

Root Cause

The memory pipeline appears inert because threads with real user prompts still have has_user_event = 0, leaving no eligible threads and no generated memory outputs.

Code Example

[features]
memories = true

---

select id, source, has_user_event, archived, memory_mode, first_user_message
from threads
order by updated_at desc
limit 10;

---

select count(*)
from threads
where source='cli'
  and has_user_event=1
  and archived=0
  and memory_mode='enabled';

---

0
RAW_BUFFERClick to expand / collapse

Summary

With features.memories = true, Codex appears to have session/thread data available, but the memory startup pipeline never produces any stage-1 outputs or filesystem memory artifacts.

In the affected setup:

  • memory feature is enabled
  • thread/session rows exist in the state DB
  • first_user_message is populated for CLI threads
  • memory_mode is enabled
  • but has_user_event remains 0 for all inspected threads

As a result, no threads appear eligible for memory extraction, and the memory pipeline never produces outputs.

Environment

  • Codex CLI version: 0.115.0
  • Platform: macOS arm64
  • Session source: primarily cli

Observed behavior

Config

~/.codex/config.toml contains:

[features]
memories = true

DB state

The local state DB contains thread records, but memory artifacts are not being generated:

  • stage1_outputs count = 0
  • jobs count = 0
  • ~/.codex/memories/ remains empty

The threads table shows:

  • source = 'cli'
  • memory_mode = 'enabled'
  • first_user_message is populated
  • has_user_event = 0

Example query pattern:

select id, source, has_user_event, archived, memory_mode, first_user_message
from threads
order by updated_at desc
limit 10;

In the affected case, first_user_message is populated, but has_user_event is still 0 for all inspected CLI threads.

This also means there are zero eligible rows for a query like:

select count(*)
from threads
where source='cli'
  and has_user_event=1
  and archived=0
  and memory_mode='enabled';

which returns:

0

Why this looks wrong

The thread records clearly have user-originated content (first_user_message is non-empty), but they do not seem to be marked as having a user event. If memory startup eligibility depends on has_user_event, this would prevent stage-1 extraction from ever running on otherwise valid threads.

What I tried

  • confirmed features.memories = true
  • started fresh non-ephemeral root sessions
  • confirmed threads are present in the DB
  • confirmed memory mode is enabled on those threads
  • observed no jobs rows and no stage1_outputs

Expected behavior

If a non-ephemeral root CLI session has a real user prompt and memory_mode='enabled', I would expect it to become eligible for the startup memory pipeline and eventually produce stage-1 outputs and memory artifacts.

Actual behavior

The memory pipeline appears inert because threads with real user prompts still have has_user_event = 0, leaving no eligible threads and no generated memory outputs.

Possible root cause

A thread import / rollout backfill / session persistence path may be failing to set threads.has_user_event = 1 for CLI sessions, even when first_user_message is present.

extent analysis

TL;DR

Update the has_user_event flag to 1 for threads with first_user_message populated to enable memory extraction.

Guidance

  • Investigate the thread import or session persistence logic to determine why has_user_event is not being set to 1 for CLI sessions with first_user_message present.
  • Verify that the memory_mode is indeed enabled for the affected threads and that the features.memories config is correctly applied.
  • Consider adding a temporary workaround to manually update the has_user_event flag for existing threads to test the memory pipeline.
  • Review the SQL query patterns used to determine eligibility for memory extraction to ensure they are correctly filtering threads based on the has_user_event flag.

Example

UPDATE threads
SET has_user_event = 1
WHERE source = 'cli' AND first_user_message IS NOT NULL AND has_user_event = 0;

This example query updates the has_user_event flag for CLI threads with a populated first_user_message field.

Notes

The root cause of the issue appears to be related to the thread import or session persistence logic, but without further information, it is difficult to provide a definitive solution. The suggested workaround and example query are intended to help mitigate the issue and facilitate further investigation.

Recommendation

Apply a workaround to manually update the has_user_event flag for existing threads to enable memory extraction, as the root cause of the issue is not immediately clear and may require further investigation.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

FAQ

Expected behavior

If a non-ephemeral root CLI session has a real user prompt and memory_mode='enabled', I would expect it to become eligible for the startup memory pipeline and eventually produce stage-1 outputs and memory artifacts.

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING