claude-overnight 1.11.11 → 1.11.13
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.
- package/dist/run.js +6 -1
- package/dist/swarm.js +13 -8
- package/package.json +1 -1
package/dist/run.js
CHANGED
|
@@ -342,11 +342,16 @@ export async function executeRun(cfg) {
|
|
|
342
342
|
lastAborted = swarm.aborted;
|
|
343
343
|
recordBranches(swarm.agents, swarm.mergeResults, branches);
|
|
344
344
|
saveWaveSession(runDir, waveNum, swarm.agents, swarm.totalCostUsd);
|
|
345
|
+
// Tasks that never made it into the swarm (queue cleared on abort/cap)
|
|
346
|
+
// are preserved as currentTasks so resume picks them up. Budget for these
|
|
347
|
+
// wasn't decremented (only attempted agents were), so no refund needed.
|
|
348
|
+
const attemptedPrompts = new Set(swarm.agents.map(a => a.task.prompt));
|
|
349
|
+
const neverStarted = currentTasks.filter(t => !attemptedPrompts.has(t.prompt));
|
|
345
350
|
saveRunState(runDir, {
|
|
346
351
|
id: `run-${new Date().toISOString().slice(0, 19)}`, objective: objective ?? "", budget: cfg.budget,
|
|
347
352
|
remaining, workerModel, plannerModel, concurrency, permissionMode,
|
|
348
353
|
usageCap, allowExtraUsage: cfg.allowExtraUsage, extraUsageBudget: cfg.extraUsageBudget,
|
|
349
|
-
flex, useWorktrees, mergeStrategy, waveNum, currentTasks:
|
|
354
|
+
flex, useWorktrees, mergeStrategy, waveNum, currentTasks: neverStarted,
|
|
350
355
|
accCost, accCompleted, accFailed, accIn, accOut, accTools,
|
|
351
356
|
branches, phase: "steering", startedAt: new Date(cfg.runStartedAt).toISOString(), cwd,
|
|
352
357
|
});
|
package/dist/swarm.js
CHANGED
|
@@ -211,12 +211,6 @@ export class Swarm {
|
|
|
211
211
|
this.rateLimitResetsAt = undefined;
|
|
212
212
|
consecutiveWaits++;
|
|
213
213
|
}
|
|
214
|
-
// Soft delay: high utilization, pace requests
|
|
215
|
-
if (this.rateLimitUtilization > 0.75) {
|
|
216
|
-
const delay = Math.floor((this.rateLimitUtilization - 0.75) * 60000);
|
|
217
|
-
if (delay > 0)
|
|
218
|
-
await sleep(delay);
|
|
219
|
-
}
|
|
220
214
|
}
|
|
221
215
|
// ── Agent execution ──
|
|
222
216
|
async runAgent(task) {
|
|
@@ -333,6 +327,10 @@ export class Swarm {
|
|
|
333
327
|
this.activeQueries.delete(agentQuery);
|
|
334
328
|
if (sessionId)
|
|
335
329
|
resumeSessionId = sessionId;
|
|
330
|
+
try {
|
|
331
|
+
agentQuery.close();
|
|
332
|
+
}
|
|
333
|
+
catch { }
|
|
336
334
|
}
|
|
337
335
|
};
|
|
338
336
|
try {
|
|
@@ -361,7 +359,7 @@ export class Swarm {
|
|
|
361
359
|
const duration = agent.finishedAt - (agent.startedAt || agent.finishedAt);
|
|
362
360
|
if (agent.toolCalls === 0 && (agent.costUsd ?? 0) < 0.001 && duration < 15_000) {
|
|
363
361
|
agent.status = "error";
|
|
364
|
-
agent.error = "Agent did no work
|
|
362
|
+
agent.error = "Agent did no work — exited without tool use";
|
|
365
363
|
this.failed++;
|
|
366
364
|
}
|
|
367
365
|
else {
|
|
@@ -410,7 +408,8 @@ export class Swarm {
|
|
|
410
408
|
const dur = (agent.finishedAt ?? Date.now()) - (agent.startedAt ?? Date.now());
|
|
411
409
|
const m = Math.floor(dur / 60000);
|
|
412
410
|
const s = Math.round((dur % 60000) / 1000);
|
|
413
|
-
|
|
411
|
+
const verb = agent.status === "error" ? "errored" : "done";
|
|
412
|
+
return `Agent ${agent.id} ${verb}: ${m}m ${s}s, ${agent.toolCalls} tools, ${agent.filesChanged ?? 0} files changed`;
|
|
414
413
|
}
|
|
415
414
|
// ── Message handler ──
|
|
416
415
|
handleMsg(agent, msg) {
|
|
@@ -495,6 +494,12 @@ export class Swarm {
|
|
|
495
494
|
const pct = info.utilization != null ? `${Math.round(info.utilization * 100)}%` : "";
|
|
496
495
|
const overageTag = this.isUsingOverage ? " [EXTRA]" : "";
|
|
497
496
|
this.log(agent.id, `Rate: ${info.status} ${pct}${overageTag}${windowType ? ` (${windowType})` : ""}`);
|
|
497
|
+
if (info.status === "rejected") {
|
|
498
|
+
if (!this.rateLimitResetsAt || this.rateLimitResetsAt <= Date.now()) {
|
|
499
|
+
this.rateLimitResetsAt = Date.now() + 60_000;
|
|
500
|
+
}
|
|
501
|
+
throw new Error("rate limit rejected — retrying");
|
|
502
|
+
}
|
|
498
503
|
break;
|
|
499
504
|
}
|
|
500
505
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "claude-overnight",
|
|
3
|
-
"version": "1.11.
|
|
3
|
+
"version": "1.11.13",
|
|
4
4
|
"description": "Run 10, 100, or 1000 Claude agents overnight. Parallel autonomous AI coding with thinking waves, iterative quality steering, crash recovery, and rate limit handling. Built on the Claude Agent SDK.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|