Skip to content

Retry duplicates queued instructions when clearing the old queue fails #925

Closed

Description

@currentbits

Priority: P1. Reproduced/reviewed at commit 6c7a6fbe on 2026-09-05.

Retry can duplicate a queued prompt without starting a run.

Reproduction

  1. Open an idle thread with queued.prompt = "Retry this once" and a delivery error.
  2. Make the clear call to threads.setQueued({prompt:null}) reject.
  3. Allow subsequent non-null setQueued calls to succeed.
  4. Click Retry.
  5. runs.start was never called, but the host queue is now "Retry this once\n\nRetry this once".

Confirmed in the real App with fakeCoder's normal append behavior.

Cause

useCoder.retryQueued wraps both clear and start in one try/catch. The catch always re-enqueues the old payload, even when the clear itself failed and the payload never left the host. services.setQueued appends by default. The same mistake can duplicate attachments. The local overlay still uses the original pending object, masking the host duplication.

Acceptance

  • A failed clear leaves exactly one copy of the old prompt and attachments.
  • Only compensate for a removal that actually succeeded.
  • A rejected start after a successful clear restores the original payload exactly once.
  • Preserve newer concurrently queued content.
  • Assert host queue contents, not just the rendered error.

Source: src/useCoder.ts#L848.

Requested disposition: separate Planboard issue, plan:todo. Scope is the concrete defect above.

Activity

  1. added
    plan:todo
    plan:doing
    plan:done
    and removed
    plan:todo
    plan:doing
    on Sep 5, 2026
  2. currentbits commented on Sep 10, 2026

    @currentbits
    OwnerAuthor

    Landed from Solenta thread "Retry duplicates queued instructions when clearing the old q". Closed on merge.

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

    plan:done

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions