Fix launcher session recency and complete previews - #3
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f63515eef4
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| mtime: latestMessageAt | ||
| || (session.mtimeMs ? new Date(session.mtimeMs).toISOString() : new Date(file.mtimeMs).toISOString()), | ||
| mtimeSource: latestMessageAt ? "last-visible-message" : "file-mtime", |
There was a problem hiding this comment.
Avoid capping scans with stale file mtimes
When latestMessageAt is present, summary.mtime no longer matches the file stat time, but ascListEngine() still sorts candidates by file.mtimeMs and stops as soon as the requested limit is reached. On a bounded launcher/API request, transcripts touched by later bookkeeping can consume the scan limit even though their last visible messages are older, so sessions with newer visible messages but lower file mtimes are never parsed and cannot be restored by the final applyListFilters() sort. Please avoid early-stopping on file mtime, or scan/re-rank by the same last-message timestamp used here.
Useful? React with 👍 / 👎.
| continue; | ||
| } | ||
| summary = stampSummary(rawSummary); | ||
| summary = upgradeCachedMessageTime(db, row, stampSummary(rawSummary)); |
There was a problem hiding this comment.
Re-sort cached rows after upgrading recency
This upgrades mtime_ms while iterating a rows array that was already selected with ORDER BY mtime_ms DESC using the old cached values. For users with an existing cache where a high-file-mtime session upgrades down below another session, the first cached response, including limit/offset pagination, still emits the old order until a later request reloads from SQLite. Please migrate before selecting or re-sort/re-page after applying upgradeCachedMessageTime().
Useful? React with 👍 / 👎.
Summary
Why
Launcher recency previously reflected file metadata rather than the latest visible conversation activity. Preview text could also be clipped, and resume actions provided little feedback while allowing repeated requests. The resume command differed from the intended trusted local-session mode.
Impact
Verification
pnpm typecheckpnpm test:client-ui(17/17)pnpm test:electron-e2epnpm test:desktop-api(18/18),pnpm test:local-history(19/19)