Skip to content

Commit 526d1a6

Browse files
authored
Merge pull request #4872 from loopx-project/codex/turn-machine-credential-context-contract
2 parents 8a2a2c7 + cc61b2e commit 526d1a6

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

‎tests/test_turn_machine_credential.py‎

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ def turn(project, runtime, registry, *options, action="plan"):
4848

4949
def test_two_goal_runtimes_use_machine_credential_for_plan_and_dispatch(tmp_path, machine, monkeypatch):
5050
received = []
51+
expected = []
5152

5253
def sdk_runner(**kwargs):
5354
received.append(kwargs["env"])
@@ -60,6 +61,13 @@ def sdk_runner(**kwargs):
6061
monkeypatch.setattr(turn_host_adapter, "run_dsh_turn", sdk_runner)
6162
for name in ("first", "second"):
6263
project, runtime, registry = _write_live_fixture(tmp_path / name)
64+
expected.append({
65+
"DEEPSEEK_API_KEY": KEY,
66+
"LOOPX_TURN_GOAL_ID": "loopx-turn-fixture",
67+
"LOOPX_TURN_AGENT_ID": "codex-fixture",
68+
"LOOPX_TURN_TODO_ID": "todo_fixture0001",
69+
"LOOPX_TURN_WORKSPACE": str(project.resolve()),
70+
})
6371
# A conflicting Goal-local store cannot redirect machine authentication.
6472
provider.write_operator_provider(runtime_root=runtime, api_key=GOAL_KEY)
6573
code, plan = turn(project, runtime, registry)
@@ -72,7 +80,7 @@ def sdk_runner(**kwargs):
7280
assert code == 0, result
7381
assert result["result_kind"] == "iteration_failed"
7482
assert result["effects"]["quota_spent"] is False
75-
assert received == [{"DEEPSEEK_API_KEY": KEY}] * 2
83+
assert received == expected
7684

7785

7886
def test_invalid_machine_store_cannot_fall_back_to_goal_or_environment(tmp_path, machine, monkeypatch):

0 commit comments

Comments
 (0)