JIAChenyu525/dsh-explore--packages-plugin ↗★ 0
dsh-explore
**Trajectory-level parallel exploration for DeepSeek Harness agents.**
AI Analysis
核心用途是通过多路并行尝试提升智能体解决复杂问题的成功率。适合需要对同一任务探索多种不同方案并对比结果的高级任务场景。
Install
npx -p @deepseek-ai/dsh dsh plugin --profile web add github:JIAChenyu525/dsh-explore#eefc3992efc4ce6fde25767baf50b5352ce14907&path:packages/pluginREADME
Read the full README ↗dsh-explore
Trajectory-level parallel exploration for DeepSeek Harness agents.
When you need more than one answer, dsh-explore forks your agent into N parallel branches — each inherits your conversation context and independently explores a different approach — then returns all their answers (or picks a winner, when a verifier is available).
one agent, one task
│
├─ fork #1 ──→ answer A
├─ fork #2 ──→ answer B ──→ (optional) verify → keep winner
└─ fork #3 ──→ answer C
What it does today (v0)
exploretool — call it with{ branches: N }to fork N subagents in parallel and get N genuinely different answers.- Built on dsh's
forksubagent provider: each branch is seeded with the parent's completed-turn prefix, so it shares your full context. - Works today. Live-tested against the preview build.
What's built but pending (v1)
verifyparameter — run a shell command against each branch and pick the one that passes (ground truth, not LLM-judge).- Winner diff —
diffTrajectoriesexplains why the winner won (shared prefix → divergent tool calls → error counts). - Both are implemented and unit-tested; the end-to-end path is blocked on workspace isolation: dsh's fork subagents share the parent's working directory, so parallel branches would clobber each other's file edits. The planned fix is propose-a-diff → apply to a git worktree → verify (the pattern from ParallelEnv's tree-forking).
Why it's reliable
- Deterministic rollback — dsh's
forkseeds each child with the parent's exact prefix; branches share no mutable state. - Execution as ground truth — the
verifypath runs a real command and reads its exit code; it never trusts an agent's self-report. - Budgeted — branching factor is capped and each branch has a hard timeout.
Grounding
Inspired by LATS (MCTS over language-agent trajectories), Agent Q (environment reward; LLM self-critique only as a guide), best-of-N with execution verifiers (EvoScale / μ Code / SWE-bench), and ParallelEnv (tree-forking over isolated environments).
Packages
packages/core— pure, dependency-free algorithms:bestOfN,mcts, UCT,verdictFromRun,diffTrajectories,selectBest. Unit-tested in isolation (14 tests).packages/plugin— the dsh bundle that wires the core to dsh'sctx.subagents/ctx.tools. Bundled to a singledist/index.js; no@deepseek-ai/*import at runtime (out-of-tree bundles can't resolve dsh's internals).
Install
# from a local checkout (fastest today)
dsh plugin --profile web add ./packages/plugin
# restart dsh web, then in a session ask the model:
# "用 explore 工具,探索 3 种不同的方案解决 …"
The plugin is a tool, not a slash command: subagents only settle when forked from a tool's
executeinside the agent loop. A slash-command handler forking subagents never resolvesSubagentRun.resultin the current preview.
Why a tool, not a command
dsh's own subagent tool forks children from exec.agent inside the agent loop — the only context where child.whenIdle() reaches quiescence. This plugin follows the same contract.
Roadmap
- M0 — fork mechanism verified (tool path)
- M1 — core search library (
bestOfN/mcts/ UCT) - M2 —
exploretool, fork N in parallel - M3 — execution verifier (
ctx.shell→ verdict) - M4 — end-to-end winner + diff (needs workspace isolation: propose-diff → worktree → verify)
- M5 — npm publish +
dsh plugin add dsh-explore
Status
⚠️ Developer preview. dsh pins SESSION_FORMAT_VERSION = 0 with no compatibility promise; dsh-explore tracks the preview line.