HN 표시: OpenClaw 플러그인 – 에이전트 도구 통화에 대한 엄격한 예산 제한

hackernews | | 📦 오픈소스
#ai 에이전트 #openclaw #반도체 #예산 관리 #하드웨어/반도체
원문 출처: hackernews · Genesis Park에서 요약 및 분석

요약

OpenClaw 플러그인은 Cycles 서버와 연동하여 에이전트 실행 중 예산 경계를 강제하고, 자금이 부족하면 모델을 다운그레이드하거나 실행을 차단합니다. 이 플러그인은 도구 호출 전 예산을 예약하고 사용 후 커밋하는 프로토콜을 사용하며, 세션 종료 시 예산 요약을 제공합니다. 현재 1단계에서는 토큰 수준의 적용이나 스트리밍 비용 추적을 지원하지 않으나, 향후 게이트웨이 수준 통합을 통해 개선될 예정입니다.

본문

OpenClaw plugin for budget-aware model and tool execution using Cycles. AI agents make autonomous decisions — calling models, invoking tools, retrying on failure — with no human in the loop. Without runtime enforcement, several things go wrong: Runaway spend. A single agent stuck in a tool loop or retrying failed calls can burn through hundreds of dollars in minutes. Provider spending caps are account-wide and too coarse. Rate limits don't account for cost. In-app counters don't survive restarts or coordinate across concurrent agents. Uncontrolled side-effects. An agent can send 100 emails, trigger 50 deployments, or call dangerous APIs with nothing to stop it. Cost limits alone don't help — some actions are consequential regardless of price. Noisy neighbors. In multi-tenant or multi-user setups, one agent can consume the entire team or tenant budget, starving other users. Without per-user scoping, there's no isolation. No session-level cost visibility. When an agent session ends, you have no idea what it spent, which tools it called most, or whether it was cost-efficient. Debugging cost overruns after the fact is painful. Abrupt failure. When budget runs out, the agent crashes instead of adapting — switching to cheaper models, reducing output length, or disabling expensive tools. This plugin addresses those failure modes by checking model and tool execution before it runs, then degrading or blocking when budget conditions require it. It also tracks session-level cost breakdowns, tool usage, and budget transitions for debugging and operations. Beyond enforcement, the plugin monitors for problems as they develop: - Burn rate anomaly detection catches runaway tool loops — if spending spikes 3x above the session average, onBurnRateAnomaly fires immediately - Predictive exhaustion warnings estimate when budget will run out and fire onExhaustionForecast before it happens - Automatic retry with backoff on transient Cycles server errors (429/503) prevents spurious denials under load - Reservation heartbeat auto-extends long-running tool reservations so cost tracking doesn't silently break - Observability via metricsEmitter (Datadog, Prometheus, Grafana, OTLP) and opt-in session event logs In typical OpenClaw setups, you can add enforcement without changing agent logic. For deeper background, see Why Rate Limits Are Not Enough and Runaway Agents and Tool Loops. A comprehensive OpenClaw plugin that integrates with a live Cycles server to enforce budget boundaries during agent execution. It hooks into the OpenClaw plugin lifecycle to: - Reserve budget for model and tool calls using the reserve → commit → release protocol - Downgrade models when budget is low (configurable fallback chains) - Block execution when budget is exhausted (fail-closed by default) - Inject budget hints into prompts so the model is budget-aware - Detect budget transitions and fire callbacks/webhooks on level changes - Control tool access with allowlists, blocklists, and per-tool call limits - Apply graceful degradation strategies when budget is low - Retry denied reservations and transient server errors with configurable backoff - Keep long-running tools alive with automatic reservation heartbeat - Detect anomalies — burn rate spikes and predictive exhaustion warnings - Emit metrics to Datadog, Prometheus, Grafana, or any OTLP-compatible backend - Record an event log of every budget decision for debugging and compliance - Report unconfigured tools so you know which tools are using default cost estimates - Support dry-run mode for testing without a live Cycles server - Track per-tool cost breakdowns and session analytics with model cost reconciliation - Support multi-currency budgets with per-tool/model overrides - Support budget pools/hierarchies via parent budget visibility The plugin uses the runcycles TypeScript client to communicate with a Cycles server. Important: Budget exhaustion is enforced fail-closed by default, but Cycles server connectivity failures are handled fail-open — the plugin assumes healthy budget and allows execution to continue. See Fail-Open Behavior for details. - OpenClaw >= 0.1.0 with plugin support - Node.js >= 20.0.0 - A running Cycles server with: - A base URL (e.g. http://localhost:7878 ) - An API key - A tenant configured with a budget scope - A base URL (e.g. If you don't have a Cycles server yet, see the Cycles quickstart to set one up. Alternatively, use dry-run mode to test without a server. To see budget enforcement in action before wiring up your own agent, run the Cycles Runaway Demo — it shows the exact failure mode this plugin prevents, with a live before/after comparison. openclaw plugins install @runcycles/openclaw-budget-guard For local development: openclaw plugins install -l ./cycles-openclaw-budget-guard openclaw plugins enable openclaw-budget-guard Add the following to your OpenClaw config file (typically openclaw.json or openclaw.config.json ): { "plugins": { "entries": { "openclaw-budget-guard"

Genesis Park 편집팀이 AI를 활용하여 작성한 분석입니다. 원문은 출처 링크를 통해 확인할 수 있습니다.

공유

관련 저널 읽기

전체 보기 →