clementine-agent 1.18.24 → 1.18.26

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -5863,6 +5863,21 @@ You have a cost budget per message — not a hard turn limit. Work until the tas
5863
5863
  }
5864
5864
  logger.error({ err, jobName, phase }, `Unleashed task phase ${phase} error`);
5865
5865
  appendProgress({ event: 'phase_error', phase, error: String(err), terminalReason });
5866
+ if (isCreditBalanceError(err)) {
5867
+ markBackgroundCreditBlocked(err);
5868
+ appendProgress({ event: 'aborted', phase, reason: 'account_usage_limit' });
5869
+ writeStatus({
5870
+ jobName,
5871
+ status: 'error',
5872
+ phase,
5873
+ startedAt,
5874
+ finishedAt: new Date().toISOString(),
5875
+ });
5876
+ const message = (`Task "${jobName}" stopped because Claude account usage or billing is blocked: ${String(err).slice(0, 500)}. ` +
5877
+ 'Background jobs have been paused so Clementine does not keep retrying against the same account limit.');
5878
+ logger.error({ jobName, phase }, 'Unleashed task aborted on Claude account usage limit');
5879
+ throw new UnleashedTaskFailedError(message, this._lastTerminalReason);
5880
+ }
5866
5881
  if (terminalReason === 'rapid_refill_breaker' || terminalReason === 'prompt_too_long') {
5867
5882
  appendProgress({ event: 'aborted', phase, reason: terminalReason });
5868
5883
  writeStatus({