@c4t4/heyamigo 0.9.18 → 0.9.19
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/ai/spawn.js +9 -3
- package/dist/queue/browser-queue.js +5 -2
- package/dist/queue/inbound.js +5 -4
- package/package.json +1 -1
package/dist/ai/spawn.js
CHANGED
|
@@ -180,8 +180,14 @@ export async function runClaude(opts) {
|
|
|
180
180
|
}
|
|
181
181
|
// Per-lane defaults. Individual callers can override, but these are the
|
|
182
182
|
// shipped caps. Browser-heavy work lives in the async lane.
|
|
183
|
+
//
|
|
184
|
+
// Values picked to accommodate /goal-style long-running tasks (Claude
|
|
185
|
+
// Code / Codex CLI support multi-hour goal sessions). Matching claim
|
|
186
|
+
// TTLs in queue/inbound.ts and queue/browser-queue.ts MUST exceed
|
|
187
|
+
// these — otherwise the orchestrator reclaims live workers and the
|
|
188
|
+
// same task gets processed twice.
|
|
183
189
|
export const TIMEOUT_MS = {
|
|
184
|
-
main:
|
|
185
|
-
async:
|
|
186
|
-
background:
|
|
190
|
+
main: 30 * 60 * 1000, // 30 min — chat track, covers /goal
|
|
191
|
+
async: 60 * 60 * 1000, // 60 min — async lane, deep browser scrapes
|
|
192
|
+
background: 5 * 60 * 1000, // 5 min — digest / sweep / housekeeping
|
|
187
193
|
};
|
|
@@ -121,8 +121,11 @@ export function markBrowserTaskRetryOrDlq(id, workerId, errorMessage) {
|
|
|
121
121
|
return { retried: true, deadLettered: false };
|
|
122
122
|
});
|
|
123
123
|
}
|
|
124
|
-
//
|
|
125
|
-
|
|
124
|
+
// MUST exceed TIMEOUT_MS.async (60min as of the /goal-friendly bump)
|
|
125
|
+
// so live browser workers don't get reclaimed mid-spawn. 5min headroom
|
|
126
|
+
// past the spawn cap so the orchestrator only catches truly dead
|
|
127
|
+
// workers. Browser tasks legitimately run 30-45min for deep scrapes.
|
|
128
|
+
const CLAIM_TTL_SECONDS = 65 * 60;
|
|
126
129
|
export function reclaimStuckBrowserTasks() {
|
|
127
130
|
const db = getDb();
|
|
128
131
|
const cutoff = Math.floor(Date.now() / 1000) - CLAIM_TTL_SECONDS;
|
package/dist/queue/inbound.js
CHANGED
|
@@ -170,10 +170,11 @@ export function markInboundFailed(id, workerId, errorMessage) {
|
|
|
170
170
|
.all();
|
|
171
171
|
return result.length > 0;
|
|
172
172
|
}
|
|
173
|
-
// Orchestrator helper.
|
|
174
|
-
//
|
|
175
|
-
//
|
|
176
|
-
|
|
173
|
+
// Orchestrator helper. MUST exceed TIMEOUT_MS.main (30min as of the
|
|
174
|
+
// /goal-friendly bump) so live workers don't get reclaimed mid-spawn.
|
|
175
|
+
// 5min headroom past the spawn cap so the orchestrator only catches
|
|
176
|
+
// rows whose worker actually died.
|
|
177
|
+
const CLAIM_TTL_SECONDS = 35 * 60;
|
|
177
178
|
export function reclaimStuckInbound() {
|
|
178
179
|
const db = getDb();
|
|
179
180
|
const cutoff = Math.floor(Date.now() / 1000) - CLAIM_TTL_SECONDS;
|