Skip to content

test(cli): keep the runner's own session out of the telemetry sandbox's git - #1065

Merged
blafourcade merged 1 commit into
nextfrom
test/telemetry-lifecycle-ambient-session
Oct 20, 2026
Merged

blafourcade merged 1 commit into
nextfrom
test/telemetry-lifecycle-ambient-session

Conversation

@blafourcade

Copy link
Copy Markdown
Contributor

🎯 What & why

The telemetry lifecycle tests failed whenever the runner itself had CODEX_THREAD_ID set (a test run from a Codex session): the sandbox's git environment inherited it, and the fixture hook preferred it over the fixture's CLAUDE_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 (from cli/): 1419 passed. Before the fix, the same run with CODEX_THREAD_ID set failed 1 of 30 lifecycle tests (expected '…AIDD-Session-Id: ambient-th…' to contain 'AIDD-Session-Id: 00000000-…').
  • New guard cli/tests/helpers/telemetry-sandbox.integration.test.ts: removing the CODEX_THREAD_ID: "" line turns it red (expected 'runner-codex-thread' to be '').

🔗 Linked issue

Closes #1050

✅ I certify

  • I DO CERTIFY I READ EACH LINE OF THE PULL REQUEST BECAUSE I AM A SOFTWARE ENGINEER, NOT A AI PUPPY.

🤖 Generated with Claude Code

https://claude.ai/code/session_01TnCgcujM2xi6T6dkmVogVw

…'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
@blafourcade
blafourcade marked this pull request as ready for review October 20, 2026 05:31
@blafourcade
blafourcade requested a review from a team as a code owner October 20, 2026 05:31
@blafourcade
blafourcade merged commit 3129aba into next Oct 20, 2026
61 checks passed
@blafourcade
blafourcade deleted the test/telemetry-lifecycle-ambient-session branch October 20, 2026 05:31
@blafourcade blafourcade added this to the This week milestone Oct 22, 2026 — with Claude
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant