fix: execute local reins through the sandbox owner
Some checks failed
ci / validate (push) Has been cancelled

Assistant: codex
Assistant-Model: gpt-6-astra
Assistant-Session: 01a0726e-5232-73f2-aaca-2c05ceb62efb
This commit is contained in:
tegwick 2026-09-05 19:16:22 +02:00
parent 92392f75f1
commit 63a7f9f160
14 changed files with 463 additions and 81 deletions

View file

@ -45,6 +45,10 @@ def test_start_session_writes_task_file_and_captures_head(tmp_path) -> None:
host="localhost",
reachability={"pid": str(os.getpid()), "workspace_dir": str(repo)},
)
sandbox._owner_execute = MagicMock(
return_value=MagicMock(timed_out=False, output_truncated=False, exit_code=0,
stdout="", stderr="")
)
with patch.object(ExecutionTransport, "git_head", return_value="abc123"):
session = rein.start_session(
profile=ProfileCatalog().resolve("harness.agent-dev-openweights-local@1.0.0")[0],
@ -55,11 +59,11 @@ def test_start_session_writes_task_file_and_captures_head(tmp_path) -> None:
assert session["target_repo"] == str(repo)
assert session["head_before"] == "abc123"
assert session["transport"].workspace == str(repo)
task_spec = json.loads(open(session["task_file"]).read())
task_spec = json.loads(sandbox._owner_execute.call_args.args[1])
assert task_spec["title"] == "t"
assert task_spec["target_repo"] == str(repo)
rein.cleanup_session(session)
assert not os.path.exists(session["task_file"])
assert sandbox._owner_execute.call_args.args[0] == ["rm", "-f", "--", session["task_file"]]
def test_start_session_requires_resolvable_target_repo() -> None: