docs(plugin-dev): 注明 timer 已外置,并写明「先装插件再升级内核」的顺序约束

timer 移出内置插件后,升级路径上有个静默故障点:若先升级内核、后装 timer 插件,
就会有一段窗口期三个 timer 工具全部不存在 —— 不报错、日志无线索,只是 LLM
视野里工具没了,表现为「定时提醒功能不见了」,极难归因。

在 zh/en 两份 PLUGIN_DEV.md 的「内置插件」表下补注记(原 Timer 示例行就删在这里,
正是读者会产生疑问的位置):
  - timer 已改为外部 hmap 插件提供,三个工具与 timer 输入通道均由它注册
  - 升级顺序:先装 timer 插件,再升级内核
  - 外部版是严格超集:原内置版只有 timer_set 且重启丢在途倒计时,
    外部版增加 timer_list / timer_cancel 并跨重启保留待触发列表

assets/docs 是纯文档,无 go:embed、无代码引用,改动不影响构建。

(cherry picked from commit 62332562a80165b6e86af77315c07d18e743e7fa)
This commit is contained in:
JianFeeeee
2026-10-19 15:26:50 +08:00
committed by JianFeeeee
parent 99914a9e9b
commit 47272adffe
2 changed files with 23 additions and 0 deletions

View File

@ -839,6 +839,19 @@ Internal: records are stored in SQLite `disabled_plugins` table (`name`, `disabl
| CLI | `internal/plugins/cli/` | Unix socket listener + synchronous request-response |
| WebUI | `internal/plugins/webui/` | HTTP service + dependency injection |
> **timer has been moved out of the built-in plugins** and is now provided as an external
> hmap plugin (all three tools `timer_set` / `timer_list` / `timer_cancel` and the `timer`
> input channel are registered by the external plugin).
>
> ★ **Upgrade order**: install the timer plugin *before* upgrading the kernel. Doing it the
> other way round leaves a window where none of the three timer tools exist — and it
> **fails silently**: no error, the tools simply vanish (the LLM cannot see them, which
> surfaces as "reminders are gone" with nothing in the logs to explain it).
>
> The external version is also a strict superset: the built-in one only had `timer_set`, and
> in-flight countdowns were lost on restart; the external one adds `timer_list` / `timer_cancel`
> and persists pending timers across restarts.
---
*Want to understand the project goals? See [OVERVIEW.md](OVERVIEW.md).*

View File

@ -830,6 +830,16 @@ pmgr.ReloadPlugins() // 重载所有插件
| CLI | `internal/plugins/cli/` | Unix socket 监听 + 同步请求响应 |
| WebUI | `internal/plugins/webui/` | HTTP 服务 + 依赖注入 |
> **timer 已移出内置插件**,改为外部 hmap 插件提供(`timer_set` / `timer_list` /
> `timer_cancel` 三个工具与 `timer` 输入通道均由外部插件注册)。
>
> ★ **升级顺序**:先安装 timer 插件,再升级内核。反过来会有一段窗口期三个 timer
> 工具全部不存在——而且**不会报错**,只是工具悄无声息地消失(LLM 看不到它们,
> 于是表现为「定时提醒这个功能不见了」,日志里没有任何线索)。
>
> 顺带说明外部版比原内置版更强:内置版只有 `timer_set`,进程重启即在途倒计时全丢;
> 外部版额外提供 `timer_list` / `timer_cancel`,且待触发列表跨重启保留。
---
*了解项目整体目标?查看 [OVERVIEW.md](OVERVIEW.md)。*