Repository navigation
Releases
v0.6.4 — 修好宿主退不掉的问题
修一个会让宿主退不掉的 bug:relay 抓着的连接不肯松手。
现象
DSH 桌面端更新时报:
desktop update: Host did not complete graceful task teardown
(exit null, signal SIGTERM, shutdown acknowledged false, graceful deadline exceeded true)
主机收到关闭指令后判定超时,最后 SIGTERM 强杀。改之前实测:关一次要等 152~569 秒。
根因
不是 relay "没写清理",是清理挂错了地方。
读 cordis 4.0.5 源码(fiber.ts)确认:
// fiber.ts:114
function runDisposable(dispose: Disposable) {
const result = dispose()
return effectInertia.get(dispose)?.() ?? result // 原样返回,不设超时
}
// fiber.ts:433 —— effect disposer 是串行链
task = task.then(() => runDisposable(disposable))只要任意一个 ctx.effect 的 disposer 返回「永不 resolve 的 Promise」,整条 _unload() 就卡死;于是 ctx.on('dispose') 永不派发,relay 写在里面的 collectors.stop() / httpServer.close() / store.close() 一个都跑不到。
改法:握手模式从「资产」变「临时租借」
以前 连接是资产,要好好关,关不掉就等 → 进程被钉住
现在 连接是临时租借,随时可以扔 → 数据不会丢,下次采集是全新事务
ctx.effect的 disposer 改成同步做完全部清理,绝不 return Promise,也不 await 任何网络请求- 新增
inflightHandles登记表:relay 建的网络连接都登记,卸载时统一destroy() - 新增
openTracked(kind, factory)作为硬性约定入口 —— relay 内所有连接必须经过它,否则卸载时没人知道该 destroy 谁 httpServer.close()后补closeAllConnections(),强断 keep-alive- 每一步清理独立
try/catch,失败写errors.jsonl(不再静默)
结果
单次卸载从 6741 ms 降到 7 ms,进程能走到 beforeExit → exit code=0。
排障用的东西(默认关)
config.debug.shutdownProbe: true 会写 <root>/logs/shutdown-probe.jsonl,逐条记录 disposer 每一步和 process 级信号(beforeExit / exit / SIGTERM / disconnect)。打包出去默认不产生这份日志;同款问题再出现时改一个配置就能开。
验收
node test/zz-all.mjs → 19 个套件,793 项通过,0 项失败
v0.6.3 - 只补仓库元数据,插件行为没变
插件行为与 v0.6.2 完全一致。
SECURITY.md:漏洞上报渠道、支持哪些版本.github/dependabot.yml:npm 依赖周检package-lock.json:可复现安装
开源清单在收录前会扫这几个文件,这次补上是为了过收录检查。代码没动。
另外更正一处 README 陈述:测试实际是 799 项,其中 10 项邮件端到端需要真实凭据才能跑,之前写成「793 项全过」不准确。
安装方式不变。
v0.6.2 — 信箱地址改由环境变量提供
v0.6.2
安全修复:信箱地址不再写进源码
公开测试里曾写死两个真实信箱地址,等于把它们贴到仓库和历史里。
现在改为从环境变量读取:
| 变量 | 作用 |
|---|---|
DSH_RELAY_QQ_MAIL / DSH_RELAY_163_MAIL |
是否跑这一路(开关) |
DSH_RELAY_QQ_ADDRESS / DSH_RELAY_163_ADDRESS |
实际地址 |
本地跑线上邮件测试需要补设后两个变量。
v0.6.1 — renamed to dsh-softsensor-hub
This project is now dsh-softsensor-hub.
Earlier it went by dsh-relay, which collided with a crowded namespace. The new name says what the thing actually is: soft sensors feeding a hub that decides whether to wake you.
What it does
Collects events, decides whether to wake you, delivers through steer / followup / inject. It never acts on its own.
Four collectors, all running inside the plugin process:
| Collector | What | Default |
|---|---|---|
system |
memory, disk, event-loop delay | on |
weather |
daily weather, city or IP-based | on |
mail |
IMAP inbox | off |
finance |
reads a local quant DB, emits quote events | off |
No external daemon. A silent daemon is the classic way to lose telemetry without noticing.
Setup
First run copies config.template.json to config.json. Every null in it is a slot for you to fill, with a hint next to it. Then the config wizard takes over.
The wizard is three-state per item: null (untouched), true (done), false (you skipped it). Items that can prove themselves are settled automatically. Only a failed probe escalates to critical — a missing preference stays info.
Layout
One directory. Config, logs, queue files and code live together, so everything finds everything else without absolute paths.
dsh-softsensor-hub\
├── config.json your settings
├── logs\ one jsonl file per purpose
├── inbox\ archive\ message queue
├── peers\ peer registry
├── data\ event store, credential vault
└── lib\ test\ code and tests
Tests
node test/zz-all.mjs
19 suites, 793 checks, all pass
License: MIT
v0.6.0 — first public release
Message hub and butler framework for DeepSeek Harness.
What it does
Collects events, decides whether to wake you, delivers through steer / followup / inject. It never acts on its own.
Four collectors, all running inside the plugin process:
| Collector | What | Default |
|---|---|---|
system |
memory, disk, event-loop delay | on |
weather |
daily weather, city or IP-based | on |
mail |
IMAP inbox | off |
finance |
reads a local quant DB, emits quote events | off |
No external daemon. A silent daemon is the classic way to lose telemetry without noticing.
Setup
First run copies config.template.json to config.json. Every null in it is a slot for you to fill, with a _xxx说明 hint next to it. Then the config wizard takes over.
The wizard is three-state per item: null (untouched), true (done), false (you skipped it). Items that can prove themselves are settled automatically. Only a failed probe escalates to critical — a missing preference stays info.
See INSTALL.md for the full walkthrough, including a troubleshooting table you can hand to an agent.
Layout
One directory. Config, logs, queue files and code all live together, so everything finds everything else without absolute paths.
dsh-relay\
├── config.json your settings
├── logs\ 14 jsonl files, one purpose each
├── inbox\ archive\ message queue
├── peers\ peer registry
├── data\ event store, credential vault
└── lib\ test\ code and tests
Point root somewhere else if you prefer.
Tests
node test/zz-all.mjs
19 suites, 793 checks, all pass
License
MIT