Skip to content

Resume can leave an interrupted Action follow-up pending when metadata publication fails #803

Open

Description

@lastobelus

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

Claim

ActionResume.ts:1357: resumeInterruptedImpl calls persistState({ ...current, delivery: "pending" }) before entering its rollback handling. persistState saves and records pending in the ledger, then publishes thread metadata. If the save succeeds but publication fails (for example, an archive hold begins concurrently), the failure escapes outside the rollback, so delivery stays pending.

Why declined

Pre-existing persistence ordering, not introduced by #779; rare (needs a metadata publication failure in that window).

Symptom if left

The resume call reports failure, yet the follow-up stays armed: a later thread event or Action listing can retry delivery and the follow-up runs anyway. Meanwhile, pending blocks new launches and the composer's Discard is refused (it needs available).

Suggested fix

Include the initial pending transition in the failure handling and restore available when the ledger permits it. Add a test for a failure after the ledger write but before metadata publication.

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