dsh-tool-call-limit
Run the following command in DeepSeek Harness:
dsh plugin install zhourenke/dsh-tool-call-limit
Paste the following prompt into your AI chat to install this plugin:
Run dsh plugin install zhourenke/dsh-tool-call-limit in DeepSeek Harness to install this plugin (open-source: https://github.com/zhourenke/dsh-tool-call-limit).
About this plugin
In multi-agent, multi-step DSH conversations, a single step that repeatedly calls web_search or grep can quickly bloat context and push costs over budget. maxParallelToolCalls constrains concurrency width but says nothing about how many times a given tool may be invoked within one step. dsh-tool-call-limit fills that gap: per-tool-name, per-live-agent, per-step quotas give every step a hard ceiling on total tool invocations.
The plugin performs synchronous quota reservation at the tools/pre-execute hook, so two parallel web_search calls in the same step will only ever let one through. Once a slot is consumed it is never refunded, even if the tool subsequently fails, times out, or is rejected by a downstream policy, which prevents retry loops from silently bypassing the limit. Different tool names are counted independently, so a web_search call never eats into a grep budget. State is held in a WeakMap keyed by the live Agent object and is cleaned up on step completion, Agent disposal, or process restart; it is never written to the session transcript nor shared across DSH instances.
Built for developers shipping production multi-agent applications on DSH who need a hard per-step ceiling on tool-call frequency. The plugin governs invocations that enter the DSH ToolRuntime; it does not constrain the multiple queries inside a single web_search call, the multiple shell commands inside one bash invocation, or internal API requests of MCP and custom tools. Those remain the responsibility of each individual tool configuration. If you need concurrency-width control, maxParallelToolCalls is a separate layer; this plugin answers a different question: how many times, in total, may a given tool be called in this step?
Use Cases
- Prevent a single agent from repeatedly invoking search tools within one step and blowing past the context window in parallel multi-agent runs
- Stop retry loops where a failed or timed-out tool call is immediately re-issued, keeping total per-step invocations bounded
- Enforce a hard per-step ceiling on each tool in production to reduce unpredictable cost spikes
Best For
- DSH developers building production-grade multi-agent applications
- Engineering teams that need step-granularity control over tool-call frequency, not just concurrency caps
- Application architects focused on context-window management and LLM cost containment
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.