Skip to content

Commit f1fd747

Browse files
authored
Merge pull request #1361 from entireio/fix/interactive-test-hermetic-env
test: make GitTerminalPromptOnIsNotAgent hermetic
2 parents c53483a + 1a26779 commit f1fd747

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

cmd/entire/cli/interactive/interactive_test.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,11 @@ func TestIsAgentSubprocessEnv(t *testing.T) {
6262
// GIT_TERMINAL_PROMPT only counts when explicitly set to "0". Other values
6363
// (or absence) shouldn't trigger the guard.
6464
func TestIsAgentSubprocessEnv_GitTerminalPromptOnIsNotAgent(t *testing.T) {
65+
// Clear sibling agent-detection vars so the test is hermetic regardless of
66+
// parent environment (e.g. running inside pi, gemini-cli, copilot-cli).
67+
t.Setenv("GEMINI_CLI", "")
68+
t.Setenv("COPILOT_CLI", "")
69+
t.Setenv("PI_CODING_AGENT", "")
6570
t.Setenv("GIT_TERMINAL_PROMPT", "1")
6671
if isAgentSubprocessEnv() {
6772
t.Error("isAgentSubprocessEnv() = true; want false when GIT_TERMINAL_PROMPT=1")

0 commit comments

Comments
 (0)