From b16a97514e09eacbbb718a323c1e2b41a8eacb53 Mon Sep 17 00:00:00 2001 From: shokollm <270575765+shokollm@users.noreply.github.com> Date: Tue, 7 Apr 2026 23:39:18 +0000 Subject: [PATCH] fix(session): remove incorrect worktree removal in ensure_session When worktree exists but session is missing, ensure_session was incorrectly removing the worktree before recreating. This caused issues when cmd_continue called ensure_worktree first (creating the worktree) then ensure_session (which wrongly removed it). The fix removes the block that removes worktree when session is missing. If worktree exists, just create the session without touching the worktree. Fixes #229 --- skills/kugetsu/scripts/kugetsu-session.sh | 6 ------ 1 file changed, 6 deletions(-) diff --git a/skills/kugetsu/scripts/kugetsu-session.sh b/skills/kugetsu/scripts/kugetsu-session.sh index 521f596..10e7cb8 100755 --- a/skills/kugetsu/scripts/kugetsu-session.sh +++ b/skills/kugetsu/scripts/kugetsu-session.sh @@ -386,12 +386,6 @@ ensure_session() { return 0 fi - if $worktree_exists && ! $session_exists; then - log "warn" "ensure_session" "Worktree exists but session is missing. Removing worktree to recreate both..." - remove_worktree_for_issue "$issue_ref" - worktree_exists=false - fi - if ! $worktree_exists && $session_exists; then log "warn" "ensure_session" "Session exists but worktree is missing. Removing stale session..." rm -f "$session_path" -- 2.49.1