Skip to content

Commit 5b580db

Browse files
committed
fleet-write/execute: the clocked self-test helper reads a throttle refusal as an exit, never a crash
Claude-Session: https://claude.ai/code/session_01HEdP5tPhqQfzwRmKDxwn85 Co-authored-by: Claude <noreply@anthropic.com>
1 parent 65e826b commit 5b580db

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

‎scripts/pm/fleet-write/execute.mjs‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1160,7 +1160,13 @@ export async function selfTest() {
11601160
stamps.push({ call: `${init?.method ?? 'GET'} ${new URL(url).pathname}`, at: nowMs });
11611161
return inner(url, init);
11621162
};
1163-
const r = await executeFleetWrite({ payload: { ...base(actions), repo }, sender: 'os-support-ai', token: TOKEN }, { fetch: fetchImpl, pace, log: (l) => logs.push(l) });
1163+
let r;
1164+
try {
1165+
r = await executeFleetWrite({ payload: { ...base(actions), repo }, sender: 'os-support-ai', token: TOKEN }, { fetch: fetchImpl, pace, log: (l) => logs.push(l) });
1166+
} catch (e) {
1167+
if (e?.throttleExit === undefined) throw e;
1168+
r = { exit: e.throttleExit, rows: [], summary: '', lines: [], throttled: true };
1169+
}
11641170
const w = stamps.filter((s) => !s.call.startsWith('GET '));
11651171
return { ...r, stamps, writes: w, gaps: w.slice(1).map((s, i) => s.at - w[i].at), logs, paceLines, file };
11661172
};

0 commit comments

Comments
 (0)