heswy/dsh-plugin-codex-bridge ↗★ 6
dsh-plugin-codex-bridge
同步外部进程工作区并提供免重启的消息投递箱。 适合需要将外部工具(如 Codex)与当前运行的桌面会话进行集成的用户。
同名套件的其他儲存庫
安裝
npx -p @deepseek-ai/dsh dsh plugin --profile web add github:heswy/dsh-plugin-codex-bridge說明文件
閱讀完整 README ↗使用示例
向原 DSH 会话投递审查意见
先使用 --list 获取完整会话 ID,替换下例中的 ``:
node tools/send.mjs \
--session '' \
--text '请在原任务分支修复 PR 审查意见,并补充相关验证。' \
--mode queue \
--from codex \
--id review-followup-001
默认 queue 等当前轮次结束;steer 默认被拒绝。读取回执时,ok: true 且 accepted: true 才确认会话接受,接受不代表任务完成。若 queuedBehindRunningTurn: true,消息正在等待当前轮次结束。
发送端退出码:0 表示投递调用成功,1 表示被拒或失败,2 表示用法错误或回执超时。请结合回执中的 accepted 判断接受状态。超时后检查原请求与回执,避免盲目重发或更换请求 ID。
将开发结果交回 Codex
准备验证摘要和明确的主管对话 UUID,先预演核对通知内容:
python3 skills/dsh2codex/scripts/notify.py \
--thread '' \
--repo '/absolute/path/to/task-worktree' \
--branch 'task-branch' \
--pr-url 'https://github.com/owner/repo/pull/123' \
--summary-file '/absolute/path/to/verification-summary.md' \
--dry-run
确认后移除 --dry-run 发送。脚本检查当前分支、工作区是否干净、origin 推送仓库与 PR URL 是否匹配,以及完整 HEAD 是否已在远端任务分支;PR 实际 head 与审查结论由主管独立核对。
通知状态为 queued、already-queued、blocked 或 unknown。确定性事件 ID 与本地账本阻止自动重复发送;结果不确定时停止并保留记录。这是保守的去重机制,不保证任意故障条件下的端到端“恰好一次”交付。
配置
在 profile 自己的 cordis.patch.yml 中覆盖设置,它在 bundle 配置之后生效:
- id: workspace-sync
config:
intervalMs: 15000
inbox:
allowSteer: false
默认工作区同步周期为 5 秒,投递箱取件周期为 1 秒。DSH_HOME 未设置时使用 ~/.dsh。
完整配置参考
| 字段 | 默认值 | 说明 |
|---|---|---|
routePath | /api/workspace-sync | 宿主 API 路由,必须以 /api/ 开头;客户端按钮使用默认路由。 |
registryFile | /storages/workspace.json | 共享工作区注册文件。 |
stateFile | /workspace-sync/state.json | 持久化删除记忆。 |
autoSync | true | 定时同步工作区。 |
intervalMs | 5000 | 同步周期,1000–600000 毫秒。 |
includeUngroupedSessions | false | 从会话目录推断工作区;默认关闭,避免恢复已删除的工作区。 |
attachSessions | true | 把 cwd 落在某工作区里的会话记到该工作区名下(含已有成员的,幂等;注册表自己会复核 cwd) |
clientRefresh | true | 点击刷新后是否重载视图(会话目录按连接拉取,外部新会话不会推送)。true 每次都重载、'on-change' 只在对账确有变化时、false 关闭 |
excludeDshHome | true | 排除 DSH 数据目录内的候选工作区。 |
maxAddsPerPass | 20 | 每轮新增上限,1–200。 |
verbose | false | 每轮记录日志。 |
inbox.enabled | true | 启用投递箱。 |
inbox.dir | /inbox | 请求、回执与会话索引目录。 |
inbox.intervalMs | 1000 | 取件周期,200–600000 毫秒。 |
inbox.allowSteer | false | 允许向当前轮次插话;需显式开启。 |
inbox.maxTextBytes | 200000 | 正文 UTF-8 字节上限,1–10000000。 |
inbox.indexIntervalMs | 10000 | 会话索引更新周期,1000–600000 毫秒。 |
inbox.deliveryTimeoutMs | 30000 | 单次投递超时,1000–600000 毫秒。 |
宿主 API 与开发模式挂载
| 请求 | 用途 |
|---|---|
GET /api/workspace-sync | 配置、最近一次同步结果与能力自检状态。 |
POST /api/workspace-sync?action=sync | 立即同步。 |
GET /api/workspace-sync?action=doctor | 运行能力自检。 |
开发模式可在 profile 的 cordis.patch.yml 中手工挂载:
- insert:
- id: workspace-sync
name: '/absolute/path/to/dsh-plugin-codex-bridge/lib/index.js'
手工挂载与插件管理器安装应二选一,避免重复加载。