From 5a84e8b3261a5f2008da14ef4296fe38df0a5576 Mon Sep 17 00:00:00 2001 From: Ollie Agent Date: Thu, 30 Jul 2026 22:50:49 +0200 Subject: [PATCH] toolsrv: fix Registry.discover() to use .meta files MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The Registry had its own discover() method that still required 'ollie:prompt' in file content — the old header-based check that was removed from DiscoverTools(). This caused tool_load to fail for ALL tools (not just Go binaries) since .meta is now the sole metadata source. Fix: delegate to DiscoverTools() which correctly scans .meta files. --- toolsrv/registry.go | 25 ++++--------------------- 1 file changed, 4 insertions(+), 21 deletions(-) diff --git a/toolsrv/registry.go b/toolsrv/registry.go index a6d4565..3409ef9 100644 --- a/toolsrv/registry.go +++ b/toolsrv/registry.go @@ -3,9 +3,7 @@ package toolsrv import ( "fmt" "os" - "path/filepath" "sort" - "strings" "sync" ) @@ -30,25 +28,10 @@ func NewRegistry() (*Registry, error) { // discover scans the tools directory and returns all valid tool infos. func (r *Registry) discover() map[string]ToolInfo { - dir := ToolsPath() - entries, err := os.ReadDir(dir) - if err != nil { - return nil - } - tools := make(map[string]ToolInfo) - for _, e := range entries { - if e.IsDir() || e.Name() == "idx" || e.Name()[0] == '.' { - continue - } - data, err := os.ReadFile(filepath.Join(dir, e.Name())) - if err != nil { - continue - } - script := string(data) - if !strings.Contains(script, "ollie:prompt") { - continue - } - tools[e.Name()] = ParseToolInfo(e.Name(), script) + infos := DiscoverTools() + tools := make(map[string]ToolInfo, len(infos)) + for _, info := range infos { + tools[info.Name] = info } return tools }