Agent Sandbox Registry

agent-sandbox

Decision: Add CI environment variable suppression fixture in test conftest

无中文版

.agents/notes/implemented/feature/2026-09-29-ci-env-suppression.md

Decision: Add CI environment variable suppression fixture in test conftest

Status: implemented Implemented: 2026-09-29

Problem

When tests run in CI environments (GitHub Actions, etc.), the environment variables CI=true and GITHUB_ACTIONS=true are automatically set. The SDK's is_ci_env() utility detects these and auto-enables JSON output mode. This caused 108 test failures because:

Decision

Add an autouse session-scoped fixture _suppress_ci_detection in tests/conftest.py that clears all CI-related environment variables before the test session:

@pytest.fixture(autouse=True, scope="session")
def _suppress_ci_detection(monkeypatch_session):
    ci_vars = [
        "CI", "GITHUB_ACTIONS", "GITLAB_CI", "CIRCLECI",
        "TRAVIS", "JENKINS_URL", "BUILDKITE", "TF_BUILD",
        "CODEBUILD_BUILD_ID",
    ]
    for var in ci_vars:
        monkeypatch_session.delenv(var, raising=False)

This ensures tests always run in "local developer" mode regardless of the actual execution environment.

API Design

N/A — this decision does not involve API changes. Test infrastructure only.

Alternatives considered

Dependencies

Test Strategy

Files changed

Acceptance criteria