Human Approval and Control Boundaries › Interruption, cancellation, and preemption

Michael BrenndoerferDecember 1, 20263 min read
Language AI HandbookAll chapters
Part 49 of 67Long-Horizon Agents and Interoperability
Chapter 379Human Approval and Control Boundaries › Interruption, cancellation, and preemption
Reading section 9 of 17 · Interruption, cancellation, and preemption · 3 minSection 9 of 17 · 3 min

Section 9 of 17 · 3 min read

Reading settings

Definitions

Choose how many terms have tooltips.

Article links

Make inline references clickable

Notes & comments

A stop request has different effects before and after commit. A queued operation can be paused or withdrawn while there has been no external write. An operation already underway needs a worker or service that cooperates with cancellation before an irreversible step. Once an operation has committed, stopping the agent prevents further work. Separate recovery or compensation is needed to address what it already did.

The example checks both paused and revoked immediately before a simulated write. This toy lets the recorded approver change the interruption state even after scope ownership moves. Dispatch still checks current ownership. A deployed service can delegate authority to clear a pause under an explicit policy. Permanent revocation stays attached to that decision ID. A new authorized approval can make an uncommitted intent eligible while the original ID remains revoked. Neither interruption deletes the prior decision or an existing receipt. If an interruption and dispatch race in a production system, the observable result depends on their order at the actual commit boundary. In that system, persist the decision state with the claim or lock on the relevant operation. The notebook processes operations sequentially, so the ordered test outcomes are deterministic.

PythonIn [19]
CollapseExpand
interrupt_broker = make_broker()
interrupt_id = interrupt_broker.decide(
    first_intent, "priya", 30, 330, 150, allow=True
)
interrupt_broker.interrupt(interrupt_id, "priya", 60)
print(
    "while paused:",
    interrupt_broker.dispatch(
        first_intent, "publisher", 70, interrupt_id
    ).status,
)
interrupt_broker.release_pause(interrupt_id, "priya", 80)
interrupt_broker.interrupt(interrupt_id, "priya", 100, permanent=True)
interrupt_broker.release_pause(interrupt_id, "priya", 105)
print(
    "after permanent revocation:",
    interrupt_broker.dispatch(
        first_intent, "publisher", 110, interrupt_id
    ).status,
)
print("simulated publications:", len(interrupt_broker.committed))
ConsoleOut [19]
CollapseExpand
while paused: paused
after permanent revocation: revoked
simulated publications: 0

Measure cancellation by observable effect, not by the speed with which the UI changes color. A useful service test covers three positions: before a queued worker starts, just before the service commits, and after the receipt exists. At the last position, a successful interruption can stop the next operation, while the already-completed operation still has a recorded receipt.

PythonIn [20]
CollapseExpand
def eligibility_trace(permanent_at):
    test_broker = make_broker()
    uid = test_broker.decide(first_intent, "priya", 30, 330, 150, allow=True)
    bins = np.arange(0, 161, 5)
    values = []
    for t in bins:
        if permanent_at is not None and t == permanent_at:
            test_broker.interrupt(uid, "priya", int(t), permanent=True)
        values.append(
            test_broker._status(first_intent, "publisher", int(t), uid)
            == "eligible"
        )
    return bins, values


timeline_s, eligible_until_expiry = eligibility_trace(None)
_, eligible_with_revocation = eligibility_trace(100)
VisualizationOut [21]
CollapseExpand
Two eligibility traces begin at 30 seconds and end at 100 and 150.
The broker finds the fixed synthetic intent time-eligible from issuance at 30 seconds until scope expiry at 150 seconds. In the second trace, revocation at 100 seconds closes eligibility earlier. Each point comes from the current broker checks on the declared time grid. No publication is attempted by this trace.

The two traces are eligibility checks, not completion rates. The curve with no revocation ends at the scope deadline even though the approval deadline is much later. The earlier fall shows what a permanent revocation changes. An already committed write would still appear in the board's receipt index.

Comments

Add to the conversation

A question, a correction, or an example from your own work.

No comments yet. Be the first to share your thoughts!

Newsletter

Stay up to date

Get new articles, book updates, and notes on AI and technology.

Unsubscribe at any time. Privacy policy