In this article
Test cancellation at the execution boundary and require a queued tick to belong to the current loop.
A Hermes Agent canary published on November 29 drops queued ticks when their loop has stopped or been replaced. Its change claims a pending tick in a single compare-and-set operation. That is a change at the scheduler’s execution boundary. An operator still needs to verify which effects have already committed when a stop or replacement arrives.
Distinguish pending from executed
A timer firing can create a pending tick before any worker claims it. Stop and replace requests can arrive during that interval. The boundary matters because a user may see a stop acknowledged while earlier work is still finishing. Model pending ticks, work that has acquired its claim and effects that have already been recorded as different states.
Reproduce the scheduling race safely
Use a disposable loop whose only operation records a marker. Pause the test executor after the tick enters the queue, then replace the loop. Resume the executor and verify that the old pending marker never appears while the new loop can still record its marker. Repeat the test with a stop request and a worker whose claim is already confirmed.
Document what the user sees
Correlate the loop identity, queued tick, claim and effect record. Check that the UI distinguishes a stop request from the outcome of already running work. Test restart after a replaced worker leaves its queue entry behind. Count stale drops and duplicate claims separately because they call for different investigations. Use a distinct marker for the old and new loops when testing the replacement. The log should make it clear which logical loop produced each effect. When the current worker had already claimed a tick, record the resulting completion separately from the queued tick that was discarded.
Gate repeated operations
Use the canary for the intended workflow after stale ticks are discarded and legitimate work still proceeds. For actions with external effects, maintain a separate idempotency boundary. A scheduler that rejects stale ticks cannot reverse an action already committed.
Sources
Related reading
Earn rental income from GPUs
Have idle GPUs or looking to fund AI infrastructure? Retrivium finds a rental platform, sets up the server and helps you assess income and costs with a pilot.