diff --git a/src/ouroboros/orchestrator/codex_cli_runtime.py b/src/ouroboros/orchestrator/codex_cli_runtime.py index 8210b6f57..3e0395d1c 100644 --- a/src/ouroboros/orchestrator/codex_cli_runtime.py +++ b/src/ouroboros/orchestrator/codex_cli_runtime.py @@ -552,7 +552,7 @@ def _build_command( prompt: str | None = None, ) -> list[str]: """Build the CLI command args. Prompt is fed via stdin separately.""" - command = [self._cli_path, "exec"] + command = [self._cli_path, "exec", "--ignore-user-config"] command.extend( [ diff --git a/src/ouroboros/providers/codex_cli_adapter.py b/src/ouroboros/providers/codex_cli_adapter.py index d2af6c957..27ddfe2b2 100644 --- a/src/ouroboros/providers/codex_cli_adapter.py +++ b/src/ouroboros/providers/codex_cli_adapter.py @@ -358,6 +358,7 @@ def _build_command( command = [ self._cli_path, "exec", + "--ignore-user-config", "--json", "--skip-git-repo-check", "-C", diff --git a/tests/unit/orchestrator/test_codex_cli_runtime.py b/tests/unit/orchestrator/test_codex_cli_runtime.py index 9ccaae4f7..db945afba 100644 --- a/tests/unit/orchestrator/test_codex_cli_runtime.py +++ b/tests/unit/orchestrator/test_codex_cli_runtime.py @@ -209,13 +209,15 @@ def test_build_command_for_new_session(self) -> None: output_last_message_path="/tmp/out.txt", ) - assert command[:2] == ["/usr/local/bin/codex", "exec"] + assert Path(command[0]) == Path("/usr/local/bin/codex") + assert command[1] == "exec" + assert "--ignore-user-config" in command assert "--json" in command assert "--full-auto" in command assert "--model" in command assert "o3" in command assert "-C" in command - assert "/tmp/project" in command + assert Path(command[command.index("-C") + 1]) == Path("/tmp/project") def test_build_command_for_resume(self) -> None: """Builds an exec resume command when a session id is provided.""" @@ -233,7 +235,7 @@ def test_build_command_for_resume(self) -> None: assert command.index("--skip-git-repo-check") < resume_index assert command.index("--output-last-message") < resume_index assert command.index("-C") < resume_index - assert command[command.index("-C") + 1] == "/tmp/project" + assert Path(command[command.index("-C") + 1]) == Path("/tmp/project") def test_resolve_cli_path_falls_back_from_wrapper(self, tmp_path: Path) -> None: """Runtime should bypass wrappers the same way provider adapters do.""" @@ -452,7 +454,7 @@ async def test_execute_task_routes_ooo_input_through_shared_stateless_router( request = mock_resolve.call_args.args[1] assert isinstance(request, ResolveRequest) assert request.prompt == "ooo run seed.yaml" - assert request.cwd == "/tmp/project" + assert Path(request.cwd) == Path("/tmp/project") assert request.skills_dir == tmp_path dispatcher.assert_awaited_once() intercept_request = dispatcher.await_args.args[0] @@ -1120,10 +1122,8 @@ async def test_execute_task_dispatches_interview_with_initial_context( intercept_request = dispatcher.await_args.args[0] assert intercept_request.mcp_tool == "ouroboros_interview" assert intercept_request.first_argument == "Build a REST API" - assert intercept_request.mcp_args == { - "initial_context": "Build a REST API", - "cwd": "/tmp/project", - } + assert intercept_request.mcp_args["initial_context"] == "Build a REST API" + assert Path(intercept_request.mcp_args["cwd"]) == Path("/tmp/project") mock_exec.assert_not_called() assert [message.content for message in messages] == [ "Starting interview", diff --git a/tests/unit/providers/test_codex_cli_adapter.py b/tests/unit/providers/test_codex_cli_adapter.py index 013772c5f..201239856 100644 --- a/tests/unit/providers/test_codex_cli_adapter.py +++ b/tests/unit/providers/test_codex_cli_adapter.py @@ -207,6 +207,7 @@ def test_build_command_uses_read_only_by_default(self) -> None: model=None, ) + assert "--ignore-user-config" in command assert "--sandbox" in command assert "read-only" in command @@ -244,7 +245,7 @@ async def fake_create_subprocess_exec(*command: str, **kwargs: Any) -> _FakeProc output_index = command.index("--output-last-message") + 1 Path(command[output_index]).write_text("Final answer", encoding="utf-8") assert "--model" not in command - assert kwargs["cwd"] == "/tmp/project" + assert Path(kwargs["cwd"]) == Path("/tmp/project") # Prompt is now fed via stdin, not as a positional argument assert kwargs.get("stdin") is not None return _FakeProcess(