dsh-plugin-agent-budget
Run the following command in DeepSeek Harness:
dsh plugin install winter-street/dsh-plugin-agent-budget
Paste the following prompt into your AI chat to install this plugin:
Run dsh plugin install winter-street/dsh-plugin-agent-budget in DeepSeek Harness to install this plugin; the complete source is available at https://github.com/winter-street/dsh-plugin-agent-budget
About this plugin
In a DeepSeek Harness multi-agent workflow, a root agent may spawn one-shot or continuable subagents and further trigger workflow descendants, scattering token spend across many calls with no single choke point. dsh-plugin-agent-budget treats the entire agent tree as one shared budget account (scope: tree) or meters each session independently (scope: session), so an admin or the model itself can see the remaining allowance before a call is dispatched, and any call that would push settled usage past the limit is rejected with TOKEN_BUDGET_EXHAUSTED in a fail-closed manner.
The ledger is stored as an append-only event stream in a plugin-owned sidecar directory (default ~/.dsh/agent-budget/), kept out of session logs so that uninstalling the plugin never breaks existing sessions. The stream is replayable and recoverable; legacy budget events that older versions wrote into session logs can be migrated out in one pass. On the model side, a read-only budget_status tool exposes the limit, used and remaining tokens, all four usage buckets, and metering completeness. The web settings panel renders a progress bar per scope and lets users adjust limits or reset usage online without touching ledger files by hand.
The plugin has no external service dependency and runs as a plain local bundle. It is well suited to developers who run DSH sub-agent, workflow, or compaction pipelines and want a single, durable, fail-closed token budget governing the whole tree.
Use Cases
- Centralize token spend across a root agent, its subagents, and workflow descendants to prevent unbounded usage
- Set an independent per-session token cap so one session cannot exhaust the entire allowance
- Let the model check remaining budget via a read-only tool before dispatching, with automatic rejection once the limit is reached
Best For
- Developers running DSH sub-agent or workflow pipelines who need a single, unified token cap
- Teams that want centralized usage governance across sessions and agents without any external service
- Contributors building or extending the DSH plugin ecosystem who care about fail-closed metering semantics
Related Plugins
A service-oriented sidebar framework for DSH, offering a full workbench with file explorer, embedded browser, real terminal, Git panel, and extensible plugin services.
A beautiful, practical Claude Code-style TUI plugin with pixel whale top bar, flowing glow title, real-time status line, streaming thought expansion, time rewind, context progress bar and TPS gauge — zero core changes.
The plugin market for DeepSeek Harness: browse/search/one-click install community plugins and themes, with updates, backup/restore, hot disable, diagnostics, and AI fix.
A persistent whale widget on the DSH web UI that shows DeepSeek balance, today's usage, and per-turn cost, with drag-and-snap and sound effects.