Skip to content

The agent that grows with you

test(delegation): read the owner's git state from a throwaway repo

kshitijk4poor8fc2de89061a
diff --git a/tests/tools/test_delegation_recovery_diagnostics.py b/tests/tools/test_delegation_recovery_diagnostics.py
index 7fbdbc0f080..20ff701a6f5 100644
--- a/tests/tools/test_delegation_recovery_diagnostics.py
+++ b/tests/tools/test_delegation_recovery_diagnostics.py
@@ -16,6 +16,14 @@ def test_unfinished_delegation_recovery_keeps_transcript_locator(tmp_path, split
"REPRO_HANDLE": str(handle_path), "REPRO_SPLIT": str(int(split)),
"REPRO_MISSING": str(int(missing_writer))}
(tmp_path / 'config.yaml').write_text('delegation:\n independent_completions: true\n', encoding='utf-8')
+ # The owner's git state comes from a throwaway repo: a CI checkout carries a repo-local
+ # includeIf credential include, on which internal git deliberately refuses to run.
+ owner = tmp_path / "owner"
+ owner.mkdir()
+ git = ["git", "-c", "user.name=t", "-c", "[email protected]", "-C", str(owner)]
+ subprocess.run([*git, "init", "-q"], check=True)
+ subprocess.run([*git, "commit", "-q", "--allow-empty", "-m", "init"], check=True)
+ (owner / "dirty.txt").write_text("x", encoding="utf-8")
producer = r'''
import json, os, threading
from pathlib import Path
@@ -57,7 +65,7 @@ assert started.wait(10), "child did not start"
Path(os.environ["REPRO_HANDLE"]).write_text(json.dumps(handle), encoding="utf-8")
os._exit(0)
'''
- first = subprocess.run([sys.executable, "-c", producer], cwd=repo, env=env,
+ first = subprocess.run([sys.executable, "-c", producer], cwd=owner, env=env,
text=True, capture_output=True, timeout=30)
assert first.returncode == 0, first.stdout + first.stderr
handle = json.loads(handle_path.read_text(encoding="utf-8"))