fix(jobs): persist owned job lifecycle timing in sessions

This commit is contained in:
fz committed 2026-09-30 15:25:24 +08:00
1 parent 0ebba99d8b
commit f899e87a1e
94 files changed
+3195 -310

No files matched your search

+17
View File
@@ -736,3 +736,20 @@ def test_live_turn_accepts_explanation_before_final_sentinel(prefix: str) -> Non
def test_live_turn_rejects_missing_final_sentinel(answer: str) -> None:
with pytest.raises(AssertionError, match="turn returned"):
SMOKE["assert_live_turn"]("create", live_result(final_response=answer))
def test_job_snapshot_normalization_preserves_pairing_and_uncertainty():
normalize = SMOKE["normalize_snapshot_value"]
replacements = []
first = {"type": "job/registered", "data": {"executionId": "job-a", "startedAt": 10}}
last = {"type": "job/settled", "data": {"executionId": "job-a", "startedAt": 10,
"finishedAt": 20, "terminationConfirmed": False}}
other = {"type": "job/registered", "data": {"executionId": "job-b", "startedAt": 30}}
a, b, c = normalize([first, last, other], replacements)
assert a["data"] == {"executionId": "{{id:1}}", "startedAt": 0}
assert b["data"] == {"executionId": "{{id:1}}", "startedAt": 0, "finishedAt": 0, "terminationConfirmed": False}
assert c["data"]["executionId"] == "{{id:2}}"
assert normalize([a, b, c], []) == [a, b, c]
assert normalize({"type": "tool/result", "data": {"startedAt": 100, "finishedAt": 200}}, []) == {
"type": "tool/result", "data": {"startedAt": 100, "finishedAt": 200},
}