pricklywiggles/dsh-circuit-breaker ↗★ 0
dsh-circuit-breaker
Stop runaway agent loops in DeepSeek Harness: denies repeated identical tool calls and enforces a per-agent call cap, outside the model where instructions cannot reach.
安装
npx -p @deepseek-ai/dsh dsh plugin --profile web add github:pricklywiggles/dsh-circuit-breaker说明文档
阅读完整 README ↗Configuration
Every setting has a default that works. To change one, target the plugin's
row id in a cordis patch layer, either your profile's cordis.patch.yml or
$DSH_HOME/cordis.patch.yml:
- id: circuit-breaker
config:
duplicateLimit: 6
maxCallsPerAgent: 300
incidentLog: /workspace/.circuit-breaker-incidents.jsonl
A circuit-breaker: section in settings.yaml does not work, and I tested
it. That namespace reaches plugins that read settings for themselves, not a
bundle plugin's config. The patch-layer override is the path that does.
| Key | Default | What it does |
|---|---|---|
enabled | true | Master switch |
duplicateLimit | 6 | Deny after this many identical calls in the window |
window | 200 | How many recent calls to remember per agent |
maxCallsPerAgent | 300 | Lifetime call cap per agent object; once hit, that agent is stopped for good. Sized for unattended subagents, which get a fresh cap per run. 0 disables it |
exempt | todo_write, ask_user_question, exit_plan_mode | Tools the guard ignores |
only | [] | If set, guard only these tools. Overrides exempt |
ignoreArgs | description, explanation, reason, thought, purpose | Argument names excluded when comparing two calls |
denyMessage | see source | Denial text. Supports {tool}, {count}, {limit} |
incidentLog | "" (off) | Append-only JSONL recording the first denial of each kind per agent, so a supervisor can notice a tripped agent. See below |
Picking a duplicateLimit
The default sits far above normal behavior on purpose. Re-reading a file or re-listing a directory a few times is ordinary work and should not be punished. Running the same search 555 times is not ordinary. At 6, a real loop dies in seconds and healthy agents never notice the plugin is installed.
Lower it if you want tighter control and can live with the occasional false positive. Raise it if your agents legitimately poll something.