Skip to content

The agent that grows with you

fix(tests): pin workspace snapshot in plugin-prompt-sections byte-stability test

Teknium7a0cdbcd790e
diff --git a/tests/agent/test_plugin_prompt_sections.py b/tests/agent/test_plugin_prompt_sections.py
index ff4aea89253..d27e59b6fcc 100644
--- a/tests/agent/test_plugin_prompt_sections.py
+++ b/tests/agent/test_plugin_prompt_sections.py
@@ -42,6 +42,16 @@ def _install_test_section(manager: PluginManager, content) -> None:
def test_real_aiagent_builds_section_once_and_keeps_it_out_of_static_prefix(monkeypatch):
+ # Pin the workspace snapshot: build_coding_workspace_block shells out to
+ # live `git status`/`git log` on every build, and a git call failing or
+ # timing out under xdist contention makes the two builds differ in the
+ # Branch/Recent-commits lines — a flake unrelated to what this test
+ # asserts (plugin sections). Byte-stability of the REAL workspace block
+ # is coding_context's contract, covered by its own tests.
+ monkeypatch.setattr(
+ "agent.coding_context.build_coding_workspace_block",
+ lambda cwd=None: "Workspace (snapshot at session start):\n- Root: /pinned",
+ )
calls = []
def section(session_info):