Skip to content

Test isolation leak: tui::ui::tests onboarding tests persist a fixture provider into the real ~/.codewhale/setup_state.json #5932

Description

@Hmbown

Receipt: after two full cargo test -p codewhale-tui --lib runs on this machine tonight (2026-09-06, ~06:44 UTC), the founder's real ~/.codewhale/setup_state.json (mtime matches the run) reads:

"provider_model": { "status": "verified", "result": "provider=fixture-local, model=fixture-model, context_window=128000 (fallback (unverified)) auth=local · not checked, health=attemptable", "version": "0.9.4" }

and codewhale doctor now reports the founder's provider step as verified against a test fixture. fixture-local appears only in crates/tui/src/tui/ui/tests.rs (successful_custom_provider_activation_completes_onboarding, ~line 8105, and its failed_… sibling). The test guards the config path with ConfigPathEnvGuard but not CODEWHALE_HOME, so complete_provider_picker_onboarding_if_switched runs the setup transaction against the real home and Settings::load() reads the real settings.

Two fixes:

  1. Targeted: guard CODEWHALE_HOME (temp dir + lock_test_env, the pattern fleet::roster tests already use) in these tests.
  2. Systemic: no unit test may touch the real home. Add a test-support guard that fails a test when it resolves codewhale_home() to the developer's real home without an explicit override, or set a per-process temp CODEWHALE_HOME in the test harness entry, so the next leak is a red test instead of a corrupted operator state.

Operator remedy today: rerun /setup provider (or codewhale setup) to re-verify the real provider step.

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

    • Status
      In progress

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions