Skip to content
Open
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
10 changes: 5 additions & 5 deletions loopx/cli_commands/quota_failure_report.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,11 +185,11 @@ def quota_failure_payload(
"status": "heartbeat_receipt_identity_conflict",
"effective_action": EffectiveAction.QUOTA_SKIP.value,
"recommended_action": (
"Rerun quota should-run with the same --turn-instance-id and without "
"--todo-id or --replan-obligation-id to read the bound Turn's recovery "
"contract. Settle verified work or record its verified blocked closeout; "
"do not replace the committed binding, repair receipt storage, or invent "
"a new Turn id. Independent work belongs to the next real host Turn."
"If the conflict reports a replaced task lease generation, wait for the next real host Turn "
"to project execution-loss closeout without quota spend. A replacement lease cannot resume "
"the original Turn. For other binding conflicts, rerun quota should-run with the same "
"--turn-instance-id and without --todo-id or --replan-obligation-id to read the bound Turn's "
"recovery contract. Keep the committed binding and receipt storage intact."
),
})
if isinstance(error, CloseoutQueryUnavailableError):
Expand Down
14 changes: 14 additions & 0 deletions tests/control_plane/test_execution_loss_closeout_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -498,6 +498,20 @@ def test_closeout_preserves_the_original_turn_and_releases_the_next_guard(
assert not original.writeback.receipts and not original.spend.receipts
argv = _closeout_args(context)
if not source_profile:
before_replay = _unchanged_state(context)
replay_args = _guard_args(context)
selection = replay_args.index("--todo-id")
del replay_args[selection:selection + 2]

code, fenced = context["cli"](*replay_args)
assert code == 1, fenced
assert fenced["error_code"] == "heartbeat_receipt_identity_conflict"
assert "original task lease generation" in fenced["reason"]
assert fenced["heartbeat_receipt"]["settlement_identity"] == original.identity.value.as_dict()
assert "wait for the next real host Turn" in fenced["recommended_action"]
assert "execution-loss closeout without quota spend" in fenced["recommended_action"]
assert _unchanged_state(context) == before_replay

# A fresh guard recognizes the generation change before attempting to
# re-enter the original guard. It offers only the administrative route.
route = str(tmp_path / "fixture launcher" / "loopx")
Expand Down
Loading