Skip to content

Don't apply the worktree default when resuming a session#62

Open
ymajoros wants to merge 1 commit into
doctly:mainfrom
ymajoros:fix/no-worktree-on-resume-upstream
Open

Don't apply the worktree default when resuming a session#62
ymajoros wants to merge 1 commit into
doctly:mainfrom
ymajoros:fix/no-worktree-on-resume-upstream

Conversation

@ymajoros

@ymajoros ymajoros commented Jun 1, 2026

Copy link
Copy Markdown

Problem

A plain click on a session in the sidebar does nothing — no terminal appears, the session stays "inactive" — yet Resume with config works. So a session can only be interacted with through the config dialog.

Cause

openSession() resumes with resolveDefaultSessionOptions(), which is shared with new-session creation and includes the global worktree: true default. Resuming an existing session with --worktree tries to spin it up in a fresh git worktree and fails to attach, so the terminal never shows.

showResumeSessionDialog() has no worktree control and never sets the flag — which is exactly why "Resume with config" works. Plain click and the dialog should behave the same.

Fix

Strip worktree/worktreeName from the resolved options on the resume path in openSession():

const resumeOptions = customOptions || await resolveDefaultSessionOptions({ projectPath });
if (resumeOptions) { delete resumeOptions.worktree; delete resumeOptions.worktreeName; }

New-session creation is untouched (still honors the worktree default). Worktree is a new-session concept — resuming must reuse the session's existing directory.

Testing

Built locally (Electron 41, Linux) with worktree: true as the default: plain click now resumes in place and attaches, matching the dialog. New-session-in-worktree still works.

resolveDefaultSessionOptions() is shared by new-session creation and resume.
The `worktree: true` global default makes sense only for NEW sessions (start
in a fresh isolated git worktree). On resume it's wrong: a plain click on a
session resolves to {worktree:true}, so it tries to resume the existing
session into a brand-new worktree and fails to attach — the terminal never
shows and the session looks stuck "inactive". "Resume with config" works
only because the resume dialog has no worktree control and never sets it.

Strip worktree/worktreeName from the resolved options on the resume path so
plain click resumes in place, matching the dialog.
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