diff --git a/scripts/execute.py b/scripts/execute.py index e5219c2..0d875fa 100644 --- a/scripts/execute.py +++ b/scripts/execute.py @@ -251,9 +251,10 @@ class StepExecutor: sys.exit(1) prompt = preamble + step_file.read_text(encoding="utf-8") - command = [ - "codex", - "exec", + command = ["codex", "exec"] + if os.name == "nt": + command.extend(["-c", 'windows.sandbox="unelevated"']) + command.extend([ "--json", "--sandbox", "workspace-write", @@ -261,7 +262,7 @@ class StepExecutor: "--cd", self._root, "-", - ] + ]) try: result = subprocess.run( command, diff --git a/tests/test_execute.py b/tests/test_execute.py index 108354b..a5675e4 100644 --- a/tests/test_execute.py +++ b/tests/test_execute.py @@ -34,6 +34,9 @@ def test_invoke_codex_uses_utf8_for_unicode_prompt(tmp_path, monkeypatch): assert "Euler–Bernoulli 보" in invocation["kwargs"]["input"] 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):