From 612dc1956fc70ca9d1e001cc77e53b0e6fd4f412 Mon Sep 17 00:00:00 2001 From: yetone Date: Wed, 11 Nov 2026 15:21:18 +0800 Subject: [PATCH] agent: BUN_INSTALL is an agent folder variable; TestGrokInstalled's fake is not an MZ file (#3548) Both were red on origin/main 2c644da04 on WSL (wsl-run, nogui). TestFolderVarsAreListed: kirocrew.go reads BUN_INSTALL for its CLI search path, but agentenv.Vars didn't list it, so no sandbox cleared it. Added. TestGrokInstalled (#3548): the fake downloaded grok began with "MZ", which WSL2's binfmt interop hands to the Windows loader (EINVAL), so the update path reported "Invalid argument". On the non-Windows branch the fake now has a body no loader claims, so exec gives ENOEXEC as on real Linux. The Windows branch keeps MZ. Run: both tests red before, green after at this change on WSL; gofmt, linux and windows go vet of internal/agent and agentenv; -run "Grok|Update|Env|Kiro" on internal/agent green. Not run: full suite, macOS. --- internal/agent/cliupdate_test.go | 2 +- internal/agentenv/agentenv.go | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/internal/agent/cliupdate_test.go b/internal/agent/cliupdate_test.go index bc55d603f..658275da2 100644 --- a/internal/agent/cliupdate_test.go +++ b/internal/agent/cliupdate_test.go @@ -538,7 +538,7 @@ func TestGrokInstalled(t *testing.T) { if version != "" { name = "grok-" + version + "-" + platform } - os.Chtimes(file(t, filepath.Join(home, ".grok/downloads", name), "MZ"), when, when) + os.Chtimes(file(t, filepath.Join(home, ".grok/downloads", name), "not a program"), when, when) bin = filepath.Join(home, ".grok/bin/grok") os.Remove(bin) link(t, "../downloads/"+name, bin) diff --git a/internal/agentenv/agentenv.go b/internal/agentenv/agentenv.go index c9cdad6d8..cda994b84 100644 --- a/internal/agentenv/agentenv.go +++ b/internal/agentenv/agentenv.go @@ -54,6 +54,8 @@ var Vars = []string{ "STEP_CODING_AGENT_DIR", "STEPCODE_CONFIG_DIR", // MothX's config folder ($MOTHX_DIR/settings.json) "MOTHX_DIR", + // Kiro Crew's CLI search path adds $BUN_INSTALL/bin + "BUN_INSTALL", // Shelley's socket ($SHELLEY_SOCKET), which magpie tells it through "SHELLEY_SOCKET", // PenguinHarness's data root and the Project its CLI works in