repoburg 1.3.296 → 1.3.297
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.
|
@@ -42371,9 +42371,20 @@ function resumeMadeProgress(db2, turn) {
|
|
|
42371
42371
|
AND created_at >= ? LIMIT 1`
|
|
42372
42372
|
).get(turn.id, resumedAt);
|
|
42373
42373
|
}
|
|
42374
|
+
function isReopenable(db2, turn) {
|
|
42375
|
+
if (turn.status !== "completed" || turn.thread_id) return false;
|
|
42376
|
+
const latest = db2.prepare(
|
|
42377
|
+
"SELECT id FROM turns WHERE session_id = ? AND thread_id IS NULL ORDER BY created_at DESC, rowid DESC LIMIT 1"
|
|
42378
|
+
).get(turn.session_id);
|
|
42379
|
+
if (latest?.id !== turn.id) return false;
|
|
42380
|
+
return !db2.prepare(
|
|
42381
|
+
"SELECT 1 FROM turns WHERE session_id = ? AND thread_id IS NULL AND status IN ('pending', 'running') LIMIT 1"
|
|
42382
|
+
).get(turn.session_id);
|
|
42383
|
+
}
|
|
42374
42384
|
function markTurnInterrupted(db2, turnId, reason, opts = {}) {
|
|
42375
42385
|
const turn = getTurn(db2, turnId);
|
|
42376
|
-
if (!turn
|
|
42386
|
+
if (!turn) return false;
|
|
42387
|
+
if (!isLive(turn.status) && !(opts.reopen && isReopenable(db2, turn))) return false;
|
|
42377
42388
|
if (turn.status === "pending" && turn.resume_state === "waiting") return false;
|
|
42378
42389
|
const now = (/* @__PURE__ */ new Date()).toISOString();
|
|
42379
42390
|
const detail = opts.detail ?? null;
|
|
@@ -118840,8 +118851,7 @@ async function handleResultMessage(message, sessionId, turnId, entry, db2) {
|
|
|
118840
118851
|
entry.lastApiError = null;
|
|
118841
118852
|
if (message.is_error) {
|
|
118842
118853
|
const row = db2.prepare("SELECT status, resume_state FROM turns WHERE id = ?").get(turnId);
|
|
118843
|
-
if (row
|
|
118844
|
-
if (row.status === "pending" && row.resume_state === "waiting") return;
|
|
118854
|
+
if (!row || row.status === "pending" && row.resume_state === "waiting") return;
|
|
118845
118855
|
const text2 = (message.result || apiError?.text || "Claude API error").trim();
|
|
118846
118856
|
const kind = classifyApiError({
|
|
118847
118857
|
error: apiError?.error,
|
|
@@ -118850,6 +118860,12 @@ async function handleResultMessage(message, sessionId, turnId, entry, db2) {
|
|
|
118850
118860
|
limitRejected: entry.rateLimit?.status === "rejected"
|
|
118851
118861
|
});
|
|
118852
118862
|
const resumeAt = kind === "usage_limit" ? usageLimitResumeAt(entry.rateLimit?.resetsAt) : null;
|
|
118863
|
+
if (row.status !== "pending" && row.status !== "running") {
|
|
118864
|
+
if (kind === "usage_limit" && resumeAt && !entry.threadId) {
|
|
118865
|
+
markTurnInterrupted(db2, turnId, kind, { detail: text2, resumeAt, reopen: true });
|
|
118866
|
+
}
|
|
118867
|
+
return;
|
|
118868
|
+
}
|
|
118853
118869
|
if (kind !== "fatal" && !entry.threadId && markTurnInterrupted(db2, turnId, kind, { detail: text2, resumeAt })) {
|
|
118854
118870
|
return;
|
|
118855
118871
|
}
|
|
@@ -42354,9 +42354,20 @@ function resumeMadeProgress(db2, turn) {
|
|
|
42354
42354
|
AND created_at >= ? LIMIT 1`
|
|
42355
42355
|
).get(turn.id, resumedAt);
|
|
42356
42356
|
}
|
|
42357
|
+
function isReopenable(db2, turn) {
|
|
42358
|
+
if (turn.status !== "completed" || turn.thread_id) return false;
|
|
42359
|
+
const latest = db2.prepare(
|
|
42360
|
+
"SELECT id FROM turns WHERE session_id = ? AND thread_id IS NULL ORDER BY created_at DESC, rowid DESC LIMIT 1"
|
|
42361
|
+
).get(turn.session_id);
|
|
42362
|
+
if (latest?.id !== turn.id) return false;
|
|
42363
|
+
return !db2.prepare(
|
|
42364
|
+
"SELECT 1 FROM turns WHERE session_id = ? AND thread_id IS NULL AND status IN ('pending', 'running') LIMIT 1"
|
|
42365
|
+
).get(turn.session_id);
|
|
42366
|
+
}
|
|
42357
42367
|
function markTurnInterrupted(db2, turnId, reason, opts = {}) {
|
|
42358
42368
|
const turn = getTurn(db2, turnId);
|
|
42359
|
-
if (!turn
|
|
42369
|
+
if (!turn) return false;
|
|
42370
|
+
if (!isLive(turn.status) && !(opts.reopen && isReopenable(db2, turn))) return false;
|
|
42360
42371
|
if (turn.status === "pending" && turn.resume_state === "waiting") return false;
|
|
42361
42372
|
const now = (/* @__PURE__ */ new Date()).toISOString();
|
|
42362
42373
|
const detail = opts.detail ?? null;
|
|
@@ -118823,8 +118834,7 @@ async function handleResultMessage(message, sessionId, turnId, entry, db2) {
|
|
|
118823
118834
|
entry.lastApiError = null;
|
|
118824
118835
|
if (message.is_error) {
|
|
118825
118836
|
const row = db2.prepare("SELECT status, resume_state FROM turns WHERE id = ?").get(turnId);
|
|
118826
|
-
if (row
|
|
118827
|
-
if (row.status === "pending" && row.resume_state === "waiting") return;
|
|
118837
|
+
if (!row || row.status === "pending" && row.resume_state === "waiting") return;
|
|
118828
118838
|
const text2 = (message.result || apiError?.text || "Claude API error").trim();
|
|
118829
118839
|
const kind = classifyApiError({
|
|
118830
118840
|
error: apiError?.error,
|
|
@@ -118833,6 +118843,12 @@ async function handleResultMessage(message, sessionId, turnId, entry, db2) {
|
|
|
118833
118843
|
limitRejected: entry.rateLimit?.status === "rejected"
|
|
118834
118844
|
});
|
|
118835
118845
|
const resumeAt = kind === "usage_limit" ? usageLimitResumeAt(entry.rateLimit?.resetsAt) : null;
|
|
118846
|
+
if (row.status !== "pending" && row.status !== "running") {
|
|
118847
|
+
if (kind === "usage_limit" && resumeAt && !entry.threadId) {
|
|
118848
|
+
markTurnInterrupted(db2, turnId, kind, { detail: text2, resumeAt, reopen: true });
|
|
118849
|
+
}
|
|
118850
|
+
return;
|
|
118851
|
+
}
|
|
118836
118852
|
if (kind !== "fatal" && !entry.threadId && markTurnInterrupted(db2, turnId, kind, { detail: text2, resumeAt })) {
|
|
118837
118853
|
return;
|
|
118838
118854
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"tree": "e126e6dc57b66cb8a2c42da1c9599b18786209a4",
|
|
3
|
-
"commit": "
|
|
3
|
+
"commit": "52b6a9c6ca262c46fc51a7da9486ee7b699519d4",
|
|
4
4
|
"dirty": false,
|
|
5
|
-
"repoburgVersion": "1.3.
|
|
6
|
-
"builtAt": "2026-11-03T06:
|
|
5
|
+
"repoburgVersion": "1.3.297",
|
|
6
|
+
"builtAt": "2026-11-03T06:56:22.687Z"
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"tree": "e126e6dc57b66cb8a2c42da1c9599b18786209a4",
|
|
3
|
-
"commit": "
|
|
3
|
+
"commit": "52b6a9c6ca262c46fc51a7da9486ee7b699519d4",
|
|
4
4
|
"dirty": false,
|
|
5
|
-
"repoburgVersion": "1.3.
|
|
6
|
-
"builtAt": "2026-11-03T06:
|
|
5
|
+
"repoburgVersion": "1.3.297",
|
|
6
|
+
"builtAt": "2026-11-03T06:56:22.687Z"
|
|
7
7
|
}
|