mirror of
https://github.com/fabro-sh/fabro.git
synced 2026-09-08 22:21:45 +00:00
A run can now carry an optional spend budget. New [run.limits] settings table with max_cost (USD) and max_tokens; when accumulated LLM spend exceeds either limit, the run halts immediately and fails with the existing BudgetExhausted failure reason. - RunBudget (fabro-model): thread-safe accumulator shared across the engine, agent sessions, hooks, and the prompt path. Charges per LLM response; queues one-shot 80% warnings drained into run notices. - Enforcement is inline at every usage-recording site: the agent turn loop (interrupting like the wall-clock timeout via a new InterruptReason::BudgetExhausted), subagent sessions, the one-shot prompt path with schema-repair retries, context compaction, web_fetch summarization, and prompt/agent hooks (which skip once the budget is spent, matching their fail-open posture). - Budget exhaustion terminates the run as an engine-level error (fabro_core::Error::BudgetExhausted, following the StallTimeout pattern) so fail edges are not followed, plus a between-stage gate for non-LLM stages and a run-start gate that makes a resumed budget-failed run fail fast until the limit is raised (spend is seeded from the billing projection). - Exposed on the RunNamespace OpenAPI schema (RunLimitsSettings); Rust and TypeScript clients regenerated; docs updated. Known gaps, by design for now: ACP external agents report no usable per-response usage (cumulative UsageUpdate capture is a follow-up), and post-run PR content generation is outside the engine. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| agent_session_activated_props_round_trip.rs | ||
| automation_round_trip.rs | ||
| billed_token_counts_round_trip.rs | ||
| command_termination_round_trip.rs | ||
| completion_message_round_trip.rs | ||
| completion_usage_round_trip.rs | ||
| cost_source_round_trip.rs | ||
| create_completion_request_round_trip.rs | ||
| diff_stats_round_trip.rs | ||
| diff_summary_round_trip.rs | ||
| environment_round_trip.rs | ||
| event_envelope_round_trip.rs | ||
| git_context_round_trip.rs | ||
| interview_option_round_trip.rs | ||
| interview_question_record_round_trip.rs | ||
| manifest_args_round_trip.rs | ||
| mcp_server_round_trip.rs | ||
| mcp_transport_round_trip.rs | ||
| model_costs_round_trip.rs | ||
| model_features_round_trip.rs | ||
| model_limits_round_trip.rs | ||
| model_round_trip.rs | ||
| model_test_mode_round_trip.rs | ||
| pair_round_trip.rs | ||
| parallel_branch_id_round_trip.rs | ||
| pending_interview_record_round_trip.rs | ||
| principal_round_trip.rs | ||
| provider_id_round_trip.rs | ||
| provider_round_trip.rs | ||
| pull_request_round_trip.rs | ||
| question_type_round_trip.rs | ||
| reasoning_output_round_trip.rs | ||
| run_billing_stage_round_trip.rs | ||
| run_event_round_trip.rs | ||
| run_failure_round_trip.rs | ||
| run_integrations_round_trip.rs | ||
| run_model_settings_round_trip.rs | ||
| run_projection_round_trip.rs | ||
| run_sandbox_round_trip.rs | ||
| run_summary_round_trip.rs | ||
| sandbox_details_round_trip.rs | ||
| sandbox_inventory_round_trip.rs | ||
| sandbox_services_round_trip.rs | ||
| secret_metadata_round_trip.rs | ||
| secret_type_round_trip.rs | ||
| server_settings_round_trip.rs | ||
| session_contract_round_trip.rs | ||
| stage_completion_round_trip.rs | ||
| stage_handler_round_trip.rs | ||
| stage_id_round_trip.rs | ||
| stage_model_usage_round_trip.rs | ||
| stage_outcome_round_trip.rs | ||
| stage_projection_round_trip.rs | ||
| stage_state_round_trip.rs | ||
| status_round_trip.rs | ||
| submit_answer_request_round_trip.rs | ||
| system_integrations_round_trip.rs | ||
| variable_round_trip.rs | ||
| workflow_settings_round_trip.rs | ||