代码提交
This commit is contained in:
1 parent
bf42a48fcc
commit
75f288b241
17 files changed
+65
-69
No files matched your search
@@ -101,10 +101,12 @@ def test_event_envelope_accepts_snake_or_camel_aliases() -> None:
|
||||
|
||||
|
||||
def test_node_run_id_is_deterministic() -> None:
|
||||
assert make_node_run_id("research_brand", 2) == "research_brand-attempt2"
|
||||
assert parse_node_run_id("research_brand-attempt2") == ("research_brand", 2)
|
||||
assert make_node_run_id("rcr_x", "research_brand", 2) == "rcr_x-research_brand-attempt2"
|
||||
assert parse_node_run_id("rcr_x-research_brand-attempt2") == ("rcr_x-research_brand", 2)
|
||||
with pytest.raises(ValueError):
|
||||
make_node_run_id("research_brand", 0)
|
||||
make_node_run_id("rcr_x", "research_brand", 0)
|
||||
with pytest.raises(ValueError):
|
||||
make_node_run_id("", "research_brand", 1)
|
||||
with pytest.raises(ValueError):
|
||||
parse_node_run_id("random-uuid")
|
||||
|
||||
|
||||
@@ -175,7 +175,7 @@ async def test_recovery_preserves_completed_nodes() -> None:
|
||||
write["status"] = "running"
|
||||
await store.save_node_run(write)
|
||||
report = await recover_orphaned_attempts(store, run_id)
|
||||
assert "research-attempt1" in report.preserved_completed
|
||||
assert f"{run_id}-research-attempt1" in report.preserved_completed
|
||||
assert write["node_run_id"] in report.interrupted_node_run_ids
|
||||
latest = {item["node_id"]: item for item in await store.list_node_runs(run_id)}
|
||||
assert latest["research"]["status"] == "completed"
|
||||
|
||||
@@ -71,11 +71,12 @@ def test_completed_reopen_creates_new_attempt_id() -> None:
|
||||
assert can_transition_node("reopened", "queued")
|
||||
with pytest.raises(IllegalNodeTransition):
|
||||
require_transition("completed", "queued")
|
||||
first = make_node_run_id("writer", 1)
|
||||
second = make_node_run_id("writer", 2)
|
||||
assert first == "writer-attempt1"
|
||||
assert second == "writer-attempt2"
|
||||
first = make_node_run_id("rcr_x", "writer", 1)
|
||||
second = make_node_run_id("rcr_x", "writer", 2)
|
||||
assert first == "rcr_x-writer-attempt1"
|
||||
assert second == "rcr_x-writer-attempt2"
|
||||
assert first != second
|
||||
assert make_node_run_id("rcr_y", "writer", 1) != first
|
||||
|
||||
|
||||
def test_planned_is_bootstrap_source() -> None:
|
||||
|
||||
@@ -152,7 +152,7 @@ async def test_waves_researcher_before_writer_and_text_does_not_complete() -> No
|
||||
assert advice[0]["data"]["suggested_next_node_ids"] == ["write"]
|
||||
agents = await store.list_agent_runs(run_id)
|
||||
phases = {item["node_run_id"]: item["phase_id"] for item in agents}
|
||||
assert phases["research-attempt1"] != phases["write-attempt1"]
|
||||
assert phases[f"{run_id}-research-attempt1"] != phases[f"{run_id}-write-attempt1"]
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
|
||||
Reference in new issue
Block a user