Commit 91424d2

mo khan <mo@mokhan.ca>
2026-08-31 01:55:49
fix: treat an empty path argument as omitted in glob and grep gguf-provider
Both used `a["path"] || "."`, which only substitutes the default for nil/absent -- an empty string is truthy in Ruby, so a model passing path: "" left it as "", and `fd --glob PATTERN ''` / `rg ... ''` failed with a CLI argument error instead of searching the current directory. list.rb already handled this correctly; glob and grep now match that pattern. Found live during manual bin/run -p gguf verification. Claude-Session: https://claude.ai/code/session_01FpbgyAMtPEkDbo2kx78qR6
Changed files (2)
.elelem
.elelem/plugins/glob.rb
@@ -6,7 +6,7 @@ Elelem::Plugins.register(:glob) do |agent|
     params: { pattern: { type: "string" }, path: { type: "string" } },
     required: ["pattern"]
   ) do |a|
-    path = a["path"] || "."
+    path = a["path"].to_s.empty? ? "." : a["path"]
     result = agent.toolbox.exec("fd", "--glob", a["pattern"], path)
     result[:ok] ? result : agent.toolbox.exec("find", path, "-name", a["pattern"])
   end
.elelem/plugins/grep.rb
@@ -6,7 +6,7 @@ Elelem::Plugins.register(:grep) do |agent|
     params: { pattern: { type: "string" }, path: { type: "string" }, glob: { type: "string" } },
     required: ["pattern"]
   ) do |a|
-    path = a["path"] || "."
+    path = a["path"].to_s.empty? ? "." : a["path"]
     glob = a["glob"]
     rg_args = ["rg", "-n", a["pattern"], path]
     rg_args += ["-g", glob] if glob