@@ -284,14 +284,14 @@ def check_at_writeback(admission, *, operation):
284284def _claimed_native_fixture (tmp_path : Path ):
285285 from examples import operation_action_fixtures as fixtures
286286 from loopx .control_plane .turn_driver .managed_operation_host import operation_tool_handler
287+ from test_dsh_goal_mode import _signed_request
287288
288289 service , store = fixtures .service (tmp_path , goal_id = "fixture-goal" )
289290 executable = tmp_path / "fake-codex-operation"
290291 executable .write_text (FAKE_SERVER )
291292 executable .chmod (0o700 )
292- request = _request ()
293- request ["turn_envelope" ]["agent_id" ] = "finance-fixture-agent"
294- request ["turn_envelope" ]["action" ]["selected_todo" ]["todo_id" ] = "todo-managed"
293+ request = _signed_request (goal_id = "fixture-goal" , agent_id = "finance-fixture-agent" , todo_id = "todo-managed" )
294+ request ["session" ]["action" ] = "start_new"
295295 options = dict (runtime_root = store .root .parent .parent , registry_path = service .registry_path ,
296296 project = service .registry_path .parent .parent , codex_bin = str (executable ),
297297 model = "test-model" , reasoning_effort = "xhigh" , timeout_seconds = 5 )
@@ -319,10 +319,26 @@ def _claimed_native_fixture(tmp_path: Path):
319319 return store , claimed , request , options
320320
321321
322+ def _enable_default_oar_for_codex (monkeypatch , executable : Path ) -> None :
323+ from loopx .control_plane .turn_driver import codex_cli
324+
325+ monkeypatch .delenv ("LOOPX_EXECUTION_ENGINE" , raising = False )
326+ # The fixture implements app-server locally. Represent an already
327+ # successful OAR binary probe without running a second model provider.
328+ executable = executable .resolve ()
329+ monkeypatch .setitem (
330+ codex_cli ._OAR_CODEX_BINARY_CACHE ,
331+ (str (executable ), executable .stat ().st_mtime_ns ),
332+ True ,
333+ )
334+
335+
322336def test_confirmed_operation_is_automatically_carried_into_accepted_native_turn (
323337 tmp_path : Path , monkeypatch : pytest .MonkeyPatch ,
324338) -> None :
339+ monkeypatch .setenv ("LOOPX_EXECUTION_ENGINE" , "legacy" )
325340 store , claimed , request , options = _claimed_native_fixture (tmp_path )
341+ _enable_default_oar_for_codex (monkeypatch , Path (options ["codex_bin" ]))
326342 prompt = tmp_path / "native-prompt.txt"
327343 monkeypatch .setenv ("FAKE_OPERATION_PROMPT_FILE" , str (prompt ))
328344 result = run_codex_operation_host (request , ** options )
@@ -787,15 +803,20 @@ def test_owned_app_server_process_authenticates_native_metadata_and_resumes_same
787803 )
788804
789805
806+ @pytest .mark .parametrize ("provider" , ["file" , "sqlite" ])
790807def test_admitted_turn_cli_launches_owned_transport_without_plain_cli_fallback (
791- tmp_path : Path , monkeypatch : pytest .MonkeyPatch
808+ tmp_path : Path , monkeypatch : pytest .MonkeyPatch , provider : str ,
792809) -> None :
793810 from loopx .cli import main as cli_main
811+ from tests .control_plane .canonical_authority_fixture import isolate_sqlite_runtime
794812
795- project , runtime , registry = _write_live_fixture (tmp_path )
813+ if provider == "sqlite" :
814+ isolate_sqlite_runtime (tmp_path , monkeypatch )
815+ project , runtime , registry = _write_live_fixture (tmp_path , provider = provider )
796816 executable = tmp_path / "fake-codex-operation"
797817 executable .write_text (FAKE_SERVER )
798818 executable .chmod (0o700 )
819+ _enable_default_oar_for_codex (monkeypatch , executable )
799820
800821 def forbidden_plain_cli (* args , ** kwargs ):
801822 pytest .fail ("Operation opt-in must not downgrade to plain Codex exec" )
0 commit comments