Skip to content

Isolate repository tests from inherited Claude Code host markers #33

Description

@CBEPX

Summary

Make repository integration and E2E tests deterministic when the parent process is running inside Claude Code and exports CLAUDECODE / CLAUDE_CODE_ENTRYPOINT.

Observed behavior

During the v1.7.3 standard cc review, Fable launched repository unit and E2E tests from its Claude-driven process. The test environments spread the complete parent environment (tests/integration/claude-companion.test.mjs:294-301 and tests/e2e/codex-skills-e2e.test.mjs:180-187), so Claude host-origin markers reached child Codex/companion processes. A cancellation-oriented E2E path then failed to terminate in its normal time window and the review had to be cancelled.

The normal Codex-run local suite is green, so this is environment-dependent rather than a general test failure.

Risk

  • Claude-driven reviews can look stuck even though the cc worker and process cleanup are healthy.
  • Ambient host markers can change loop-prevention and routing behavior in tests that did not opt into that scenario.
  • CI does not cover this parent environment.

Acceptance criteria

  • Scrub external-host routing markers from the default test environment, while preserving tests that explicitly set them.
  • Add a bounded regression that runs the relevant integration/E2E entrypoint with CLAUDECODE=1 and CLAUDE_CODE_ENTRYPOINT=cli and proves it terminates.
  • Keep the explicit loop-prevention tests green.
  • Verify cancellation fixtures leave no child Codex, Claude, or companion process behind.

Origin

Observed during a real Fable 5.1 review through cc on v1.7.3; reproduced by process-tree inspection and cleared by cancelling the foreground review.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions