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:
root
2026-07-04 14:32:39 +08:00
parent 0348d9d279
commit 78adc6c3a2
3 changed files with 61 additions and 71 deletions

View File

@ -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)
}