While re-reviewing #764 from a Pi-launched agent session, mise run test failed in test/agent/agent.bats until I explicitly cleared Pi/mise usage_* variables inherited from the outer shimmer agent --headless invocation.
Observed inherited env included:
usage_headless=true
usage_message=...
usage_model=openai-codex/gpt-5.5
usage_session=/home/runner/.pi/agent/sessions/...
usage_timeout=900
Failure shape: tests that call the repo-local shimmer agent task unexpectedly saw the outer usage_session / usage_* state, so they attempted to resume the live Pi session instead of exercising the test arguments. Example failure:
Error: No session matching '/home/runner/.pi/agent/sessions/...jsonl'
[wake] ERROR task failed
[agent] ERROR task failed
Workaround used for review:
env -u usage_cwd -u usage_headless -u usage_message -u usage_meta \
-u usage_model -u usage_session -u usage_session_id -u usage_timeout \
mise run test
That produced 148/148 passing.
This is likely a test isolation gap: the shared BATS helpers already clear ambient GIT_CONFIG_*; they may also need to clear inherited usage_* variables so tests run reliably from inside agent sessions.
While re-reviewing #764 from a Pi-launched agent session,
mise run testfailed intest/agent/agent.batsuntil I explicitly cleared Pi/miseusage_*variables inherited from the outershimmer agent --headlessinvocation.Observed inherited env included:
Failure shape: tests that call the repo-local
shimmer agenttask unexpectedly saw the outerusage_session/usage_*state, so they attempted to resume the live Pi session instead of exercising the test arguments. Example failure:Workaround used for review:
env -u usage_cwd -u usage_headless -u usage_message -u usage_meta \ -u usage_model -u usage_session -u usage_session_id -u usage_timeout \ mise run testThat produced
148/148passing.This is likely a test isolation gap: the shared BATS helpers already clear ambient
GIT_CONFIG_*; they may also need to clear inheritedusage_*variables so tests run reliably from inside agent sessions.