dsh-plugin-adaptive-agent-policy
Run the following command in DeepSeek Harness:
dsh plugin install YuXuanLiang-dev/dsh-plugin-adaptive-agent-policy
Paste the following prompt into your AI chat to install this plugin:
Run dsh plugin install YuXuanLiang-dev/dsh-plugin-adaptive-agent-policy in DeepSeek Harness to install the adaptive agent policy plugin; source code is available at https://github.com/YuXuanLiang-dev/dsh-plugin-adaptive-agent-policy .
About this plugin
A recurring pain point when running multi-step tasks in DeepSeek Harness is that the Agent Loop applies the same step budget and tool-result accumulation regardless of task scope. A read-only analysis pays the same loop cost as a cross-module refactor, so large tasks balloon in tokens and wall-clock time while small ones lack guardrails to stay on track.
The plugin applies control proportional to task. It first classifies the work into one of five tiers - read, small, frontend, large, batch - using a text-only router with no model call, then enforces per-tier maximum output tokens, soft-checkpoint steps, and a plain-text hard stop. At each soft checkpoint the risk router picks at most one high-confidence, previously uncovered check from nine candidates and backs off when evidence is thin. Tool results are trimmed through three progressive levels (moderate, tight, critical) that protect recent outputs and skip rewriting history entirely when size and savings thresholds are not met. Policy state is delivered via a non-persistent system section, so input cost stays constant instead of growing with every step.
If you regularly run multi-step workloads - cross-module refactors, batch jobs, frontend debugging - in Harness and want to cut redundant loops without changing your model, provider, or toolchain, this is a lightweight workflow-level adjustment. It does not touch permissions, sandboxing, or model selection, and requires no separate installation of the upstream pruner.
Use Cases
- Large multi-step refactors generate redundant loops and excess tokens
- Batch jobs and long debugging chains see tool results bloat and context pressure spike
- Frontend debugging sessions retry repeatedly without step budgets or hard stops
Best For
- Power users running multi-step workflows in Harness regularly
- Teams looking to reduce token overhead without swapping models or toolchains
- Developers who need workflow-level guardrails without modifying Agent core code
Related Plugins
A method pack that makes AI coding agents plan against your real baseline, prove completion with fresh evidence, and reduce reworks and unsafe changes.
Turns the DeepSeek Harness session into a captain that builds a durable sub-agent team, splits goals into dependency-aware tasks, and coordinates work via direct messages and a live Web UI.
Gives coding agents design judgment, letting Claude Code, Cursor, and 70+ agents generate and iterate high-quality UI, presentations, and graphics right from the terminal.
Run the Pi ecosystem's plugins on DeepSeek Harness, unmodified, via a compatibility layer that implements Pi's public extension ABI on DSH's native services.