diff --git a/backend/tests/test_mcp_offer.py b/backend/tests/test_mcp_offer.py index fe0939b4..957ebd3b 100644 --- a/backend/tests/test_mcp_offer.py +++ b/backend/tests/test_mcp_offer.py @@ -7,6 +7,8 @@ loudly instead of shipping a silent gate bypass. """ import asyncio + +import pytest from types import SimpleNamespace import backend.apps.agents.core.mcp_preflight as pf @@ -24,6 +26,14 @@ def p_settings(dismissed=None): return SimpleNamespace(dismissed_mcp_suggestions=dismissed or {}) +@pytest.fixture(autouse=True) +def p_isolated_settings(monkeypatch): + """run_preflight reads the REAL settings.json; a suggestion the developer dismissed in their + own app silently failed this suite (caught live 2026-08-04, Eric dismissed Google Workspace + mid-evening). Every test starts from empty dismissals; dismissal tests override explicitly.""" + monkeypatch.setattr(pf, "load_settings", p_settings) + + def test_offer_resolves_both_display_name_and_hotpath_slug(monkeypatch): # The hot-path passes a sanitized slug ("google-workspace"); the curated id is a display name ("Google Workspace"). Both must resolve, so the wiring isn't a load-bearing string. monkeypatch.setattr(pf, "load_all_tools", lambda: []) # nothing enabled