[IDE / VS Code] Sessions misses recently updated conversations because provider limits by created_at
Surface
- VS Code 1.129.1 (arm64, macOS)
- Marketplace extension:
openai.chatgpt26.5715.61943 - View: VS Code/Copilot Sessions, sorted by Updated
This is a VS Code extension report, not a Codex Desktop report. The installed extension has no public repository or issue URL in its Marketplace manifest; I am filing here because openai/codex is the public Codex engineering tracker. Please route it to the IDE-extension owner if that is a separate internal component.
Actual behavior
The Sessions view cannot show many older conversations that were updated recently. Selecting Updated in VS Code does not fix this.
Root cause observed in the shipped extension
The extension registers VS Code's ChatSessionItemProvider, then calls the Codex app server:
{
"limit": 50,
"cursor": null,
"sortKey": "created_at",
"archived": false,
"useStateDbOnly": true
}
It maps only the result's creation time into the VS Code session item:
const createdAtMs = Number(thread.createdAt) * 1000;
return { id, resource, label, timing: { startTime: createdAtMs } };
Therefore VS Code receives only the 50 newest-created candidates. Any conversation created before that cutoff is absent from the provider response, even if it was updated today. UI-side Updated ordering can only reorder the already truncated set.
Expected behavior
A Sessions view sorted by Updated should receive the most recently updated conversations, including older conversations with new activity. The provider should request activity-based ordering/pagination and provide appropriate activity metadata, or use another contract that preserves this user-visible semantic.
Independent secondary observation
The same request uses useStateDbOnly: true. On this machine, ~/.codex/session_index.jsonl contained valid July 20 sessions missing from ~/.codex/sqlite/codex-dev.db table local_thread_catalog, so state-only filtering can be a second source of omissions. This is distinct from the primary created_at/limit defect.
Requested follow-up
Please confirm the owner and intended thread/list contract for IDE history. I would like to prepare a focused fix with regression tests, but I understand that the public Codex repository accepts external PRs only by maintainer invitation.
3 Comments
Proposed fix and PR-ready scope
To make the requested change concrete, I propose the following, subject to maintainer confirmation of the app-server protocol and the VS Code session API semantics.
thread/list(for examplesortKey: "updated_at", if that is the supported value), preserving cursor pagination rather than hard-coding a creation-ordered first page.createdAtas the only time signal for an activity-sorted surface.updated_at. Assert that the IDE-facing provider includes that old-but-recently-updated thread in the first page and that the returned item exposes its activity time. Also retain a case for a thread present insession_index.jsonlbut absent fromlocal_thread_catalog, to define the expecteduseStateDbOnlyreconciliation/fallback behavior separately.This produces two independently reviewable fixes:
If the IDE extension source is private, please identify the owning internal component and apply this as an internal change. If the relevant
thread/listbehavior and tests belong in this public repository, please invite an external PR against the agreed owner and contract.Correction:
thread/listalready has the necessary abstract data and sort keysI verified the current public app-server v2 schema and need to narrow the proposed fix further.
ThreadListResponse.dataalready returns fullThreadvalues with both required fields:ThreadSortKeyalready supports:Therefore the primary issue does not require extending the app-server contract or adding a new provider-neutral summary type. The required abstraction already exists at the public boundary.
The VS Code extension is the lossy adapter. Its current code:
thread/listwithsortKey: "created_at"andlimit: 50;Threadinto an internal summary retaining onlycreatedAt;timing.startTime.The focused primary repair should therefore be in the IDE extension:
sortKey: "updated_at"or the maintainer-preferred existing"recency_at";createdAtandupdatedAtthrough the host adapter (startTime/endTime, subject to VS Code API semantics);updatedAt.The catalog freshness /
useStateDbOnlyobservation remains a distinct secondary issue: it affects whether otherwise valid threads reachthread/listat all. It should not be conflated with the primary IDE adapter ordering/projection defect.Confirming this issue on:
The shipped extension still requests
thread/listwith:The local state database contains 477 active VS Code threads. Comparing the first 50 threads ordered by
created_atwith the first 50 ordered byrecency_atproduces only 42 matches. Therefore, 8 genuinely recent conversations are omitted from or displaced in the visible “recent” set.An older conversation resumed today does not move to the top because the provider truncates by creation time before VS Code can sort the returned items.
Please request
recency_atorupdated_at, expose the corresponding activity timestamp, and support cursor pagination. This also appears related to #36156, since a stale one-time fetch can compound the ordering/truncation problem.