Skip to content

Fix launcher session recency and complete previews - #3

Merged
ffffhx merged 4 commits into
mainfrom
agent/fix-session-times-preview
Jul 22, 2026
Merged

Fix launcher session recency and complete previews#3
ffffhx merged 4 commits into
mainfrom
agent/fix-session-times-preview

Conversation

@ffffhx

@ffffhx ffffhx commented Jul 19, 2026

Copy link
Copy Markdown
Owner

Summary

  • use the latest visible user/assistant message time for session recency instead of session file or creation time
  • lazily upgrade cached session rows to the new timestamp source
  • remove launcher preview character and line clamps while keeping the preview panel scrollable
  • make session resume show a loading state, deduplicate concurrent requests, and report timeouts or failures clearly
  • resume trusted Codex sessions with full permissions in both Orca and terminal fallbacks
  • document the desktop resume behavior and add regression coverage for preview and resume interactions

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

  • session ordering reflects visible conversation activity
  • complete preview messages remain readable within a scrollable panel
  • resume actions are single-flight and visibly report progress, success, timeout, and failure
  • Codex sessions restored from the launcher run with approvals and sandbox bypassed

Verification

  • pnpm typecheck
  • pnpm test:client-ui (17/17)
  • pnpm test:electron-e2e
  • previous branch checks: pnpm test:desktop-api (18/18), pnpm test:local-history (19/19)

@ffffhx
ffffhx marked this pull request as ready for review July 22, 2026 17:31
@ffffhx
ffffhx merged commit 0911abd into main Jul 22, 2026
1 check passed
@ffffhx
ffffhx deleted the agent/fix-session-times-preview branch July 22, 2026 17:31

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment on lines +1064 to +1066
mtime: latestMessageAt
|| (session.mtimeMs ? new Date(session.mtimeMs).toISOString() : new Date(file.mtimeMs).toISOString()),
mtimeSource: latestMessageAt ? "last-visible-message" : "file-mtime",

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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));

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant