Skip to content

Resume the most recent session on startup - #395

Merged
roackb2 merged 1 commit into
mainfrom
codex/resume-most-recent-session
Sep 12, 2026
Merged

roackb2 merged 1 commit into
mainfrom
codex/resume-most-recent-session

Conversation

@roackb2

@roackb2 roackb2 commented Sep 12, 2026

Copy link
Copy Markdown
Owner

Summary

  • separate implicit startup selection from pinned-first sidebar ordering
  • use the same most-recent-session rule in web and CLI
  • preserve explicit route and CLI session choices

Verification

  • yarn vitest run src/tests/unit/client-shared/session-selection-service.test.ts src/tests/unit/web-v2/control-plane-sidebar-data.test.tsx src/tests/unit/cli-v2/control-plane-session-store.test.ts
  • yarn test:unit (147 files, 970 tests)
  • yarn typecheck
  • yarn lint
  • yarn cli:build
  • yarn test:browser-integration (9 tests)

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 12, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-12T12:42:51.224041Z fe7bfec PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@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: fe7bfecd2a

ℹ️ 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".

}

private static activityTimestamp(session: ControlPlaneSessionView): number {
for (const timestamp of [session.updatedAt, session.createdAt]) {

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 Exclude pin mutations from the activity timestamp

When a user pins or unpins an older session and then restarts, this still selects that session rather than the most recently active one. FileConversationSessionService.setPinned() persists through updatePersisted(), which calls ChatSessionRecords.touch() and replaces updatedAt with the current time, so treating updatedAt as pin-independent activity directly contradicts the new selection policy. Use a timestamp that only tracks conversational activity, or avoid advancing that timestamp for presentation-only metadata.

Useful? React with 👍 / 👎.

@roackb2
roackb2 merged commit 3901368 into main Sep 12, 2026
6 checks passed
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