calesthio/OpenMontage · warning · ApprovalRequiredError

Action costs ${estimated:.2f}, exceeds single-action thresho

Error message

Action costs ${estimated:.2f}, exceeds single-action threshold ${self.single_action_approval_usd:.2f}

What it means

ApprovalRequiredError raised by CostTracker.reserve when a single entry's estimated_usd exceeds single_action_approval_usd and the tracker is not in OBSERVE mode. It is a policy gate, not a hard budget failure: the system is refusing to auto-execute one expensive action until a human/tool approves it. In OBSERVE mode it is skipped so telemetry-only runs never block.

Source

Thrown at tools/cost_tracker.py:129

            "actual_usd": 0.0,
            "timestamp": self._now(),
        })
        self._save()
        return entry_id

    def reserve(self, entry_id: str) -> None:
        """Reserve budget for an estimated entry.

        Raises BudgetExceededError in cap mode, or ApprovalRequiredError
        when the action exceeds the single-action approval threshold.
        """
        entry = self._find(entry_id)
        estimated = entry["estimated_usd"]

        # Check single-action approval threshold
        if estimated > self.single_action_approval_usd:
            if self.mode != BudgetMode.OBSERVE:
                raise ApprovalRequiredError(
                    f"Action costs ${estimated:.2f}, exceeds "
                    f"single-action threshold ${self.single_action_approval_usd:.2f}"
                )

        # Check new paid tool approval
        if self.require_approval_for_new_paid_tool and estimated > 0:
            if entry["tool"] not in self._approved_tools:
                if self.mode != BudgetMode.OBSERVE:
                    raise ApprovalRequiredError(
                        f"First paid use of tool {entry['tool']!r} requires approval"
                    )

        # Check budget
        if estimated > self.usable_budget_usd:
            message = (
                f"Reservation of ${estimated:.2f} exceeds usable budget "
                f"${self.usable_budget_usd:.2f}"
            )

View on GitHub (pinned to 95e1c3d0ab)

Solutions

  1. If the cost is expected, approve the action through the tracker's approval flow (e.g. approve_tool / the entry approval mechanism) and retry the reserve.
  2. Raise single_action_approval_usd in the budget configuration so this action falls under the per-action ceiling.
  3. Switch to a cheaper model or shorter duration so estimated_usd stays under the threshold.
  4. For dry runs / telemetry, set mode to OBSERVE so approval gates are bypassed entirely.

Example fix

# before
tracker.reserve(entry_id)  # raises ApprovalRequiredError when estimate > threshold

# after
try:
    tracker.reserve(entry_id)
except ApprovalRequiredError:
    tracker.approve_tool(entry["tool"])
    tracker.reserve(entry_id)
Defensive patterns

Strategy: try-catch

Validate before calling

def would_need_approval(tracker, entry_id: str) -> bool:
    entry = next((e for e in tracker.entries if e["id"] == entry_id), None)
    return bool(entry and entry["estimated_usd"] > tracker.single_action_approval_usd)

Try / catch

from tools.cost_tracker import ApprovalRequiredError

try:
    tracker.reserve(entry_id)
except ApprovalRequiredError as e:
    if "single-action threshold" in str(e):
        notify_human(e)  # surface for approval, then re-reserve after approval
    raise

Prevention

When it happens

Trigger: Calling reserve(entry_id) where the logged entry's estimated_usd > single_action_approval_usd and mode is CAP or WARN (anything but OBSERVE). Typical with premium video/image models (e.g. a multi-second generation priced above the configured per-action ceiling).

Common situations: Lowering single_action_approval_usd in config to tighten spend control, then running a previously-allowed expensive model; or first use of a premium tier model whose estimate exceeds the default threshold.

Related errors


AI-assisted analysis of calesthio/OpenMontage@95e1c3d0ab (2026-08-15). Data as JSON: /api/errors/2899c2d084116458. Report an issue: GitHub.