JuliusBrussee/caveman · error · RetryLoopError
retry loop interrupted: tool call ${JSON.stringify(signature
Error message
retry loop interrupted: tool call ${JSON.stringify(signature)} repeated ${repeats} times (threshold ${threshold}) What it means
Error "retry loop interrupted: tool call ${JSON.stringify(signature)} repeated ${repeats} times (threshold ${threshold})" thrown in JuliusBrussee/caveman.
Source
Thrown at packages/sdk/typescript/src/index.ts:694
serialized = String(args);
}
return `${name}(${serialized})`;
}
/**
* Record a tool call. Throws {@link RetryLoopError} once an identical call has
* repeated past the threshold. A different call resets the streak.
*/
record(name: string, args: unknown): void {
const sig = this.signature(name, args);
if (sig === this.lastSignature) {
this.repeats += 1;
} else {
this.lastSignature = sig;
this.repeats = 1;
}
if (this.repeats > this.threshold) {
throw new RetryLoopError(sig, this.repeats, this.threshold);
}
}
/** Record the call (may throw) then invoke `fn`. */
async guard<T>(name: string, args: unknown, fn: () => Promise<T> | T): Promise<T> {
this.record(name, args);
return fn();
}
/** Clear the streak (e.g. when starting a new task). */
reset(): void {
this.lastSignature = null;
this.repeats = 0;
}
}
// ─── Async job client ─────────────────────────────────────────────────────────
View on GitHub (pinned to 27d5a3981a)
Solutions
- The same tool call repeated past the threshold; change the prompt/tool flow to break the loop, or raise the repetition threshold.
When it happens
Trigger: Thrown at packages/sdk/typescript/src/index.ts:694 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of JuliusBrussee/caveman@27d5a3981a (2026-08-15).
Data as JSON: /api/errors/dc379e7c9831dd0c.
Report an issue: GitHub.