diff --git a/.gitignore b/.gitignore index d110e7f..3793ab7 100644 --- a/.gitignore +++ b/.gitignore @@ -4,6 +4,7 @@ # Binaries bin/ *.exe +cmd/supervisor/supervisor # Go vendor/ diff --git a/cmd/supervisor/supervisor b/cmd/supervisor/supervisor deleted file mode 100755 index f9c6f99..0000000 Binary files a/cmd/supervisor/supervisor and /dev/null differ diff --git a/internal/exec/executor.go b/internal/exec/executor.go index c544394..d7391f2 100644 --- a/internal/exec/executor.go +++ b/internal/exec/executor.go @@ -5,6 +5,7 @@ import ( "context" "encoding/json" "fmt" + "os" "os/exec" "strings" "time" @@ -51,11 +52,10 @@ func (e *Executor) Run(ctx context.Context, req Request) (Result, error) { tools = "Bash,Read,Write" } - // Build the full prompt: system rules + skill rules + infra context + task - litellmCtx := fmt.Sprintf( - "LITELLM_BASE_URL: %s\nLITELLM_API_KEY: %s", - e.cfg.LiteLLMBaseURL, e.cfg.LiteLLMAPIKey, - ) + // Build the full prompt: system rules + skill rules + infra context + task. + // LITELLM_API_KEY is injected as a subprocess env var, not in the prompt, + // to prevent it appearing in error log output. + litellmCtx := fmt.Sprintf("LITELLM_BASE_URL: %s", e.cfg.LiteLLMBaseURL) prompt := strings.Join([]string{ e.cfg.SystemPrompt, "---", @@ -77,6 +77,7 @@ func (e *Executor) Run(ctx context.Context, req Request) (Result, error) { } cmd := exec.CommandContext(ctx, e.cfg.ClaudeBinary, args...) + cmd.Env = append(os.Environ(), "LITELLM_API_KEY="+e.cfg.LiteLLMAPIKey) var stdout, stderr bytes.Buffer cmd.Stdout = &stdout cmd.Stderr = &stderr