Skip to content

feat(dsh): add experimental DeepSeek Harness backend - #13

Draft
wetlink wants to merge 9 commits into
modelzen:mainfrom
wetlink:codex/add-dsh-backend
Draft

feat(dsh): add experimental DeepSeek Harness backend#13
wetlink wants to merge 9 commits into
modelzen:mainfrom
wetlink:codex/add-dsh-backend

Conversation

@wetlink

@wetlink wetlink commented Aug 30, 2026

Copy link
Copy Markdown

Summary

新增第三种可选后端 dsh-sdk,通过 DeepSeek Harness 官方 JSON-RPC stdio runtime 将多 provider coding agent 接入飞书群聊。DSH 在 Web「后端 Agent」页按需安装、在项目创建时显式选择,不会替换或改变 Codex / Claude,也不会成为默认后端

User-visible behavior

  • full 项目中可选择 DeepSeek Harness,静态提供已核验的 Kimi、GLM、MiniMax 与 DeepSeek 模型路由。
  • 文本、推理、工具调用、工具结果和 token usage 继续复用现有飞书流式运行卡。
  • 同一飞书话题复用一个 warm DSH 进程;Bridge 重启、中止或模型 / effort 切换后,仍以原 sessionId 从 DSH JSONL 历史恢复。
  • 后端管理支持一次安装、检测、修复和卸载完整 DSH 包集合;失败会原子回滚,不留下半安装状态。

Architecture

  • 精确锁定 19 个直接使用的 @deepseek-ai/* 包到 0.1.1-rc.2,不跟随浮动 prerelease tag。
  • 使用官方最小协议面:initializesession/promptsession.eventsession.statusshutdown
  • 每个 live Bridge thread 对应一个 detached dsh-jsonrpc-agent 进程;JSON-RPC transport 负责请求关联、早到通知缓冲、stderr 限长脱敏和进程组回收。
  • Bridge 只持久化稳定 sessionId,不读取或改写 DSH 自己的 JSONL 历史。
  • 通用安装器新增 installSpecs,保持原单包后端行为兼容,同时支持 DSH 多包原子安装。

Safety boundary

  • DSH 仍是 developer preview,本 PR 仅开放为实验性、显式选择的后端。
  • 首版只支持 full / danger-full-accessqawrite 在启动前 fail closed,绝不静默提权。
  • 生成 profile 固定 native tools、approval: never、telemetry off,并禁用 Code/PTC、skills、workspace pre-scan、background jobs 与 goals。
  • 不启动 DSH Web 服务,不开放本地 HTTP 入口;真实 profile smoke 已检查运行进程没有 TCP listener。
  • 图片在 session/prompt 前明确拒绝,不会静默丢弃;首版不声明 goal、steer、compact、审批转发或历史选择器能力。
  • provider 凭据由 DSH credentials provider 从继承环境或 $DSH_HOME/.credentials.yaml 解析。Bridge 不读取、复制、打印或持久化 key 值。
  • 因为这是全权限本机 agent,只应部署给完全信任的小团队。

Verification

  • npm test: 97 passed, 1 skipped test files; 1078 passed, 8 skipped tests.
  • npm run typecheck: passed.
  • npm run build: passed.
  • DSH focused harness covers package rollback, protocol framing, early notifications, malformed output, RPC rejection, foreign-session filtering, event reconciliation, concurrent-run rejection, process restart, abort and resume.
  • node scripts/check-dsh-profile.mjs /tmp/dsh-bridge-probe-rc2:
    • 19/19 packages read back at 0.1.1-rc.2
    • real dsh-jsonrpc-agent returned deepseek-harness-sdk-runtime@0.0.1
    • no TCP listeners
    • clean shutdown
  • The smoke uses an empty temporary HOME / DSH_HOME, performs no session/prompt, and uses no real provider key.

Out of scope / follow-up

  • A real provider prompt is intentionally left for the maintainer's isolated test bot and explicit key authorization.
  • DSH protocol, model catalog and sandbox assumptions must be revalidated in a separate PR before any version upgrade.
  • Subscription/OAuth plugins, image input and additional Bridge capabilities remain separate follow-up work.

Design and operating details are documented in docs/design/dsh-backend-design.md and docs/design/dsh-backend-research.md.

…te deployment

- Add dsh-backend-research.md: pi-ai catalog routes for MiniMax/Kimi/GLM
  (zero-code, API keys via $DSH_HOME/.credentials.yaml), subscriptions
  plugin headless assessment, remote-machine deployment checklist,
  version re-verification (0.1.1-rc.2 package closure complete), and a
  four-phase implementation plan.
- Revise dsh-backend-design.md: LLM layer switches from dsh-llm-deepseek
  to dsh-llm-pi-ai multi-provider; per-model supportedEfforts replaces
  the uniform effort mapping; version pin to be re-validated against
  0.1.1-rc.2 before implementation.
- Add docs/DEVLOG.md capturing both decisions.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant