nunchakus888/dsh-turn-budget

Fail-closed per-turn budgets for DeepSeek Harness: cap model steps, tool calls and provider-reported tokens, ending the turn as blocked.

Governs one agent turn at a time: it caps model steps, root and nested tool executions, and provider-reported token usage independently, and records the policy outcome in the canonical session log through the existing tool/result and turn/end records. Exceeding the step or token ceiling rejects the next request and the turn closes as blocked; an excess tool call returns a policy error naming the budget that was exceeded while leaving the model one chance to finish without another call.

Agent Capabilities ★ 1
View on GitHub ↗

Install

⚠️ Upstream documents a local-checkout install — the command it gives is a path on your own machine, so there is nothing pasteable here. See the README for its exact steps.

Compatibility

Fail-closed by design: agent/pre-step rejects a model request that would exceed the step or provider-token ceiling, and tools/pre-execute denies a tool body before dispatch once the turn has spent its tool allowance. Every configured limit must be a positive safe integer and at least one is required. Token enforcement is exact only when the provider reports usage — missing usage is never estimated — and a provider can exceed the ceiling inside its current response, because no preemptive token stream budget is exposed. The tool ledger is process-local and keyed by live agent identity; cold recovery closes interrupted turns rather than resuming an old ledger. It is a circuit breaker, not a billing system: no currency estimates, no argument rewriting, no replacement for sandboxing or approvals, and it cannot terminate an uncooperative operation mid-step.

Details

Alternatives

vibeinging/dsh-agent-budget · perrylink/dsh-budget · frozo-ai/dsh-budget

More plugins in Agent Capabilities

Browse more in Agent Capabilities

Guides for Agent Capabilities plugins