mirror of
https://gitcode.com/JianFeeeee/HomeAgent.git
synced 2026-10-02 15:23:57 +00:00
fix: correct OpenClaw plugin architecture - notifications as sole registration path
- Remove SKILL tool registration with nil handler (was causing nil pointer in StageHost.ExecuteTool) - Rewrite loadOCPlugin: notifications are the only registration path. Synchronously drain all buffered register notifications after waitReady, then start persistent notifyLoop for future registrations. ListTools is verification-only, no longer registers tools. - notifyLoop: persistent via for n := range sp.NotifyChan(), lifecycle bound to sidecar process - StageHost.ExecuteTool: add nil-handler check (defense-in-depth) - Remove unused OCNamedParam, DrainNotify from sidecar.go
This commit is contained in:
@ -53,6 +53,9 @@ func (h *StageHost) ExecuteTool(name string, args map[string]interface{}) (inter
|
||||
if !ok {
|
||||
return nil, fmt.Errorf("tool %s not found in any plugin", name)
|
||||
}
|
||||
if handler == nil {
|
||||
return nil, fmt.Errorf("tool %s has nil handler", name)
|
||||
}
|
||||
return handler(args)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user