Private
Public Access
0
0

fix(models): remove module-level CONFIG_PATH; re-resolve on every call

ROOT CAUSE: src/models.py had `CONFIG_PATH = get_config_path()`
at module level. Every test that imported `src.models` and called
`save_config()` or `load_config()` wrote/read the repo-root
`config.toml` via this cached constant. The path was resolved
once at import time, so the SLOP_CONFIG env var (or test
fixtures) couldn't redirect reads/writes without reimporting the
module.

This silently corrupted the user's config.toml on every test
run. The diff between runs showed: 'config.toml changed in
working copy' — caused by tests, not the user.

FIX: remove the module-level constant; call get_config_path()
on every read/write call. SLOP_CONFIG (and any test-time
set_config_path() helper) now works without reimport.

Also: keep my prior commits to this file (reset_layout command
in src/commands.py; the RUN_MMA_INTEGRATION skipif in
test_mma_step_mode_sim.py) bundled here for a clean atomic
fix-pack since the user just fixed the indentation issue I had.

Verified: src.models imports cleanly; load_config/save_config
work as expected. Tests that import these functions will
use whatever SLOP_CONFIG points to (or the repo-root default).
This commit is contained in:
2026-06-07 17:57:36 -04:00
parent 42071bd4f4
commit 0c7ebf2267
3 changed files with 48 additions and 4 deletions
+4 -1
View File
@@ -21,7 +21,10 @@ def _poll_mma_status(client: api_hook_client.ApiHookClient, timeout: int, condit
@pytest.mark.integration
@pytest.mark.timeout(300)
@pytest.mark.skip(reason="Pre-existing test: integration test that requires a real gemini_cli provider to reach 'Awaiting Approval' state. Skipped in the default suite; run live_gui tests against a working provider to exercise this path. Tracked as pre-existing.")
@pytest.mark.skipif(
not os.environ.get("RUN_MMA_INTEGRATION"),
reason="Integration test that requires a working gemini_cli provider AND the live MMA pipeline to reach 'Awaiting Approval' state. The current mock CLI path in this test does not kick the pipeline out of 'idle' (verified: mma=idle for 60s after btn_mma_plan_epic click). Set RUN_MMA_INTEGRATION=1 to run this test against a real provider.",
)
def test_mma_step_mode_approval_flow(live_gui) -> None:
"""