Zum Hauptinhalt springen
H

dsh-thread-tools

heroicus/dsh-thread-tools

Ten thread tools for DeepSeek Harness matching the set Codex exposes: list_threads, list_archived_threads, read_thread, wait_threads, send_message_to_thread, create_thread, fork_thread, set_thread_title, set_thread_archived and delete_thread. A message is delivered through the same Host path a human client uses, so a cold session is resumed and an idle one starts a turn; wait_threads waits on up to eight sessions at once, and turns are read back with harness-injected reminder blocks stripped.

Installation

dsh plugin --profile web add github:heroicus/dsh-thread-tools

README

dsh-thread-tools

把 Codex 桌面端的 thread 协同工具集 1:1 搬到 DeepSeek Harness。一个 DSH 会话对应一个 thread。

工具(与 Codex 同名同参)

工具作用
list_threads列出线程:mode: recent 返回置顶 + 按活跃排序;mode: history 返回一页(cursor/limit)
list_archived_threads列出已归档线程的一页
read_thread读某个线程的轮次摘要,支持 turnLimit、includeOutputs、maxOutputCharsPerItem、cursor 翻页
wait_threads最多等 8 个线程,谁先完成/需要输入就返回;timeoutMs 上限 120000,0 表示立即快照
send_message_to_thread投递消息,包在 <codex_delegation><source_thread_id>…</source_thread_id><input>…</input></codex_delegation> 信封里
create_thread新建线程,可带首条 prompt 异步派发
fork_thread复制线程(含历史)成独立新线程
set_thread_title改名
set_thread_archived归档 / 取消归档;已归档的线程拒绝投递
delete_thread永久删除线程与其持久化日志

hostId、source 为签名兼容参数,本安装只有一台 host。

安装

本地目录安装:插件 → 添加插件 → 选这个目录。或在会话里用 plugin_manager 的 install_bundle 指向本目录。

无依赖、无构建步骤,index.js 就是全部实现。

实现要点

  • 投递走宿主的人类客户端同一条路径 sessionController.prompt:冷会话自动恢复,忙碌会话排队,日志与标题语义与用户手打一致。
  • wait_threads 用 sessionController.wait,并对「消息还在入队、会话却已 idle」的情况继续等待,避免抢答。
  • read_thread 用 sessionQuery.readSurface 折叠事件流,剥掉 <system-reminder> 与时间注入块,只留真人 prompt 与模型回复。
  • 只读操作不会调用 sessionController.state(),避免把冷会话意外唤醒。
  • 归档 / 置顶状态存在 $DSH_PROFILE_DIR/session-bus/state.json(原子写)。
  • DSH 没有公开的「移除已加载会话」API,所以 delete_thread 会先取消运行中的轮次,再删磁盘日志;内存里的副本到下次重启消失,返回值里 clearedFromMemory: false 说明这点。

已验证(2026-11-18,DSH desktop profile)

10 个工具逐个实跑通过,包括:冷线程摘要读取、跨线程投递后目标回复 BUS-REPLY-OK 被 wait_threads 取回、归档后投递被拒、fork 后改名、删除后日志目录消失。

与 Codex 的差异

  • 没有 handoff_thread(跨 host / worktree 迁移)、share_thread、list_projects、get_usage_limits 等依赖 Codex 账号体系或 host 网络的工具。
  • 没有 set_thread_pinned / set_thread_read_state:DSH 侧边栏不消费这两个状态。

License

MIT

Ähnliche Plugins