Skip to content

feat(sessions): restore saved terminal tabs on startup - #286

Closed
shihuili1218 wants to merge 1 commit into
mainfrom
feat/session-restore
Closed

shihuili1218 wants to merge 1 commit into
mainfrom
feat/session-restore

Conversation

@shihuili1218

Copy link
Copy Markdown
Collaborator

No description provided.

Copilot AI balanced review requested due to automatic review settings September 30, 2026 13:42

Copilot AI 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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 30, 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-30T13:53:53.241089Z 27157ab 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: 27157abbf0

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

let resourcePanesAllowed = $state(bypassStartupReconcile);
let navigationLoad = 0;
$effect(() => {
if (bypassStartupReconcile || !sessionRestore.ready() || !sessionRestore.enabled()) return;

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 Synchronize the restore preference across windows

When the user toggles this setting from a clone or AI-handoff window, that window renders the same Settings UI and writes the shared database key, but this guard prevents it from ever persisting a snapshot while the primary window's per-webview _enabled value remains unchanged. Enabling restore there therefore saves no sessions, while disabling it can be undone when the primary window next changes tabs and writes another snapshot; propagate preference changes to the primary window or make the control unavailable in secondary windows.

AGENTS.md reference: AGENTS.md:L211-L216

Useful? React with 👍 / 👎.

types.has("serial") && !app.isMobile ? invoke<app.SerialProfile[]>("list_serial_profiles") : [],
]);
// Do not take over tabs the user opened while the backend was loading.
if (signal?.aborted || app.tabs().length !== 1) return false;

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 auto-opening after a manual local tab wins restore

When restore is enabled together with open_local_on_startup, a user can open a local terminal while the profile-list requests are pending; this guard then aborts restoration and returns false, so initializePrimarySessionWindow interprets the result as having no local terminal and opens a second one. The new restore wait makes this race materially wider than the original single settings read; return that a local tab is already present, or recheck the tab state before applying auto-open.

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.

3 participants