claude-overnight 1.50.3 → 1.50.5

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.
@@ -1 +1 @@
1
- export declare const VERSION = "1.50.3";
1
+ export declare const VERSION = "1.50.5";
@@ -1,2 +1,2 @@
1
1
  // Auto-generated by build — do not edit manually.
2
- export const VERSION = "1.50.3";
2
+ export const VERSION = "1.50.5";
@@ -310,6 +310,10 @@ export interface RunState extends RunConfigBase {
310
310
  coachedObjective?: string;
311
311
  /** Unix timestamp (ms) when the coach produced the accepted rewrite. */
312
312
  coachedAt?: number;
313
+ /** Run-branch created when mergeStrategy="branch" — must survive resume so subsequent waves accumulate into it instead of orphan branches. */
314
+ runBranch?: string;
315
+ /** Branch (or detached HEAD sha) the user was on before the run-branch was created — restored on run completion. */
316
+ originalRef?: string;
313
317
  }
314
318
  /** Function that returns a rate-limit snapshot with optional context token info. */
315
319
  export type RLGetter = () => {
package/dist/run/run.js CHANGED
@@ -207,10 +207,25 @@ export async function executeRun(cfg) {
207
207
  .then(text => { display.setDebrief(text.trim().slice(0, 210), label); })
208
208
  .catch(() => { display.setDebrief(undefined); });
209
209
  };
210
- // For flex + branch strategy: create one target branch
210
+ // For flex + branch strategy: create one target branch (or restore on resume).
211
+ // The run-branch + originalRef are persisted in run.json so resumes accumulate
212
+ // into the original branch instead of spawning orphan swarm/run-* branches.
211
213
  let runBranch;
212
214
  let originalRef;
213
- if (flex && mergeStrategy === "branch" && useWorktrees && !cfg.resuming) {
215
+ if (cfg.resuming && cfg.resumeState) {
216
+ runBranch = cfg.resumeState.runBranch;
217
+ originalRef = cfg.resumeState.originalRef;
218
+ if (runBranch) {
219
+ try {
220
+ execSync(`git checkout "${runBranch}"`, { cwd, encoding: "utf-8", stdio: "pipe" });
221
+ console.log(chalk.dim(` Resumed on branch: ${runBranch}\n`));
222
+ }
223
+ catch {
224
+ console.log(chalk.yellow(` ⚠ Could not check out run branch ${runBranch} — wave merges may diverge\n`));
225
+ }
226
+ }
227
+ }
228
+ if (flex && mergeStrategy === "branch" && useWorktrees && !runBranch) {
214
229
  try {
215
230
  originalRef = execSync("git rev-parse --abbrev-ref HEAD", { cwd, encoding: "utf-8", stdio: "pipe" }).trim();
216
231
  if (originalRef === "HEAD")
@@ -253,6 +268,8 @@ export async function executeRun(cfg) {
253
268
  repoFingerprint,
254
269
  coachedObjective: cfg.coachedObjective,
255
270
  coachedAt: cfg.coachedAt,
271
+ runBranch,
272
+ originalRef,
256
273
  };
257
274
  const buildRunState = (varying) => composeRunState({ ...runStateBase, workerModel, plannerModel, fastModel, concurrency, usageCap }, { remaining: varying.remaining, waveNum, accCost, accCompleted, accFailed, accIn, accOut, accTools, branches }, { phase: varying.phase, currentTasks: varying.currentTasks });
258
275
  const gracefulStop = () => {
@@ -22,6 +22,8 @@ export interface RunStateBase {
22
22
  repoFingerprint: string;
23
23
  coachedObjective?: string;
24
24
  coachedAt?: number;
25
+ runBranch?: string;
26
+ originalRef?: string;
25
27
  }
26
28
  /** Live counters captured at snapshot time. */
27
29
  export interface RunStateLive {
@@ -26,5 +26,7 @@ export function composeRunState(base, live, varying) {
26
26
  repoFingerprint: base.repoFingerprint,
27
27
  coachedObjective: base.coachedObjective,
28
28
  coachedAt: base.coachedAt,
29
+ runBranch: base.runBranch,
30
+ originalRef: base.originalRef,
29
31
  };
30
32
  }
@@ -199,7 +199,12 @@ export function saveRunState(runDir, state) {
199
199
  }
200
200
  export function loadRunState(runDir) {
201
201
  try {
202
- return JSON.parse(readFileSync(join(runDir, "run.json"), "utf-8"));
202
+ const state = JSON.parse(readFileSync(join(runDir, "run.json"), "utf-8"));
203
+ if (state && !Array.isArray(state.branches))
204
+ state.branches = [];
205
+ if (state && !Array.isArray(state.currentTasks))
206
+ state.currentTasks = [];
207
+ return state;
203
208
  }
204
209
  catch {
205
210
  return null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claude-overnight",
3
- "version": "1.50.3",
3
+ "version": "1.50.5",
4
4
  "description": "Parallel Claude agents in git worktrees with a usage cap that reserves headroom for your interactive Claude Code. Crash-safe resume. Provider-agnostic model catalog (Anthropic, Cursor, OpenAI, Gemini, DeepSeek, Llama, Qwen) with capability-based task scoping.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claude-overnight",
3
- "version": "1.50.3",
3
+ "version": "1.50.5",
4
4
  "description": "Claude Code skill for understanding, installing, and inspecting claude-overnight runs -- parallel Claude agents in git worktrees with thinking waves, multi-wave steering, and crash-safe resume. Supports Cursor API Proxy, Qwen, OpenRouter.",
5
5
  "author": {
6
6
  "name": "Francesco Fornace"