mirror of
https://github.com/rennf93/roboco.git
synced 2026-08-03 07:23:24 +02:00
Claude Code's per-agent token-budget hook fires against the SDK :9000 server; opencode exposes NO usage/budget hook to a plugin (confirmed against its plugin docs), so the budget kill-switch can't be a plugin/sidecar — the orchestrator enforces it instead. _enforce_grok_cost_budget runs each dispatch tick: for every ACTIVE GROK container it reads cumulative cost from the opencode store (the Phase-2 reader) and kills + evicts it past ROBOCO_GROK_MAX_COST_USD (0 = off), after which the reaper releases the freed task. This also catches a runaway loop that keeps firing verbs (so it evades the idle watchdog) but still burns cost. Covers the budget/runaway-burn slice of guardrail parity. The remaining Claude hooks (prompt-injection PRE-gate, stop-guard terminal-verb) have no blocking opencode equivalent — opencode's message/stop hooks are observe-only — and the interactive reasoning-variant has no opencode.json/serve knob (CLI-flag only); both are pinned for a live probe rather than shipped as a guess.