()
| 60 | throw new BudgetExceededError(`Token budget exceeded: ${this.tokens}/${this.maxTokens}`, 'tokens'); |
| 61 | } |
| 62 | if (this.maxCostUsd > 0 && this.costUsd > this.maxCostUsd) { |
| 63 | throw new BudgetExceededError(`Cost budget exceeded: $${this.costUsd.toFixed(4)}/$${this.maxCostUsd}`, 'cost'); |
| 64 | } |
| 65 | if (this.maxWallSeconds > 0 && wallMs > this.maxWallSeconds * 1000) { |
| 66 | // Slow ≠ runaway. checkpoint() runs right AFTER a completed model call, so in the |
| 67 | // old form this ceiling could ONLY ever kill a task that was actively working |
no outgoing calls
no test coverage detected