gsd-pi 2.33.1-dev.235d83a → 2.33.1-dev.9bafd68

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -665,17 +665,26 @@ export async function showSmartEntry(ctx, pi, basePath, options) {
665
665
  const crashLock = readCrashLock(basePath);
666
666
  if (crashLock) {
667
667
  clearLock(basePath);
668
- const resume = await showNextAction(ctx, {
669
- title: "GSDInterrupted Session Detected",
670
- summary: [formatCrashInfo(crashLock)],
671
- actions: [
672
- { id: "resume", label: "Resume with /gsd auto", description: "Pick up where it left off", recommended: true },
673
- { id: "continue", label: "Continue manually", description: "Open the wizard as normal" },
674
- ],
675
- });
676
- if (resume === "resume") {
677
- await startAuto(ctx, pi, basePath, false);
678
- return;
668
+ // Bootstrap crash with zero completed units = no work was lost.
669
+ // Auto-discard instead of prompting the user this commonly happens
670
+ // when the user exits during init wizard or discuss phase before any
671
+ // real auto-mode work begins.
672
+ const isBootstrapCrash = crashLock.unitType === "starting"
673
+ && crashLock.unitId === "bootstrap"
674
+ && crashLock.completedUnits === 0;
675
+ if (!isBootstrapCrash) {
676
+ const resume = await showNextAction(ctx, {
677
+ title: "GSD Interrupted Session Detected",
678
+ summary: [formatCrashInfo(crashLock)],
679
+ actions: [
680
+ { id: "resume", label: "Resume with /gsd auto", description: "Pick up where it left off", recommended: true },
681
+ { id: "continue", label: "Continue manually", description: "Open the wizard as normal" },
682
+ ],
683
+ });
684
+ if (resume === "resume") {
685
+ await startAuto(ctx, pi, basePath, false);
686
+ return;
687
+ }
679
688
  }
680
689
  }
681
690
  const state = await deriveState(basePath);
@@ -101,6 +101,14 @@ function ensureExitHandler(gsdDir) {
101
101
  }
102
102
  }
103
103
  catch { /* best-effort */ }
104
+ // Remove the auto.lock metadata file so crash-recovery doesn't
105
+ // falsely detect an interrupted session on the next startup.
106
+ try {
107
+ const lockFile = join(gsdDir, LOCK_FILE);
108
+ if (existsSync(lockFile))
109
+ unlinkSync(lockFile);
110
+ }
111
+ catch { /* best-effort */ }
104
112
  try {
105
113
  const lockDir = join(gsdDir + ".lock");
106
114
  if (existsSync(lockDir))
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gsd-pi",
3
- "version": "2.33.1-dev.235d83a",
3
+ "version": "2.33.1-dev.9bafd68",
4
4
  "description": "GSD — Get Shit Done coding agent",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -792,17 +792,28 @@ export async function showSmartEntry(
792
792
  const crashLock = readCrashLock(basePath);
793
793
  if (crashLock) {
794
794
  clearLock(basePath);
795
- const resume = await showNextAction(ctx, {
796
- title: "GSD Interrupted Session Detected",
797
- summary: [formatCrashInfo(crashLock)],
798
- actions: [
799
- { id: "resume", label: "Resume with /gsd auto", description: "Pick up where it left off", recommended: true },
800
- { id: "continue", label: "Continue manually", description: "Open the wizard as normal" },
801
- ],
802
- });
803
- if (resume === "resume") {
804
- await startAuto(ctx, pi, basePath, false);
805
- return;
795
+
796
+ // Bootstrap crash with zero completed units = no work was lost.
797
+ // Auto-discard instead of prompting the user — this commonly happens
798
+ // when the user exits during init wizard or discuss phase before any
799
+ // real auto-mode work begins.
800
+ const isBootstrapCrash = crashLock.unitType === "starting"
801
+ && crashLock.unitId === "bootstrap"
802
+ && crashLock.completedUnits === 0;
803
+
804
+ if (!isBootstrapCrash) {
805
+ const resume = await showNextAction(ctx, {
806
+ title: "GSD — Interrupted Session Detected",
807
+ summary: [formatCrashInfo(crashLock)],
808
+ actions: [
809
+ { id: "resume", label: "Resume with /gsd auto", description: "Pick up where it left off", recommended: true },
810
+ { id: "continue", label: "Continue manually", description: "Open the wizard as normal" },
811
+ ],
812
+ });
813
+ if (resume === "resume") {
814
+ await startAuto(ctx, pi, basePath, false);
815
+ return;
816
+ }
806
817
  }
807
818
  }
808
819
 
@@ -122,6 +122,12 @@ function ensureExitHandler(gsdDir: string): void {
122
122
  try {
123
123
  if (_releaseFunction) { _releaseFunction(); _releaseFunction = null; }
124
124
  } catch { /* best-effort */ }
125
+ // Remove the auto.lock metadata file so crash-recovery doesn't
126
+ // falsely detect an interrupted session on the next startup.
127
+ try {
128
+ const lockFile = join(gsdDir, LOCK_FILE);
129
+ if (existsSync(lockFile)) unlinkSync(lockFile);
130
+ } catch { /* best-effort */ }
125
131
  try {
126
132
  const lockDir = join(gsdDir + ".lock");
127
133
  if (existsSync(lockDir)) rmSync(lockDir, { recursive: true, force: true });