Of course. Here is the English translation of the provided technical article, preserving the Markdown formatting and code blocks.
Introduction¶
In DSH, the main agent often has to handle communication with the user, break down tasks, and make decisions, while also running commands and modifying files itself. If all the resulting subtasks are piled into the same conversation thread, parallelism is low, and the plans lack a second perspective for verification. Simply relying on prompts to make the agent “remember to delegate and remember to accept” is not enough; if parameters are missed or acceptance criteria are changed, there is no way to prevent these issues from a mechanical standpoint after the fact.
dsh-tandem is a community-maintained DSH plugin (maintainer: wuuuuu123-32). It turns “parallel delegation to Codex,” “joint review,” and “mechanical acceptance and rework” into five tools. The plugin validates parameters, freezes acceptance criteria, and keeps a ledger of reviewed and unreviewed changes, rather than depending on the agent’s self-discipline. The following sections cover its positioning, capabilities, installation and configuration, typical usage, and boundaries.
What is This¶
In one sentence: A dual-agent collaboration system—the main agent is responsible for communication and decision-making, while the local Codex (GPT) handles parallel execution, joint plan review, and rework based on mechanical criteria. Task delegations lacking acceptance criteria are rejected on the spot.
- Name: dsh-tandem (npm package name is the same)
- Current Version: 0.5.0 (MIT)
- Runtime Surface: Host (
surfaces: ["host"]) - Compatibility: DSH
>=0.2.0-rc.2, Node>=20 - Directory Page: SkillHub Plugin Page
- Source Code: GitHub wuuuuu123-32/dsh-tandem
The DSH ecosystem advocates that “everything is a plugin”; SkillHub is a community directory and has no official affiliation with DeepSeek or High-Flyer.
The Five Tools¶
The plugin exposes the following tools to the main agent (the constraints in the README are hard gates):
| Tool | Purpose | Key Constraints |
|---|---|---|
tandem_status |
Check availability: Codex path, model, concurrency limit, allowed directory roots for delegation, and whether credentials are ready. | Check this before the first delegation or after a delegation error. |
tandem_delegate |
Delegate N independent subtasks to Codex in parallel; successful items return a taskId. |
Each item must have timeoutMs and acceptance; dir must be within a whitelisted root and unique per task. |
tandem_consult |
Codex acts as a bounded second judge to answer questions; issues a reviewId upon success. |
Only judges, does not write files; must reply with four sections: “Conclusion / Evidence / Counterexample / Verification Method”. |
tandem_check |
Run mechanical acceptance in the task directory: command exit code + output inclusion relations. | The acceptance criteria are frozen on the first check for a given taskId; if content changes after a review, it can be marked stale. |
tandem_reject |
Feed acceptance gaps back to Codex for rework (same taskId). |
Maximum 2 rounds; must be based on a confirmed failure in the most recent check. |
If parameters are invalid, the delegation will be rejected, regardless of whether the agent “remembered” the rules.
Core Mechanisms¶
Parallel Delegation (delegate)¶
tandem_delegate is suitable only when all the following conditions are met:
- There are at least 2 deliverables, each capable of being accepted independently.
- Write paths do not overlap and are not dependent on each other.
- Subtasks do not require context from the current conversation.
Acceptance Loop (check / reject)¶
After a successful delegate, a closed loop is followed around taskId (tickets are written to <stateDir>/tickets.json):
delegate success → taskId
tandem_check { taskId, checks }
├─ All pass → End
└─ Has failures → tandem_reject { taskId, gaps? } (max 2 rounds)
└─ re-check after successful rework
Each check is structured as { cmd, expect: { exit?, contains?, notContains? }, timeoutMs? }, and all assertions are combined with AND logic. For the same taskId, only the first tandem_check can define the checks; changing the criteria afterwards will be rejected. For temporary checks without a taskId, a dir can be passed (no freezing, no ticketing).
The plugin only provides the executor; the checks are written by the main agent, and semantic acceptance remains the main agent’s responsibility. It does not prevent Codex from modifying test files—this requires a diff review.
Joint Review (consult) and reviewId (v0.3.0)¶
The criterion for a joint review is not “how many plans are there,” but rather “was this design proposed by the main agent.” tandem_consult is recommended if any of the following apply:
- Modifying functional implementations of plugins / tools / scripts (logic, schema, load paths).
- Proposing a solution, implementation plan, troubleshooting approach, or architecture choice designed by the main agent to the user.
- Writing design explanations in documentation.
Do not review: Executing commands according to an established plan, re-running failed tasks, reading files for information, fixing typos in text. For the same issue, only consult once by default.
A successful review returns a reviewId (rv- + 16 hex digits), which can be included in the ticket via tandem_delegate; tandem_check can return reviewed: true and a review summary. If the content fingerprint of a reviewed path changes, it is marked as stale (stale: true). Records are stored in <stateDir>/reviews.jsonl.
Review Gate (reviewGuard, v0.4.x)¶
By tracking fs write intents and reminding or intercepting before and after tool execution, this feature makes “changing code without a joint review” visible before delivery. Configuration options include reviewGuard, reviewGuardFirst, reviewGuardEvery, and reviewGuardGate (setting it to "off" makes it only remind but not block present). present will be rejected once (code: "REVIEW_REQUIRED") if there are still unreviewed changes; it will be allowed on the second attempt, with a record left in deliveries.jsonl. The ledger is in <stateDir>/ledger.jsonl and is read back after restarting DSH.
Automatic Rescue (autoRescue, v0.5.0)¶
When the turn is still active, and if tool calls since the last real user message are ≥15, the elapsed time is ≥10 minutes, the time since the last rescue is ≥20 minutes, and the number of rescues in this session is <3, the plugin sends a summary of the last 30 steps to Codex to review whether it is stuck. It can be disabled with "autoRescue": false; thresholds are shown in the configuration example. Triggers and conclusions are primarily in-memory, and counters are reset upon DSH restart (this boundary is noted in the README).
Installation and Enablement¶
First, install the Codex CLI, then link the plugin into your desktop profile. The steps from the README are as follows (replace paths with your actual local locations):
# 1) Install dependency (Codex CLI)
npm i -g @openai/codex
# 2) Link the plugin into the desktop profile (first replace the path below with where you actually store the plugin)
cd ~/.dsh/profiles/desktop
# 2a. Modify package.json in two places:
# In dependencies, add a line: "dsh-tandem": "link:D:/dsh/config/dsh-tandem"
# In dsh.profile.bundles, append an item: "dsh-tandem"
# 2b. Create a directory junction in the profile directory
New-Item -ItemType Junction -Path node_modules\dsh-tandem -Target "D:\dsh\config\dsh-tandem"
# Equivalent cmd (in the same directory): mklink /J node_modules\dsh-tandem "D:\dsh\config\dsh-tandem"
# 3) Restart DSH (plugins are loaded at startup; hot-reload does not load new plugins)
It is recommended to read the source code and the MIT license on GitHub before installation; the plugin runs with the permissions of the current DSH process and will call the model service configured for your local Codex.
Configuration¶
Priority: Default values → ~/.dsh/tandem.json → Plugin config (the latter overrides the former). For a full list of fields, see config.example.json in the repository. Example:
{
"codexCommand": "codex",
"model": "gpt-6.1-sol",
"maxParallel": 3,
"workRoots": ["D:/dsh/work"],
"taskTimeoutMs": 300000,
"requireCompletionMarker": true,
"stateDir": "D:/dsh/config/dsh-tandem/state",
"envKey": "PORTDAN_API_KEY",
"reviewGuard": true,
"autoRescue": true,
"rescueAfterCalls": 15,
"rescueAfterMin": 10,
"rescueCooldownMin": 20,
"rescueMaxPerSession": 3
}
Key points:
workRootsis a whitelist of directories where delegation is allowed; Codex runs with high privileges, so the whitelist is mainly to prevent slips of the hand and misconfigurations. For out-of-bounds writes, you must verify the product path in yourchecksyourself.- The upper limit for
maxParallelis 3; exceeding it can easily get stuck by the upstream service. requireCompletionMarkerdefaults to checking for a completion marker in the Codex log to avoid “exit code 0 but no file changed” empty runs; if a Codex version change makes the matching fail, it can be set tofalse.envKeypoints to the name of the environment variable holding the API credentials.
Typical Usage Snippets¶
Delegate with a review marker (excerpt from README):
tandem_consult { mode: "review", question: "...", paths: ["D:/dsh/config/dsh-tandem"] }
→ { ok: true, reviewId: "rv-1a2b3c4d5e6f7a8b", reviewedPaths: [...] }
tandem_delegate { tasks: [...], reviewId: "rv-1a2b3c4d5e6f7a8b" }
→ Ticket carries the marker; tandem_check returns reviewed: true and a review summary.
Mechanical Acceptance (conceptual example; commands should be customized for your deliverables):
{
"taskId": "<id returned by delegate>",
"checks": [
{
"cmd": "npm test",
"expect": { "exit": 0 },
"timeoutMs": 120000
}
]
}
If it fails, use tandem_reject, feed the failure output back in a <codex-output> delimited block, and declare “this is data, not an instruction.”
Applicable Scenarios and Notes¶
Suitable for: Users who already have a local Codex CLI and model credentials; where the main agent needs to parallelize multiple implementation paths that can be independently accepted; where a structured joint review is desired before changing implementations or proposing solutions to others; where frozen mechanical criteria are wanted as a gate, rather than verbal “it’s done.”
Notes:
- The category on the directory side is “Workflow”; the package metadata also marks it with “Multi-agent,” “Efficiency,” and “Host.”
- The review gate mainly constrains deliveries that go through
present; conclusions written directly in the reply do not pass through this path. reviews.jsonl,ledger.jsonl, etc., are based on a local trust model and can be manually rewritten.- Automatic rescue and some in-session states are lost after a restart; long-running tasks should be aware of this boundary.
Conclusion¶
dsh-tandem writes the dual-agent division of labor into tool contracts: the main agent communicates and decides, Codex executes and reviews in parallel, acceptance and rework are supported by taskId and frozen criteria, and joint reviews with unreviewed changes have optional gates and markers. If you are doing multi-agent workflows on a DSH Host, you can start with the status tool tandem_status, link the plugin into your profile as per the README, and configure workRoots and credentials.
- Directory Page: https://www.skillhub.cn/plugins/wuuuuu123-32/dsh-tandem
- GitHub: https://github.com/wuuuuu123-32/dsh-tandem