pricklywiggles/dsh-circuit-breaker0

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.

包名
dsh-circuit-breaker
版本
0.1.0
许可证
MIT
最近更新
2026年9月2日

安装

$npx -p @deepseek-ai/dsh dsh plugin --profile web add github:pricklywiggles/dsh-circuit-breaker

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.

KeyDefaultWhat it does
enabledtrueMaster switch
duplicateLimit6Deny after this many identical calls in the window
window200How many recent calls to remember per agent
maxCallsPerAgent300Lifetime 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
exempttodo_write, ask_user_question, exit_plan_modeTools the guard ignores
only[]If set, guard only these tools. Overrides exempt
ignoreArgsdescription, explanation, reason, thought, purposeArgument names excluded when comparing two calls
denyMessagesee sourceDenial 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.