refactor: add recovery mode + shared JSON/error/fetch utilities
- GroupQueue recovery mode: limit to 3 concurrent agents for 60s after restart to prevent API rate-limit storms (configurable via env vars) - getErrorMessage: replace 14 occurrences of instanceof Error pattern - readJsonFile/writeJsonFile: replace 19 occurrences of JSON+fs pattern - fetchWithTimeout: replace 3 occurrences of AbortController pattern 354/354 tests passing
This commit is contained in:
@@ -4,10 +4,7 @@ import { PassThrough } from 'stream';
|
||||
import fs from 'fs';
|
||||
import { spawn } from 'child_process';
|
||||
|
||||
import {
|
||||
OUTPUT_START_MARKER,
|
||||
OUTPUT_END_MARKER,
|
||||
} from './agent-protocol.js';
|
||||
import { OUTPUT_START_MARKER, OUTPUT_END_MARKER } from './agent-protocol.js';
|
||||
|
||||
// Mock config
|
||||
vi.mock('./config.js', () => ({
|
||||
|
||||
Reference in New Issue
Block a user