src / agents / budget.ts
/**
* Returns true when a pass exhausted the tool-call budget without recording a
* final result. Reaching the limit with finish_run is a valid completion, not
* an agent failure.
*/
export function toolBudgetExhaustedWithoutCompletion(
toolCalls: number,
maxToolCalls: number,
completionRecorded: boolean,
): boolean {
return toolCalls >= maxToolCalls && !completionRecorded;
}
src / agents / budget.ts
/**
* Returns true when a pass exhausted the tool-call budget without recording a
* final result. Reaching the limit with finish_run is a valid completion, not
* an agent failure.
*/
export function toolBudgetExhaustedWithoutCompletion(
toolCalls: number,
maxToolCalls: number,
completionRecorded: boolean,
): boolean {
return toolCalls >= maxToolCalls && !completionRecorded;
}