Repository navigation
Description
What version of the IDE extension are you using?
26.908.40401
What subscription do you have?
Pro
Which IDE are you using?
VS Code
What platform is your computer?
Microsoft Windows NT 10.0.26200.0 x64
What issue are you seeing?
I can reproduce this with persisted VS Code threads.
The affected threads are still present locally:
- state_5.sqlite exists and codex doctor reports integrity OK
- the VS Code threads are present in the database
- the corresponding rollout .jsonl files are still present on disk
- codex resume --all correctly lists my older persisted threads
However, trying to resume some of them with: codex resume <UUID>
correctly resolves the rollout file, then fails with: "thread/resume failed: list_turns is not supported yet (code -32601)"
For another persisted VS Code thread, I instead get: "Error: failed to load a bounded thread history page"
I also tested older Codex versions, but the affected threads still could not be resumed. I have not modified the SQLite DB or rollout files.
So in my case the threads are discoverable and indexed correctly; the failure occurs specifically when Codex tries to load/resume their history.
What steps can reproduce the bug?
-
Open VS Code on Windows 11 with the OpenAI Codex extension.
-
Open the Codex chat history and select an existing persisted conversation that previously worked normally.
-
Try to resume/open the conversation.
-
The conversation fails to load and Codex reports:
Failed to resume chat
list_turns is not supported yet
The affected conversations are still present locally and are still discoverable.
As an additional diagnostic, I tested the same affected threads with Codex CLI 0.154.0:
codex resume --allThe older VS Code threads are correctly listed.
Trying to resume one directly:
codex resume <THREAD_UUID>locates the corresponding rollout file successfully, but then fails while loading the history with:
thread/resume failed:
list_turns is not supported yet (code -32601)
On another affected thread, I get:
Error: failed to load a bounded thread history page
codex doctor reports that state_5.sqlite exists and has valid integrity, and the affected threads and their rollout files are still present locally.
The issue therefore appears to happen during history loading/resume, rather than thread discovery.
What is the expected behavior?
No response
Additional information
No response
Activity
argszero commentedon Sep 15, 2026
Root-caused on
main(7784318b5f). The-32601is not a missing capability — it is a per-thread gate on the persistedhistory_mode, and the message is misleading for exactly this case.The chain
thread/resume→paginated_resume_initial_turns_pagecallsthread_store.list_turns(...)(app-server/src/request_processors/thread_processor.rs:3371).LocalThreadStoredoes implementlist_turns(thread-store/src/local/mod.rs:684) and advertises paginated support whenever a state DB is present:supports_paginated_history_lists()is implemented asself.state_db.is_some()(local/mod.rs:680). That is why the paginated path is chosen at all.validate_thread_for_paginated_reads(thread-store/src/local/thread_history/read.rs:176) switches onmetadata.history_modeatread.rs:200-203— aLegacyrow yieldsThreadStoreError::Unsupported { operation }, while aPaginatedrow passes the check.Unsupportedis then mapped byunsupported_thread_store_operation(thread_processor.rs:5867-5869) tomethod_not_foundwith the textlist_turns is not supported yet— i.e. -32601.So the store is "supported" at the store level and "unsupported" at the row level, and the error the user sees describes the former while the condition is the latter. This also explains why everything else in your report looks healthy:
codex doctor,codex resume --all, the state DB and the rollout files are all consistent — only history reads pass through this validator.Your second error is the same gate.
failed to load a bounded thread history pageis the TUI wrapper (tui/src/app_server_session/history.rs:151) aroundthread/turns/list, which lands on the same store call (thread_processor.rs:3206). Two user-visible strings, one validator.Why these threads stayed
Legacy.ThreadHistoryModedefaults toLegacy(state/src/model/thread_metadata.rs:257; the column itself defaults to'legacy', migration0040_threads_history_mode.sql), and a row is only flipped toPaginatedby the rollout migration (state/src/extract.rs:663). Startup migration (thread-store/src/local/rollout_migration/startup.rs:61) processes everything on its first run, but afterwards it is incremental and deliberately never revisits most rows:startup.rs:294-295: "background skips are permanent now" (reasonsempty/failed/malformed_session_meta; onlybusyis retried,startup.rs:164);CURSOR_LOOKBACK_SECONDS = 48 * 60 * 60,startup.rs:44; filter atstartup.rs:92-107), so rows older than that window are never reconsidered.This matches your note that downgrading Codex does not help: the mode is persisted per row and the resume path is version-independent.
Recovery already exists. The manual migration enumerates all rollouts under
CODEX_HOMEand does not consult the skip list or the lookback window — theManualtrigger usesRolloutMigrationPaths::Discover(rollout_migration.rs:329-334; the skip table is read only instartup.rs:67/:72):A dry run first is worth it: the same command reports
failed/malformed_session_metafor rollouts it cannot migrate, which would explain a row that staysLegacyeven afterwards.Confirming which case you are in (state DB is
state_5.sqlitein your Codex home; these are read-only queries):A row with
history_mode = 'legacy'plus a matchingskip_reasonrow means it was skipped permanently by design, and only the manual migration will retry it.Suggestion for a fix (maintainer's call which shape): the store-level gate and the row-level gate should not share one error. Either the resume/list path should fall back to the legacy read when
history_mode = Legacyrather than reporting method-not-found, orunsupported_thread_store_operationshould distinguish "no state DB" from "this thread is not migrated yet" and point atcodex migrate-rollouts. Happy to prototype either if that is useful.maxime3gilot-source commentedon Sep 16, 2026
I checked and found an inconsistency for the affected thread.
For the same thread UUID :
state_5.sqlitereportshistory_mode = 'legacy'session_metacontains"history_mode": "paginated"codex migrate-rollouts --thread <UUID> --jsonreports"status": "already_paginated"So the rollout itself appears to be migrated, but the corresponding thread metadata in
state_5.sqliteis stilllegacy.That would seem to explain both behaviors:
migrate-rolloutsdoes nothing because it considers the rollout already paginatedthread/turns/liststill hits the Legacy per-thread gate when resumingIs there a supported way to resync/update the persisted
history_modein the state db for this case or shouldmigrate-rolloutsbe repairing this mismatch ?Thank you
argszero commentedon Sep 16, 2026
That is exactly the state I could not verify from the original report — thanks for digging into the DB. Short answer: there is a supported resync, and your command did not run it —
--jsonis not the switch,--applyis.Why
--jsoncould not have changed anything--jsononly selects the output format. The mode is chosen by--applyalone (codex-rs/cli/src/migrate_rollouts.rs:23-25,:70-74):and in dry-run the store is built without a state DB at all (
:88-96):Every promotion is guarded on that DB (
codex-rs/thread-store/src/local/rollout_migration.rs:1090—if let Some(state_db) = &self.state_db), so a dry run cannot writestate_5.sqliteby construction.That is also why
already_paginatedsays nothing about your SQLite row: the migration decides it from the rollout file only.migrate_rollout_pathbuilds its metadata fromcodex_rollout::read_session_meta_line(&path)(rollout_migration.rs:384) and short-circuits when that header says paginated (:481), returningRolloutMigrationStatus::AlreadyPaginated(:517). Your two sources of truth were simply never compared.The resync
In Apply mode the already-paginated branch calls
promote_legacy_name(rollout_migration.rs:513-517), which callsmark_thread_paginated— the only production writer of that column (codex-rs/state/src/runtime/threads.rs:68-93):Notes on running it:
paginatedand has a non-emptynameit returns early (rollout_migration.rs:1098-1105), so a repeat run is harmless. This "rerun rewrites the row" behaviour is documented bymigration_repairs_a_missing_paginated_name_when_rerun(codex-rs/thread-store/src/local/rollout_migration_tests.rs:2277), which asserts statusAlreadyPaginatedwhile the SQLite row is repaired.nameis empty it gets backfilled from the legacy title/name index, so the thread may show a display name it did not show before. Worth knowing if you diff the DB afterwards.state_5.sqlite(and its-wal) before an apply run costs nothing.validate_thread_for_paginated_readsrejects onlyThreadHistoryMode::Legacy(thread-store/src/local/thread_history/read.rs:200-203).Two gaps your mismatch did expose
I would call these gaps rather than your error:
rollout_migration/startup.rs:268-272) and, when every candidate comes backPaginated/Skipped, it skips the migration run entirely and only advances its cursor (:116,:127). So a rollout whose header says paginated while its row says legacy is never reconciled on its own — it stays-32601until someone runs--applyby hand. That is exactly your case.already_paginatedreads as "nothing to do" while the row is stale. Reporting the row'shistory_modenext to it (or a "would promote on--apply" note) would have told you immediately.I am happy to put up a patch for either. (1) is a design call — startup deliberately avoids re-reading rollouts — but (2) looks like a low-risk reporting improvement.
Could you confirm what the row says after
--apply? If it is stilllegacy, that is a different and more interesting bug, and the per-thread statuses printed by--applywould be the next thing I would want to see.maxime3gilot-source commentedon Sep 16, 2026
Confirmed — this fixed the issue on my machine.
For the affected thread, I had the following inconsistent state:
session_meta:history_mode = "paginated"state_5.sqlite:history_mode = "legacy"Running:
still reported
status: "already_paginated", but the apply run updated the SQLite state. After that, the thread resumed successfully in Codex CLI and opened normally again in the VS Code extension.I then checked my other VS Code threads and found 106 still marked as
legacy. I applied the same migration to those threads, and afterwards:returned:
After reloading VS Code, the previously affected conversations are opening normally again.
One additional issue I encountered: a global
aborted because one rollout was missing its SQLite metadata, so I had to migrate the valid SQLite-backed threads individually.
Based on this reproduction, two improvements might be worth considering:
paginatedwhile its SQLite metadata is stilllegacy, so manualmigrate-rollouts --applyis not required.list_turns is not supported yetwhen this specific metadata mismatch is detected.It may also be worth allowing a global rollout migration to continue past a rollout with missing SQLite metadata, while reporting that rollout separately.
Thanks again — the diagnosis and the
--applyrecovery path solved the issue here.