@xiangyixie/dsh-superagent 0.14.2 → 0.14.4

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.
package/lib/schedule.js CHANGED
@@ -494,6 +494,7 @@ export function createScheduler({
494
494
  }
495
495
  const open = (run.attention?.items ?? []).find(item => !item.answer) ?? null
496
496
  const budgetish = run.goalMode?.stop?.reason === 'budget'
497
+ || (Boolean(run.budgetStop?.detail) && run.status !== 'completed')
497
498
  || /budget/i.test(String(run.error ?? ''))
498
499
  || /budget/i.test(String(run.goalMode?.stop?.detail ?? ''))
499
500
  let outcome
@@ -513,7 +514,7 @@ export function createScheduler({
513
514
  }
514
515
  if (outcome === 'budget') {
515
516
  plan.enabled = false
516
- plan.pausedReason = `budget reached: ${oneLine(run.error ?? run.goalMode?.stop?.detail ?? 'the run hit its budget', 200)}`
517
+ plan.pausedReason = `budget reached: ${oneLine(run.budgetStop?.detail ?? run.error ?? run.goalMode?.stop?.detail ?? 'the run hit its budget', 200)}`
517
518
  plan.lastOutcome = 'budget'
518
519
  plan.lastReason = plan.pausedReason
519
520
  record(plan, 'budget', plan.pausedReason)