Repository navigation
test(cli): keep the runner's own session out of the telemetry sandbox's git - #1065
Merged
Merged
Conversation
…'s git A test that set its fixture's Claude Code session got the runner's CODEX_THREAD_ID in its commit trailer instead, since the sandbox's git environment inherited it. The sandbox now hands git no ambient session. Closes #1050 Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TnCgcujM2xi6T6dkmVogVw
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🎯 What & why
The telemetry lifecycle tests failed whenever the runner itself had
CODEX_THREAD_IDset (a test run from a Codex session): the sandbox's git environment inherited it, and the fixture hook preferred it over the fixture'sCLAUDE_CODE_SESSION_ID, so the commit trailer carried the runner's id.🛠️ How it works
The telemetry sandbox's git environment now clears both session variables, cli/tests/helpers/telemetry-sandbox.ts. A test that wants a session still sets it explicitly on top, as the lifecycle tests do. Production precedence is untouched; only the test helper changes.
🧪 How to verify
CODEX_THREAD_ID=x CLAUDE_CODE_SESSION_ID=y npx vitest run tests/contexts/telemetry tests/helpers tests/e2e/telemetry-lifecycle.e2e.test.ts(fromcli/): 1419 passed. Before the fix, the same run withCODEX_THREAD_IDset failed 1 of 30 lifecycle tests (expected '…AIDD-Session-Id: ambient-th…' to contain 'AIDD-Session-Id: 00000000-…').CODEX_THREAD_ID: ""line turns it red (expected 'runner-codex-thread' to be '').🔗 Linked issue
Closes #1050
✅ I certify
🤖 Generated with Claude Code
https://claude.ai/code/session_01TnCgcujM2xi6T6dkmVogVw