使用 AgentDebugX 诊断当前及已保存的 DeepSeek Harness 轨迹,并在其仪表盘中打开结构化报告。
安装
# npm 包(预构建)
dsh plugin --profile web add dsh-agentdebugx
# GitHub 源码(首次需按提示配置 allowBuilds 构建授权后重试)
dsh plugin --profile web add github:AgentDebugX/AgentDebugX#path:/integrations/dsh-agentdebugx
装任何插件都等于在你的机器上跑第三方代码,权限和你本人一样大——能读你的文件、用你的凭据、访问网络,工具审批管不到它。GitHub 来源的插件还会在安装时执行构建脚本——pnpm 默认拦截,所以安装可能停在 ERR_PNPM_GIT_DEP_PREPARE_NOT_ALLOWED 或 ERR_PNPM_IGNORED_BUILDS;dsh 会打印出需要添加的确切键名,把它加进该 profile 的 pnpm-workspace.yaml 的 allowBuilds 下,重跑一次即可装上。放行构建本身就是一次信任判断:请只安装可信来源,并尽量锁定 commit(github:owner/repo#sha)。
README
该插件的 README 只有英文版本。
A separately packaged DeepSeek Harness plugin kept under the AgentDebugX
repository. It connects Harness sessions to AgentDebugX without coupling
Harness-specific code into the agentdebug Python package.
The plugin:
- starts no AgentDebugX process when Harness loads the plugin;
- captures and diagnoses Harness turns only when an AgentDebugX tool or command is explicitly used;
- stores trajectories in AgentDebugX SQLite storage;
- exposes
/agentdebug status|capabilities|diagnose|open; - exposes model-facing saved-session discovery, session diagnosis, saved-trace analysis, and capability-discovery tools;
- reads Harness's own persisted sessions, including the concatenated-Zstandard
session.jsonl.zstdcontainer; - opens the AgentDebugX viewer only when explicitly requested or configured;
- records replayable
agentdebug/startandagentdebug/resultsession events; - keeps all Harness-specific code isolated under
integrations/dsh-agentdebugx.
Status and compatibility
This first integration targets DeepSeek Harness 0.1.1-rc.2 and AgentDebugX
0.3.x. Harness is in developer preview and may introduce breaking changes.
The bridge exposes AgentDebugX's deterministic heuristic pipeline and the DeepDebug profile. The external protocol deliberately leaves room for GUI RCA, discussion, and rerun operations without requiring those host-specific concerns to enter AgentDebugX core.
Install from npm
Prerequisites:
- Node.js 22.19+ or 24+;
- a Node-installed DeepSeek Harness profile;
- Python 3.9+;
- AgentDebugX with the optional dashboard dependencies.
Install the Python runtime and the DSH bundle independently:
python -m pip install "agentdebugx[ui]>=0.3.1,<0.4"
dsh plugin --profile web add dsh-agentdebugx
dsh --profile web --dump-config
dsh web
The npm package intentionally does not install Python or execute install scripts. This keeps installation auditable and lets users choose the Python environment that owns AgentDebugX.
Install from a local checkout
Prerequisites:
- Node.js 22.19+ or 24+;
- a Node-installed DeepSeek Harness profile;
- Python 3.9+;
- AgentDebugX with the optional dashboard dependencies.
cd C:\path\to\AgentDebugX
python -m pip install -e ".[ui]"
dsh plugin --profile web add C:\path\to\AgentDebugX\integrations\dsh-agentdebugx
dsh --profile web --dump-config
dsh web
When running Harness from its source checkout, prefix the DSH commands with
pnpm:
pnpm dsh plugin --profile web add C:\path\to\AgentDebugX\integrations\dsh-agentdebugx
pnpm dsh --profile web --dump-config
pnpm dsh web
The plugin does not use deepseek-harness-sdk's bundled Python runtime. The
Node Harness host starts the packaged bridge script with the configured local
Python interpreter, which also works on Windows.
Updating with AgentDebugX
For local development, both sides are linked rather than copied:
pip install -e ".[ui]"points Python at the current AgentDebugXsrc/;dsh plugin ... add <directory>links the DSH profile to this plugin folder.
After pulling or editing AgentDebugX, restart dsh web; Python imports the
updated AgentDebugX source when the bridge process starts. Re-run the editable
install only when pyproject.toml, dependencies, or package metadata changed.
After editing the JavaScript bridge/plugin, restart DSH as well. No repack or
reinstall is needed for this linked development setup.
Published npm/tarball installations are copies instead of links. For those,
bump the plugin version, run pnpm pack or publish to npm, update the DSH
profile dependency, and restart DSH.
Maintaining the system prompt
SYSTEM_PROMPT.md is the shipped source of truth for the model-facing
AgentDebugX instructions. index.js resolves it relative to import.meta.url
and strictly renders its capture, open, and sessions-root policy placeholders
from plugin configuration when registering the prompt. Semantic edits must
preserve the persisted-session contract: list candidates first, present them
to the user, and confirm the selected saved session before diagnosis.
Use
AgentDebugX is loaded as a Cordis plugin, not a Harness skill. After at least one Harness turn has completed:
/agentdebug status
/agentdebug capabilities
/agentdebug diagnose
/agentdebug open
The model-facing tools are:
agentdebug_list_sessions: list or search persisted DSH sessions beneath the configured sessions root without starting Python or the dashboard;agentdebug_diagnose: diagnose this DSH session through its latest completed turn boundary;agentdebug_analyze_trace: normalize and diagnose an existing trajectory file or OSWorld trajectory directory inside a configured trace root;agentdebug_capabilities: return the installed integration contract, formats, diagnosis mode, and current limitations.
An ambiguous reference to a past or external DSH conversation must start with
agentdebug_list_sessions, followed by presenting the candidates and asking
the user to choose. agentdebug_diagnose is reserved for requests that clearly
identify the current, latest, or just-now conversation. Once a saved candidate
is confirmed, its path can be passed directly to
agentdebug_analyze_trace.
Both diagnosis tools take a mode:
heuristic(default) runs AgentDebugX's deterministic Detect-Attribute-Recover pipeline and makes no model calls;deepruns the DeepDebug profile, seeded with the heuristic findings.
Deep mode needs no extra API key: AgentDebugX's LLMClient protocol is
satisfied by an adapter that calls back into the Harness host over the same
pipe, so diagnosis runs on the model the session already uses. Set
llmProvider and llmModel together to pin a different model, which is also
how you get a second opinion from a model that did not produce the trace.
If a deep run fails, the bridge returns the deterministic report with a
deepError explaining why, rather than discarding the result. Automatic
per-turn capture never calls a model.
LLM judge, OSWorld GUI root-cause analysis, standalone LLM attribution, rerun,
batch processing, and Error Hub sharing stay on the agentdebug CLI against
the same store;
agentdebug_capabilities reports them so the model recommends the real command
instead of assuming the product lacks the feature. That tool reads the
installed package's own registries (version, ingest formats, and every
detect/attribute/recover component with its default and LLM requirement), so
the answer cannot drift from the AgentDebugX build in use.
On-demand runtime and visualization
By default the plugin is dormant: loading DSH registers its tools and commands
but starts neither the Python bridge nor the AgentDebugX dashboard. The first
status or capabilities request starts only the bridge. A diagnosis or
/agentdebug open also starts the local dashboard, waits for /healthz, and
reuses it for the rest of the DSH process:
http://127.0.0.1:7777/trace/<trace_id>/event/<event_id>
The plugin-owned dashboard stops when DSH exits. If dashboardUrl already has
a healthy AgentDebugX server, the plugin reuses it and does not stop that
external process.
autoCapture is disabled by default. When explicitly enabled, every completed
turn is captured and therefore may start the bridge. autoOpen accepts turn,
session, and off (default); enabling it together with autoCapture starts
the dashboard and opens the matching trace page. Explicit diagnosis keeps the
dashboard available but does not pop a browser when autoOpen is off;
/agentdebug open always opens it.
Heuristic detection reasons over events, so a benchmark trace scored as a
failure can still return zero findings. When the source trace carries an
outcome, the tool result repeats it under recordedOutcome, so "no findings"
is never mistaken for "the task succeeded". Use the CLI (agentdebug diagnose --mode gui-rca|judge|deep) for the model-backed root-cause modes.
You can still start the dashboard separately; the plugin will detect and reuse it:
agentdebug serve --store-sqlite .agentdebug\agentdebug.sqlite
Then open http://127.0.0.1:7777.
Configuration
The default bundle row is:
- insert:
- id: agentdebugx
name: dsh-agentdebugx
config:
python: python
store: .agentdebug/agentdebug.sqlite
dashboardUrl: http://127.0.0.1:7777
traceRoots:
- .
timeoutMs: 120000
autoCapture: false
autoOpen: off
Environment shortcuts:
AGENTDEBUGX_PYTHONAGENTDEBUGX_STOREAGENTDEBUGX_DASHBOARD_URLAGENTDEBUGX_TRACE_ROOTS(semicolon-separated on Windows, colon-separated elsewhere)AGENTDEBUGX_AUTO_CAPTURE(trueenables per-turn capture)AGENTDEBUGX_AUTO_OPEN(turn,session, oroff)
deepTimeoutMs (default 900000) bounds a deep run, which issues several model
calls and therefore takes much longer than timeoutMs allows for the
heuristic path.
Harness patch layers replace a row's complete config; when overriding this
row, repeat every setting you need.
Data and security
The plugin runs in the trusted Harness host process and launches a local Python
process. Session snapshots may contain prompts, model responses, tool
arguments, command output, paths, and system prompt material. Storage remains
local by default. The dashboard binds to 127.0.0.1; do not expose it remotely
without a separate authentication and TLS boundary.
agentdebug_analyze_trace can read only paths under traceRoots. Keep this
allowlist narrow; add an OSWorld results directory explicitly when the model
needs to analyze traces outside the DSH working directory.
$DSH_HOME/sessions is appended to the readable roots automatically so the
model can debug Harness's own past sessions. Point dshSessionsRoot at a
different directory to override it, or set it to an empty string to keep
Harness's session history out of reach.
agentdebug_list_sessions searches only that configured sessions root. It does
not accept a caller-supplied root, follow symlinked files or directories, or
make a model call. Persisted prompts and filesystem paths are sensitive local
data; the tool returns only bounded identification metadata and limits results
to at most 25 candidates.
Debugging saved traces
agentdebug_analyze_trace accepts two sources beyond the live session:
- a past Harness session, stored as
$DSH_HOME/sessions/<workspace>/session-<uuid>/session.jsonl.zstd(on Windows$DSH_HOMEdefaults to adsh-*folder under%TEMP%). Pass either the session directory or the log file; - trace and trajectory files in the open workspace, including OSWorld trajectory directories.
When the exact saved session is unknown, call agentdebug_list_sessions with
optional remembered text. Candidates show the session id, analyzable absolute
path, cwd/workspace, bounded first user prompt, and log modification time:
- search with any remembered id, path, workspace, cwd, or prompt text;
- present the returned candidates and ask the user to choose one;
- pass the chosen candidate's
pathtoagentdebug_analyze_trace.
Matching is deterministic and local: query text is normalized case-insensitively into whitespace-separated tokens, then ranked by token coverage, full-query presence, matched fields, recency, and finally lexical path. With no query, newest sessions come first. Missing, unreadable, partially written, or corrupt logs are skipped and reported through bounded aggregate counts and warnings rather than failing the entire listing.
Persisted session logs are a concatenated-Zstandard container that Node decodes frame by frame, and they are mapped through the same code path as the live session feed, so turn, step, and tool-call linkage is preserved rather than flattened by generic format detection.
assistant/chunk deltas are not duplicated into AgentDebugX. The assembled
assistant message is retained, while the number of skipped chunks is recorded
as trajectory metadata.
Distribution and discovery
DeepSeek Harness currently does not accept external pull requests. Community plugins are distributed independently:
- publish this package to npm, ship a tarball, or install from GitHub;
- add the GitHub repository topic
dsh-plugin; - npm- and topic-backed community marketplaces discover it automatically;
- curated marketplaces backed by
awesome-dsh-pluginrequire a separate registry pull request.
Publishing prebuilt/plain JavaScript avoids pnpm's Git prepare/allowBuilds
permission flow. This package intentionally has no install script.
This package lives in the repository's integrations/ directory. Registry
automation that only scans packages/, plugins/, or apps/ may not detect
the monorepo subpackage; npm and GitHub-topic discovery remain unaffected.
Official references:
Development
pnpm install
$env:PYTHONPATH = "C:\path\to\AgentDebugX\src"
pnpm test
pnpm test:bridge
pnpm pack
The tests treat AgentDebugX as a read-only dependency. Compatibility changes belong in this adapter unless a generally reusable AgentDebugX public API is independently justified.
链接
同类插件
yjh051108/dsh-routing-suite★ 7014
一个仓库三件套:DSH 插件包的运行时注入器(注入、热重载、卸载、开发侧挂区一键转正、路由自愈,外带设置页插件管理:列出、卸载、拖入文件夹内化)、任务感知的思维模式路由 agent 预设(router-standard / router-spec / router-react)、以及分级两级任务协议(commit_star / lock_stage / revise_do / edit_plan / mark_task / redteam_verdict 六个工具,任务状态落盘)。注入器实现直接在库内,安装的是它自己的行为而不是一份依赖清单。
strukto-ai/mirage#dsh★ 3682
把文件系统与 bash 提供者换成 mirage 虚拟工作区:文件工具与 shell 命令作用于挂载的资源(RAM、S3、Redis、Slack、Gmail、Notion、Postgres)而非宿主磁盘,支持按挂载点设置读/写/执行模式、按命令选择沙箱(进程内 monty、pyodide、quickjs;远程 docker、e2b、daytona),并可在虚拟终端中安装 CLI(git、gh、slack、linear、ntn、gws,或自行注册的程序树)作为命令头词。
hust-open-atom-club/oh-dsh★ 322
社区发行版:TUI、桌面端与 Web UI 统一体验,分层安装、一步到位。
weijiafu14/pi2dsh★ 212
Pi Host ABI 兼容引擎:装一次之后,npm 上的 Pi 扩展原包经 `dsh plugin add <pi-package>` 直接作为 DSH 原生插件挂载。已在官方 DSH 上端到端验证 pi-mcp-adapter(完整 MCP 管理面:OAuth、resources、prompts、MCP Apps、elicitation、sampling)、@tintinweb/pi-subagents、pi-code、pi-hermes-memory、pi-background-tasks;`pi2dsh inspect` 在安装前报告一个包的兼容情况。
Fishquito7/dsh-skill-mcp-panel★ 193
在 DSH Web 设置中管理技能与 MCP 服务器:技能卡片热启停、工作区作用域、分组、批量迁移与拖拽导入,以及 stdio/HTTP MCP 增删改查、连接测试、密钥脱敏,并附带统一 dsh-panel 命令行。
lire1131/dsh-undo-savepoint★ 179
DSH 撤销/回退系统:配置变更自动存档,一键撤销/恢复/回退到任意版本,支持 WebUI 与离线 CLI/GUI 工具(DSH 启动失败也能救)。
社区评论
评论公开保存在 GitHub Discussions。加载评论会连接 GitHub 和 Giscus;发表内容需要 GitHub 账号。