fix: use windows sandbox fallback for harness

This commit is contained in:
KOKO\Mimi
2026-08-09 04:17:31 +09:00
parent be2022527b
commit 9406105014
2 changed files with 8 additions and 4 deletions
+5 -4
View File
@@ -251,9 +251,10 @@ class StepExecutor:
sys.exit(1) sys.exit(1)
prompt = preamble + step_file.read_text(encoding="utf-8") prompt = preamble + step_file.read_text(encoding="utf-8")
command = [ command = ["codex", "exec"]
"codex", if os.name == "nt":
"exec", command.extend(["-c", 'windows.sandbox="unelevated"'])
command.extend([
"--json", "--json",
"--sandbox", "--sandbox",
"workspace-write", "workspace-write",
@@ -261,7 +262,7 @@ class StepExecutor:
"--cd", "--cd",
self._root, self._root,
"-", "-",
] ])
try: try:
result = subprocess.run( result = subprocess.run(
command, command,
+3
View File
@@ -34,6 +34,9 @@ def test_invoke_codex_uses_utf8_for_unicode_prompt(tmp_path, monkeypatch):
assert "EulerBernoulli 보" in invocation["kwargs"]["input"] assert "EulerBernoulli 보" in invocation["kwargs"]["input"]
assert invocation["kwargs"]["encoding"] == "utf-8" assert invocation["kwargs"]["encoding"] == "utf-8"
if execute.os.name == "nt":
config_index = invocation["command"].index("-c")
assert invocation["command"][config_index + 1] == 'windows.sandbox="unelevated"'
def test_run_git_decodes_output_as_utf8(tmp_path, monkeypatch): def test_run_git_decodes_output_as_utf8(tmp_path, monkeypatch):