Executor/advisor workflow ported from pi-advisor-flow: the executor calls ask_advisor for a second opinion at key decisions, after repeated failures and before completion; equivalent repeated tool calls are intercepted before execution for an advisor review with a proceed/revise/blocked verdict, and hard mode force-reviews every turn before it closes. Per-call token and cost ledger with /advisor status readout, privacy tiers for repo context and file contents, six-shape secret redaction, and a web settings card; advisor failures never stall the main loop.
Install
# from a prebuilt release tarball
dsh plugin --profile web add "https://github.com/ccll/dsh-advisor-flow/releases/download/v0.2.1/dsh-advisor-flow-0.2.1.tgz"
# from GitHub (first run asks for allowBuilds approval — follow the hint, retry)
dsh plugin --profile web add github:ccll/dsh-advisor-flow
Any plugin you install runs third-party code with your own permissions — it can read your files, use your credentials, and reach the network, and tool approvals don’t sandbox it. GitHub-sourced plugins also run build scripts at install time — pnpm blocks those until you allow them, so an install can stop with ERR_PNPM_GIT_DEP_PREPARE_NOT_ALLOWED or ERR_PNPM_IGNORED_BUILDS; dsh prints the exact key to add under allowBuilds in your profile’s pnpm-workspace.yaml, and the install works on the next run. Allowing a build is a trust decision: only install sources you trust, and pin a commit (github:owner/repo#sha).
README
English | 简体中文
A DeepSeek Harness (DSH) plugin that ports the pi-advisor-flow executor/advisor workflow to DSH. Everyday work runs on the everyday model; at key decisions, after repeated failures and before a turn closes, a stronger advisor model provides a second opinion. The advisor only advises — it never takes over the work (no tools, no file edits), and the session owner keeps full configurability and visibility over cost, privacy and blocking behavior.
Observable behavior is aligned with pi-advisor-flow 0.8.2 (divergences are listed item by item in RATIONALE.md).
How it works
- On-demand consultation: the executor calls the
ask_advisortool whenever it wants a second opinion — with no arguments for a general review, or with a question, a draft, a repo-context tier (it can only narrow the owner's allowed tier) and a hand-picked file list. Every answer carries anadviceIdfor later reference. - Manual consultation: the session owner can trigger a consultation at any time with
/advisor-manual [focus], and cancel one in flight with/advisor cancel. - Hard loop gate: when the same tool call with an equivalent signature repeats up to the threshold (default 3), the host intercepts the call before it executes and asks the advisor to review; the advisor answers with a three-value decision —
proceed | revise | blocked— andblockedis handled according to the configured blocking mode (warn-and-continue | block-tool | block-session). - Executor guidelines: before-plan / after-failure / before-completion guidelines are injected into the system prompt as soft constraints (on by default; the text matches the pi 0.8.2 English original verbatim).
- Hard completion review (default mode): in the default hard intervention mode, every executor turn is reviewed by the advisor before it closes; a
reviseorblockedverdict sends the full advice back to the executor to keep working. In soft mode the plugin behaves exactly like pi-advisor-flow: guidelines only. - Outcome recording: the
record_advisor_outcometool lets the executor voluntarily record whether an advice was followed and validated (one-shot JSONL entries, advice text stored as an HMAC hash; off by default). - Usage ledger and status: per-call and cumulative input/output/cache tokens with cost details, categorized by trigger (on-demand / manual / gate);
/advisor statusshows the model routing, gate state and gate decision statistics. - Privacy tiers: repo context
off | summary | full, file contents never leave the machine without an independent opt-in (ownership-checked), and secret-shaped values are replaced with placeholders before anything is sent — redaction runs before truncation. - Non-blocking guarantee: any advisor or gate failure never stalls the main agent loop.
Install
dsh plugin --profile web add dsh-advisor-flow
The npm package ships prebuilt, so no local build step is needed. If the settings card does not appear after installing, restart dsh web once. A listing on dsh-market (dsh plugin --profile web add dshmarket), the plugin market inside DSH, is in progress via the curated awesome-dsh-plugin index.
npm publication is in progress — until it lands, install straight from this repository:
dsh plugin --profile web add github:ccll/dsh-advisor-flow
No host source patches and no postinstall scripts — plugin integration is declared entirely through the standard dsh.bundle manifest (cordis.patch.yml declares the plugin's own insertion, not a modification of DSH). Version assumptions about DSH's plugin seams are declared in package.json under dsh.compat.
Requirements
- DSH web, tested against
@deepseek-ai/dsh@0.1.5-rc.1(seedsh.compatinpackage.json). - An advisor model reachable through DSH's own model routing — pick any provider/model already configured in DSH; the plugin reuses the host LLM service and never talks to providers directly.
Configuration
Configuration lives in the advisor-flow namespace of settings.yaml and can also be edited in the web settings card. Changes apply live, no restart needed. Highlights:
- Enable prerequisites:
advisor-flow.enabled: trueplusadvisor.provider/advisor.model; with an incomplete configuration the whole feature stays disabled and the reason is queryable via/advisor status. mode— intervention strength:hard(default; forces a completion review before every turn closes) orsoft(guidelines only, pi behavior).advisor.callTimeoutMs— overall timeout for one consultation, default 600000 ms (10 minutes).advisor.maxTokens— output cap for one consultation; by default it follows the host's configured cap for the selected model.- Loop-gate threshold defaults to 3 (minimum 2); the three guidelines and the loop gate are on by default; secret redaction is off by default (enable it in the settings card — recommended, secret-shaped values are then sent as placeholders).
privacy.repoContext(off | summary | full, defaultsummary),privacy.fileContent/privacy.untrackedContent/privacy.trackedFileContent(defaultfalse), per-tool disclosure policies viatoolPolicies.- For the full key list,
lib/config.jsis the source of truth for the namespace contract, andSOLUTION.md#产品契约documents every key with its default.
advisor-flow:
enabled: true
advisor:
provider: deepseek-official
model: deepseek-reasoner
mode: hard
gates:
plan: { enabled: true }
failure: { enabled: true }
loop: { enabled: true, threshold: 3 }
completion: { enabled: true }
failureMode: block-tool
privacy:
repoContext: summary
redactSecrets: true
Commands
/advisor-manual [focus]— start a manual consultation immediately; cancel one in flight with/advisor cancel./advisor [on|off|toggle|status|gates|cancel]— session-level switch and status queries; bare/advisortoggles.
Development
npm test # unit tests (node --test)
npm run build:client # rebuild the web settings-card client bundle
node scripts/screenshot.mjs shots # regenerate README screenshots in an isolated demo environment
Commit and verification gates (AgentMap living docs + .githooks/) are described in CONVENTIONS.md.
Acknowledgments & Disclaimers
- This project ports the executor/advisor workflow of the MIT-licensed
pi-advisor-flow(version 0.8.2) to DeepSeek Harness; the guideline and protocol texts are kept verbatim where the host allows it. Thanks to the original author for the design. - Advisor reviews are model output, not ground truth: treat them as a second opinion, not as a verification oracle.
- 99.99% of this project's code and documentation was written and reviewed by AI, so bugs and doc/code drift are quite likely. If you run into any problems, please open an issue.
License
MIT — see LICENSE for the full text.
Links
More in this category
Clearailhc/clearai-dsh★ 696
An agent preset for evidence-checked research: every step advances only through system-verified observations, L3+ claims go to an independent evaluator, and the session folds into a replayable ledger that grows into a browsable domain ontology. Requires DSH >=0.1.7-alpha.1.
FuRongJun-1999/dsh-memory★ 672
White-box AGI architecture exploration: metacognition (self-cognition loop), continual learning (knowledge flywheel), world model (condition space, spatiotemporal memory graph), self-improvement (bootstrap discipline), zero-LLM white-box pipeline, and auditable trust guardrails.
icyaaaww/dsh-soul★ 85
Records recurring task corrections and tool failures locally, then compiles them into changes to eight harness components through explicitly started evolution, paired baseline/candidate checks, trial activation and rollback. Includes a budget and audit ledger; requires Node.js 24+ and a compatible DSH 0.2.1-rc.2 or later 0.2.x host.
MichengAI/dsh-pua★ 72
Adds /pua to steer the agent to try another approach and verify results before claiming completion, with 15 company styles, persona modes, global and per-conversation settings, and an optional loop that continues until a verification command passes, the iteration limit is reached, or the user cancels.
kenz1117/dsh-engram★ 70
Cross-session long-term memory as a local SQLite store: dual scopes (user + per-git-origin project), hybrid FTS5 + local-vector retrieval fused with RRF, an evidence gate that forces an explicit sufficiency judgement, provenance audit chains, SM-2 spaced-repetition review, consolidation distillation and decay forgetting, and a nine-view "Memory Palace" sidebar panel. 22 narrow-parameter tools, no external service, no API key, no Docker.
pk14742952-AD/dsh-host-rsi★ 39
Reflective self-evolution plugin for local Qwen3.8 27B/3.8 Flash and online APIs: a coding-loop convergence steerer curbs Qwen3.8 27B/Flash repeated-verification deep-thinking to converge faster and cut thinking time; a five-state delivery guard detects and corrects stuck turns and infinite loops; model-agnostic host logic, mostly compatible with online APIs; per-use continual self-improvement with counter-reason self-checks, critic escalation, inverted-index memory retrieval, coding-loop convergence steering, and a five-state delivery guard.
Community comments
Comments are public GitHub Discussions. Loading them connects to GitHub and Giscus; a GitHub account is required to post.