mirror of
https://gitcode.com/JianFeeeee/HomeAgent.git
synced 2026-10-04 00:03:59 +00:00
webui: 修复 '删除源/服务器' 只置 <nil> 不真删的问题
前端 deleteSource/deleteMCPServer 通过 PUT value:null 删除,但后端 handleSettings PUT 只 SetCore/SetPlugin(fmt.Sprint(nil) → 字面 '<nil>'),导致 core.llm.sources.<name>.* 等键残留不可达的 <nil> 行,污染 LLM 源与探活。 - SettingsAPI 新增 RemoveCore/RemovePlugin;settingsImpl 接入 ConfigRegistry.Delete - webui handleSettings PUT:body.Value==null 时改走删除分支(核心表/插件表均适配) - 现状验证:mocktest.* 残留已从本机 config.db 清除,sources=3,无无效源
This commit is contained in:
@ -11,6 +11,10 @@ type SettingsAPI interface {
|
||||
DefsPlugin(plugin, prefix string) []*ConfigDef
|
||||
// Remove 删除本插件配置中的单个键(插件删除时清理自身配置用)。
|
||||
Remove(key string) error
|
||||
// RemoveCore 删除核心配置表中的单个键。
|
||||
RemoveCore(key string) error
|
||||
// RemovePlugin 删除另一个插件配置表中的单个键。
|
||||
RemovePlugin(plugin, key string) error
|
||||
}
|
||||
|
||||
type ConfigDef = pubsdk.ConfigDef
|
||||
|
||||
Reference in New Issue
Block a user