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.
This commit is contained in:
Levi Neely 2026-04-13 09:32:56 +02:00
parent f9918525d5
commit 4786866e66
3 changed files with 6 additions and 3 deletions

View File

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

View File

@ -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:

View File

@ -28,7 +28,7 @@ Usage:
Notes:
- Use offset/limit parameters for large files
- Read directories with \`execute_code('ls <path>')\`, 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(`{