Skip to content

Discard can report success after the interrupted follow-up was already queued #804

Open

Description

@lastobelus

Follow-up F5 from PR #779 (merged as e2a195b2296), local review round 3 (Terra finding R7). Pre-existing in the service; #779's agent tools expose it to callers.

Claim

ActionResume.ts:1358-1363: if deliverPendingUnlocked gets the follow-up message accepted by dispatch but saving delivered then fails transiently, the registry still says pending. resumeInterruptedImpl rolls it back to available and returns failure. A subsequent discard (ActionResume.ts:1380-1392) then succeeds, but it does not remove the message that was already queued.

Why declined

Pre-existing; needs a transient ledger write failure right after an accepted dispatch.

Symptom if left

An agent or user discards the interrupted follow-up (told "new Actions can launch"), but the already-queued follow-up still runs later, delivering a result the caller thought was dropped.

Suggested fix

Distinguish an accepted dispatch from a failure before acceptance before restoring available. Reconcile using the stable receipt or message identity (as deliveryAlreadyAccepted does on retry), and don't offer discard as if the queued follow-up had been dropped. Cover the accepted-dispatch / failed-ledger-write case.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions