mirror of
https://gitcode.com/JianFeeeee/HomeAgent.git
synced 2026-11-01 06:47:29 +00:00
docs(plugin-dev): 补记「装上≠生效」——旧内核上装 timer 仍走内置工厂
loadOne 先查 factories[name],命中就不再读 plugin.bin;旧内核里内置 timer 工厂还在,所以落盘安装后 plugin_status 仍是 builtin=true / tools=[timer_set],外部版本要等内核升级重启(工厂消失)才真正接管。plgreload 在这中间是空动作。 这样「先装插件再升级内核」的顺序约束才有可执行的含义:先落盘,再换二进制重启。 (cherry picked from commit 9e72898170386526425f8abe474d0f9622242422)
This commit is contained in:
@ -848,6 +848,14 @@ Internal: records are stored in SQLite `disabled_plugins` table (`name`, `disabl
|
||||
> **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).
|
||||
>
|
||||
> ⚠ **Installed is not the same as in effect**: on the **old kernel**, installing the timer
|
||||
> plugin still goes through the built-in factory (`loadOne` checks `factories[name]` first and
|
||||
> never reaches `plugin.bin`), so the external build is not loaded at all —
|
||||
> `plugin_status("timer")` keeps reporting `builtin=true`, `tools=["timer_set"]`. The
|
||||
> hand-over only happens **after the kernel upgrade restarts** (the factory is gone, so the
|
||||
> external bin finally loads). Correct sequence: install to disk first, then swap the binary
|
||||
> and restart — the `plgreload` in between is a no-op.
|
||||
>
|
||||
> 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.
|
||||
|
||||
@ -837,6 +837,12 @@ pmgr.ReloadPlugins() // 重载所有插件
|
||||
> 工具全部不存在——而且**不会报错**,只是工具悄无声息地消失(LLM 看不到它们,
|
||||
> 于是表现为「定时提醒这个功能不见了」,日志里没有任何线索)。
|
||||
>
|
||||
> ⚠ **「装上去」不等于「生效」**:在**旧内核**上安装 timer 插件时,插件装载会优先走
|
||||
> 内置工厂(`loadOne` 先查 `factories[name]`,命中就不再去看 `plugin.bin`),外部版本
|
||||
> 根本不会被加载——`plugin_status("timer")` 依然是 `builtin=true`、`tools=["timer_set"]`。
|
||||
> 真正的接管发生在**升级内核并重启之后**(内置工厂已不存在,才会动态加载外部 bin)。
|
||||
> 所以正确姿势是「先落盘安装 → 再换二进制重启」,中间那次 `plgreload` 是空动作。
|
||||
>
|
||||
> 顺带说明外部版比原内置版更强:内置版只有 `timer_set`,进程重启即在途倒计时全丢;
|
||||
> 外部版额外提供 `timer_list` / `timer_cancel`,且待触发列表跨重启保留。
|
||||
|
||||
|
||||
Reference in New Issue
Block a user