Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions examples/control_plane/quota_plan_fixtures.py
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ def write_codex_heartbeat_fixture(root: Path, *, goal_id: str, agent_id: str, rr
path.write_text("\n".join(f"{key} = {json.dumps(value)}" for key, value in fields.items()) + "\n", encoding="utf-8")


def write_cli_fixture(root: Path, *, scoped_agents: bool = False) -> tuple[Path, Path, Path]:
def write_cli_fixture(root: Path, *, scoped_agents: bool = False, provider: str = "sqlite") -> tuple[Path, Path, Path]:
project = root / "project"
runtime = root / "runtime"
registry_path = project / ".loopx" / "registry.json"
Expand Down Expand Up @@ -444,7 +444,7 @@ def write_cli_fixture(root: Path, *, scoped_agents: bool = False) -> tuple[Path,
for record in registry_goals:
initialize_canonical_authority(runtime, record["id"],
build_todo_runtime_shadow_projection(goal_id=record["id"], todos=[], handoff_mode="soft_claim"),
state_path=project / record["state_file"], provider="sqlite")
state_path=project / record["state_file"], provider=provider)
return registry_path, runtime, project


Expand Down
20 changes: 3 additions & 17 deletions tests/test_scheduler_native_launcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,7 @@
write_codex_heartbeat_fixture,
)
from loopx.control_plane.testing.canary_harness import run_json_cli_result
from loopx.control_plane.coordination.runtime_shadow import build_todo_runtime_shadow_projection
from loopx.control_plane.coordination.coordination_state_contract import (
TODO_DOMAIN_READ_RECORD_SCHEMA_VERSION,
TODO_DOMAIN_RECORD_FIELDS,
)
from tests.control_plane.canonical_authority_fixture import (
initialize_canonical_authority,
isolate_sqlite_runtime,
)

Expand Down Expand Up @@ -272,18 +266,10 @@ def test_launcher_binds_ack_to_current_host_readback(
tmp_path: Path, monkeypatch, provider: str, host: str, launcher: str,
) -> None:
isolate_sqlite_runtime(tmp_path, monkeypatch)
registry, runtime, project = write_cli_fixture(tmp_path / "fixture", scoped_agents=True)
# Select the provider at creation, never reinitialize the authority already
# created by write_cli_fixture under the same operation id.
registry, runtime, project = write_cli_fixture(tmp_path / "fixture", scoped_agents=True, provider=provider)
goal = "needs-operator"
state = project / f".codex/goals/{goal}/ACTIVE_GOAL_STATE.md"
projection = build_todo_runtime_shadow_projection(
goal_id=goal, todos=[], handoff_mode="soft_claim",
)
projection["todo_read_model"] = {
**projection["todo_read_model"],
"schema_version": TODO_DOMAIN_READ_RECORD_SCHEMA_VERSION,
"contract_fields": list(TODO_DOMAIN_RECORD_FIELDS),
}
initialize_canonical_authority(runtime, goal, projection, state_path=state, provider=provider)
codex_home = tmp_path / "codex-home"
monkeypatch.setenv("CODEX_HOME", str(codex_home))
monkeypatch.setenv("CODEX_THREAD_ID", "scheduler-fixture")
Expand Down
Loading