fix: web_search nil pointer崩溃 — 零值struct→构造函数
- WebSearchPlugin/HTTPPlugin/WebFetchPlugin/FilePlugin 全部改用构造函数创建,避免内部http.Client为nil - 根因: executeAsyncAndStore异步执行时零值struct导致panic - ai-core频繁崩溃的直接原因 Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -196,10 +196,10 @@ func main() {
|
||||
}
|
||||
|
||||
registerPlugins(toolRegistry)
|
||||
for _, t := range (&pluginFile.FilePlugin{}).Tools() { toolRegistry.Register(t) }
|
||||
for _, t := range (&pluginHTTP.HTTPPlugin{}).Tools() { toolRegistry.Register(t) }
|
||||
for _, t := range (&pluginWS.WebSearchPlugin{}).Tools() { toolRegistry.Register(t) }
|
||||
for _, t := range (&pluginWF.WebFetchPlugin{}).Tools() { toolRegistry.Register(t) }
|
||||
for _, t := range pluginFile.NewFilePlugin(dataDir).Tools() { toolRegistry.Register(t) }
|
||||
for _, t := range pluginHTTP.NewHTTPPlugin().Tools() { toolRegistry.Register(t) }
|
||||
for _, t := range pluginWS.NewWebSearchPlugin().Tools() { toolRegistry.Register(t) }
|
||||
for _, t := range pluginWF.NewWebFetchPlugin().Tools() { toolRegistry.Register(t) }
|
||||
// ai-core 专属工具 — 通过 sdk.Tool 适配器注册
|
||||
if iotClient != nil {
|
||||
toolRegistry.Register(wrapTool(tools.NewIoTQueryTool(iotClient), "iot_query", "Query IoT Devices", "iot"))
|
||||
|
||||
Reference in New Issue
Block a user