Skip to main content

Module cost_guard

Module cost_guard 

Source
Expand description

Cost-budget enforcement for the agentic loop.

Checked before every provider request. Reads CostGuardrails from env vars (CODETETHER_COST_WARN_USD, CODETETHER_COST_LIMIT_USD) and compares against the running session cost estimate from crate::provider::pricing::session_cost_usd.

Enums§

CostGuardLevel
UI-facing severity of the current session’s spend.
CostGuardStatus
Result of a budget check.

Functions§

cost_guard_level
Non-mutating probe used by UI widgets to color the cost badge.
enforce_cost_budget
Enforce the cost budget before sending a provider request.