From 4786866e669d3983a70bb76e63f0065914443dfd Mon Sep 17 00:00:00 2001 From: Levi Neely Date: Mon, 13 Apr 2026 09:32:56 +0200 Subject: [PATCH] fix: strip inline comments in env file parser, fix backtick syntax errors loadEnvFile now strips " # ..." suffixes from values so inline comments in ~/.config/ollie/env don't leak into environment variables. Also add kiro to the supported-backends error message and fix two raw-string backtick escaping errors in tool descriptions. --- pkg/backend/new.go | 5 ++++- pkg/tools/execute/server.go | 2 +- pkg/tools/file/read.go | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/pkg/backend/new.go b/pkg/backend/new.go index 9def13a..50740ed 100644 --- a/pkg/backend/new.go +++ b/pkg/backend/new.go @@ -28,6 +28,9 @@ func loadEnvFile(path string) { continue } k = strings.TrimSpace(k) + if i := strings.Index(v, " #"); i >= 0 { + v = v[:i] + } v = strings.TrimSpace(v) if k != "" && os.Getenv(k) == "" { os.Setenv(k, v) @@ -79,7 +82,7 @@ func New() (Backend, error) { case "kiro", "codewhisperer": return NewCodeWhisperer(os.Getenv("OLLIE_KIRO_TOKEN")) default: - return nil, fmt.Errorf("unknown OLLIE_BACKEND %q (supported: ollama, openai, openrouter, anthropic, copilot)", which) + return nil, fmt.Errorf("unknown OLLIE_BACKEND %q (supported: ollama, openai, openrouter, anthropic, copilot, kiro)", which) } } diff --git a/pkg/tools/execute/server.go b/pkg/tools/execute/server.go index 9f80839..fd4c375 100644 --- a/pkg/tools/execute/server.go +++ b/pkg/tools/execute/server.go @@ -83,7 +83,7 @@ Usage: - Default timeout: 30 seconds Tool Discovery: -- List tools: \`execute_code('ls ' + \"" + ToolsPath() + "\")\` +- List tools: execute_code with 'ls ` + ToolsPath() + `' - Check script permissions before execution Examples: diff --git a/pkg/tools/file/read.go b/pkg/tools/file/read.go index bfc72e5..178a0be 100644 --- a/pkg/tools/file/read.go +++ b/pkg/tools/file/read.go @@ -28,7 +28,7 @@ Usage: Notes: - Use offset/limit parameters for large files -- Read directories with \`execute_code('ls ')\`, not this tool +- Read directories with execute_code, not this tool - Call multiple file_read operations in parallel when exploring - Always read a file before editing or writing to it with file_edit/file_write`, InputSchema: json.RawMessage(`{