Skip to content

Memories enabled but no stage-1 outputs generated because imported threads keep has_user_event=0 #17490

Open

Description

@ucalyptus

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.

Activity

  1. added
    bug
    CLI
    session
    on Apr 11, 2026
  2. added
    agent
    and removed
    CLI
    session
    on Apr 11, 2026
  3. lightcloud00 commented on Aug 13, 2026

    @lightcloud00

    Additional macOS reproduction — Desktop 26.803.61601

    A fresh read-only database audit reproduces the issue and shows that the background jobs now complete without producing outputs:

    Signal Observed
    total threads 216
    threads with has_user_event=1 0
    threads with memory enabled 216
    threads with a non-empty first user message 174
    enabled + first-message threads still at has_user_event=0 174
    completed memory_stage1 jobs 4
    completed global-consolidation jobs 1
    stage1_outputs rows 0

    This extends the original report: the pipeline is no longer completely inert—four stage-one jobs and one consolidation job are marked done—but all 174 eligible-looking threads remain excluded and no stage-one output exists.

    Environment: macOS arm64, Codex Desktop 26.803.61601, bundled CLI 0.147.0-alpha.6.5.

    No thread IDs, prompts, paths, account data, or raw database contents are included.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    agentbugmemory

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions