fix(orchestrator): Recover cancelled deliveries only on explicit rearm#23

draft1
contrib/ctm/exhausted-start-settlement
contrib/ctm/cancelled-delivery-recovery
openedSep 27, 2026byMMike Olson
View on GitHubTwo-way sync enabledPR last imported 51m ago

What Changed

Stopping a parent's delegated-completion wake now returns its results to pending without immediately waking the parent again. Those results, and other pending results in the same parent, are delivered again only when the delegated task's wake policy is changed explicitly, for example when a parent's wait times out and it asks to be woken on completion. Restarting the server does not undo the Stop, while a delivery that the restart itself cut is still offered again, as upstream intends. A late acceptance can no longer consume a cancelled or interrupted delivery.

The claims on pending results and the next delivery are reserved in one transaction, so concurrent policy changes create a single delivery and a failed write leaves nothing half-claimed.

Why

After Stop, results could either be lost or come straight back as a new wake, which defeated the point of stopping. Requiring an explicit rearm keeps Stop meaningful while still letting the parent collect its results.

Known Limitations

If reserving a delivery fails while a wake-policy change is being planned, that command's ID is already used. The wait-timeout upgrade reuses a fixed ID, so it cannot be retried for that task afterward.

Checklist

  • This PR is small and focused
  • I explained what changed and why
  • I included before/after screenshots for any UI changes
  • I included a video for animation/interaction changes

Added 1 commit

  • fix(orchestrator): Recover cancelled deliveries only on explicit rearma80e97d