Skip to content

Self-hosted AI workspace.

Python

test: stop test_skill_index_prompt_injection leaking a stub prefs_routes (#4387)

Victorcf0c1f68b2f3
diff --git a/tests/test_skill_index_prompt_injection.py b/tests/test_skill_index_prompt_injection.py
index 865e727bb..710a00032 100644
--- a/tests/test_skill_index_prompt_injection.py
+++ b/tests/test_skill_index_prompt_injection.py
@@ -105,7 +105,7 @@ def _patch_prefs(monkeypatch, data_dir):
"skills_enabled": True,
"auto_approve_skills": True,
}
- sys.modules["routes.prefs_routes"] = fake_prefs
+ monkeypatch.setitem(sys.modules, "routes.prefs_routes", fake_prefs)
# Bust the base-prompt cache so our test re-reads the skill index.
from src import agent_loop