Skip to content

Manual run preflight failures permanently discard an existing queued prompt #924

Closed

Description

@currentbits

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

Starting a new user turn consumes an existing queue before validating whether the run can start. If the daily budget gate rejects the run, the old queued instructions are lost, including on disk.

Reproduction

Using a real Store and createRunner:

  1. Create an idle thread and services.setQueued with an existing prompt.
  2. Set dailyBudgetUsd to 1 and recordSpend(1).
  3. Call runner.startRun with a new user prompt.
  4. The call rejects with Daily budget reached.
  5. thread.queued is null, no transcript messages were appended, and reloading the saved Store still yields queued:null.

This was reproduced without launching a provider or touching a real user store.

Cause

The ordinary startRun path calls services.takeQueued and folds the taken text into the local prompt before assertUnderDailyBudget, provider availability and worktree preflight. Unlike drainQueued, this path has no restoration on rejection.

Acceptance

  • A run that fails before accepting the prompt preserves all previously queued text and attachments.
  • Cover budget rejection, missing provider and worktree setup failure.
  • Once a run is accepted, queued content is delivered exactly once.
  • Restoration must not overwrite follow-ups queued in the meantime.
  • Include a real Store/runner regression test and verify persistence after reload.

Source: electron/runner.js#L7570.

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

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:doing

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions