@deepseek-ai/dsh-agent-budget/command
August 11, 2026 · View on GitHub
English | 中文
@deepseek-ai/dsh-agent-budget/command gives a user one direct /budget command for the durable Agent budget service. It does not start a model turn. Command input and output are logged as non-surface command/run and command/done events, so checking or increasing a budget does not change the model prompt or invalidate its reusable prefix cache.
The package bundle loads this command with model-facing budget tools disabled. The Agent only experiences the admission result: work continues while capacity remains, and a hard limit refuses new provider calls or guarded resource-starting tools after capacity is exhausted.
Commands
Token arguments use millions of Tokens because one Agent tree can reasonably consume several million Tokens.
| Command | Result |
|---|---|
/budget | Show spent, reserved, total, remaining, deadline, status, and accounting accuracy |
/budget set 3 | Create the default tree-wide hard limit of 3,000,000 Tokens |
/budget set 0.5 session soft 30m | Create a 500,000-Token session limit with a 30-minute deadline |
/budget add 1 | Add 1,000,000 Tokens to the existing account |
/budget extend 2h | Extend the existing deadline by two hours, starting from now if already expired |
Decimal Token amounts have at most six places, so /budget add 0.000001 adds exactly one Token. Durations accept ms, s, m, or h.
Only the exact live Agent that owns an account can add Tokens or extend time. A child Agent can spend from an inherited tree account and view it, but cannot grant more capacity. Additional capacity can restore an exhausted or expired account; it never clears uncertain usage.
Composition
Load the command after @deepseek-ai/dsh-agent-budget and the shared command service.
- name: '@deepseek-ai/dsh-agent-budget'
config:
fallbackMaxOutputTokens: 8192
guardedToolNames: [subagent, subagent_fork, workflow, ralph]
modelTools: false
managementCommandName: budget
- name: '@deepseek-ai/dsh-agent-budget/command'
config:
defaultScope: tree
defaultEnforcement: hard
defaultScope controls the short /budget set <million-tokens> form. defaultEnforcement chooses whether a crossed limit records the overrun (soft) or refuses new work (hard).
managementCommandName: budget tells the budget service that this composition really provides /budget, allowing hard-admission errors to include valid recovery instructions. Leave it unset in compositions without this command.
The command depends on the Host's authenticated command source. It is not a model tool and is not a separate HTTP or browser API.
Model Experience
Human /budget control
What the model sees
Nothing. /budget runs through the authenticated human command path and records only non-surface command events. The package bundle also disables the optional model-facing budget tools.
Token effect
The command adds no tool schema, prompt text, or conversation message to a model request. Its result is visible to the user without consuming model Tokens.
KV Cache effect
Checking or increasing a budget does not alter the reusable prompt prefix. Admission reads the durable ledger outside the model request.
Known Limitations and Deferred Work
- Existing accounts can only be increased or extended. Decrease, replace, reset, close, and uncertain-usage reconciliation are not implemented.
- The command displays the current durable account after it runs. It does not stream a continuously changing counter into the conversation.
- Only applications with a human command adapter expose
/budget.