Thread total count appears to double-count projectless threads

Open 💬 0 comments Opened Jul 2, 2026 by s870488-dev

What version of the Codex App are you using (From “About Codex” dialog)?

26.623.81905

What subscription do you have?

Plus

What platform is your computer?

Darwin 25.5.0 arm64 arm

What issue are you seeing?

The Codex App appears to display an inflated thread total count.
In my local app/state, I saw a displayed thread total of 11. After inspecting local Codex state files, the number appears to be calculated as a raw sum of two sources:

~/.codex/state_5.sqlite
threads table count: 5

~/.codex/.codex-global-state.json
projectless-thread-ids count: 6

Displayed total: 5 + 6 = 11

However, these two sources are not disjoint. In my case, 3 thread ids appear in both sources.
The unique thread count across those sources is therefore:

5 + 6 - 3 overlapping ids = 8 unique thread ids

So the displayed total appears to double-count some projectless threads.
I also tested deleting one rollout/session file under:

~/.codex/sessions/

The displayed thread total did not change from 11, which suggests the count is coming from app/index state rather than the actual session files.
PII redacted example of the local counts:

state_5.sqlite threads:
- count: 5
- one row had rollout_exists = false after I deleted one session file

.codex-global-state.json projectless-thread-ids:
- count: 6

overlap between the two sets:
- count: 3

unique ids across both:
- count: 8

displayed total:
- 11

What steps can reproduce the bug?

  1. Open Codex App and note the displayed thread total count.
  2. Inspect local thread state:
sqlite3 ~/.codex/state_5.sqlite 'select count(*) from threads;'
  1. Inspect projectless thread ids in:
~/.codex/.codex-global-state.json

Specifically check:

projectless-thread-ids
  1. Compare:
  • threads table row count
  • projectless-thread-ids count
  • overlap between the two id sets
  • displayed total in the app
  1. Optional additional check:
  • Delete or move one rollout file under ~/.codex/sessions/
  • Restart or refresh Codex App
  • Observe that the displayed total may remain unchanged because the index/app state still contains the thread metadata.
  1. In my case:
threads table count: 5
projectless-thread-ids count: 6
overlap: 3
unique thread ids: 8
displayed total: 11

What is the expected behavior?

The displayed thread total should either:

  1. Count unique thread ids after deduplicating across local app/index state sources, or
  2. Clarify in the UI that the number is a raw indexed-record count rather than a unique visible thread count.

If the UI label says “thread total”, I would expect it to represent the number of unique threads visible/managed by the app, not threads table count + projectless-thread-ids count with duplicates included.

Additional information

Relevant local files involved in the observed count:

~/.codex/state_5.sqlite
~/.codex/session_index.jsonl
~/.codex/sessions/
~/.codex/.codex-global-state.json

View original on GitHub ↗