Investigate Test Failures After Main Merge

After merging main, tests started failing in https://github.com/entireio/cli/pull/1347 check what's up.
Root cause identified.
The failing test TestIsAgentSubprocessEnv_GitTerminalPromptOnIsNotAgent in cmd/entire/cli/interactive/interactive_test.go:67 fails because:
But isAgentSubprocessEnv() returns true because your environment has PI_CODING_AGENT=true set (from running inside the pi coding agent):
The function checks:
t.Setenv("GIT_TERMINAL_PROMPT", "1") only overrides that one variable; inherited PI_CODING_AGENT=true still triggers the condition.
This is a pre-existing test bug on main (not caused by merging the PR). The test assumes a clean environment but doesn't defensively clear the other agent-detection variables.
Fix: Update the test to explicitly override the other vars to empty:
Or use os.Unsetenv via a helper if preferred. Would you like me to apply the fix?
Zero connection.
- The test failure exists on
mainindependently of the PR (confirmed by runningmise run testonmain— same failure). cmd/entire/cli/interactive/interactive.goand its test were not modified by either the PR branch or the merge ofmaininto it.- The PR (
fix/checkpoint-step-count-prompts) only touches checkpoint/attach/strategy code; the auth changes pulled in frommainare unrelated to theinteractivepackage. - The root cause is purely environmental:
PI_CODING_AGENT=true(set by thepiagent harness) leaks intogo test, and the test doesn't defensively clear the sibling agent-detection vars.
The PR merge is a red herring — the test is fragile and fails whenever any of GEMINI_CLI, COPILOT_CLI, or PI_CODING_AGENT is present in the parent environment.
Done. Created branch fix/interactive-test-hermetic-env with the hermetic test fix:
The change makes the test independent of inherited PI_CODING_AGENT/GEMINI_CLI/COPILOT_CLI values. You can commit/push and open the PR from this branch.
PR created: https://github.com/entireio/cli/pull/1361
Verification summary
- The fix is correct: the test now defensively clears
GEMINI_CLI,COPILOT_CLI, andPI_CODING_AGENTbefore asserting thatGIT_TERMINAL_PROMPT=1alone does not triggerisAgentSubprocessEnv(). t.Setenvensures cleanup after the test; setting to""overrides any inherited non-empty values from the parent process.- The change is isolated to the test file, has no impact on production logic, and resolves the environmental flakiness observed when running inside
pi(or the other agent CLIs).