From 9fe837870f53a797f1b410cc6aee216e32de04f4 Mon Sep 17 00:00:00 2001 From: jasonQin6 Date: Sat, 21 Nov 2026 19:47:00 +0800 Subject: [PATCH] fix(runner): initialize the env map when a staged login returns none The generic tail of prepareRunnerLogin returns a nil env map. The three providers currently in runnerLoginSpec never hit that tail (the codex and claude-code OAuth branches and the Antigravity branch each build their own maps), so PrepareRunnerAgentCLILogin has always assigned env["HOME"] on a non-nil map. Adding a login spec whose staged login flows through the generic path panics the runner daemon (assignment to entry in nil map), which surfaces as an expired lease on the platform. Guard with an empty map so env["HOME"] and env["TMPDIR"] land safely. --- internal/runtime/conversation_runner_login.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/internal/runtime/conversation_runner_login.go b/internal/runtime/conversation_runner_login.go index f28b44cf..a05bdab2 100644 --- a/internal/runtime/conversation_runner_login.go +++ b/internal/runtime/conversation_runner_login.go @@ -86,6 +86,12 @@ func PrepareRunnerAgentCLILogin(sandbox Sandbox, command CommandSpec) (map[strin } return nil, nil, err } + // The generic tail of prepareRunnerLogin returns a nil env map; the + // OAuth and Antigravity branches build their own. Any future login spec + // that takes the generic path panics here without the guard. + if env == nil { + env = map[string]string{} + } _, homeEnv := privateHomePaths(sandbox, sandbox.Workspace(), command) env["HOME"] = homeEnv tmp, err := EnsureControlDirectory(sandbox.Workspace(), "tmp", PrivateHomeName(command))