Skip to content

Preserve automation run lifecycle while waiting for global queue capacity #1920

Closed

Description

@currentbits

Fix new-thread automation fires that are prematurely settled while waiting in the global runner queue. Keep per-fire pending/history state through queue admission and completion, retain queued threads past the history cap, and preserve fixed-destination skip-on-full behavior.

Plan:

  • Reproduce with fixture providers through createRunner's real global queue.
  • Make a scoped lifecycle/retention fix and cover repeated schedule fires, admission, completion, and fixed-destination skips.
  • Run relevant checks, annotate the diff, and open a reviewable PR.

Activity

  1. added
    plan:todo
    plan:doing
    and removed
    plan:todo
    on Nov 7, 2026
  2. currentbits commented on Nov 7, 2026

    @currentbits
    OwnerAuthor

    Reproduced through createRunner with file-gated fixture-provider processes: queued fires settle as idle, and 22 repeated schedule fires prune queued work. Found an admission gap as well: admitQueuedRuns clears runQueue before startRun's automation settlement.

    Implemented per-fire pending records with legacy-pointer fallback; queued history entries retain stable identity and acquire the actual run id on admission; pending history survives the retention cap. Queue markers now survive preflight and clear on working/failure. Continue/fresh fixed-destination skip behavior remains unchanged.

    Focused automation/queue tests passed (90 tests) before adding expanded mixed-history and terminal-path coverage. Typecheck passes. Completing expanded checks and local diff review before opening the PR.

  3. currentbits commented on Nov 7, 2026

    @currentbits
    OwnerAuthor

    Implementation and local verification complete; PR #1922 is open for review at #1922 (head 3af7c95).

    Final checks: 228 backend tests across 14 relevant suites; 54 automation renderer tests; core build; typecheck; git diff checks. Eight real-runner regression cases cover queue admission/completion, retention, repeated scheduled fires, private/project history across mode switches, legacy pending state, cancellation, admission/launch failures, and unchanged fixed continue/fresh full-queue skips.

    Review itinerary written on the thread. Keeping this issue plan:doing until the PR is merged; Closes #1920 is in the PR body.

  4. currentbits commented on Nov 7, 2026

    @currentbits
    OwnerAuthor

    After restart, verified PR #1922 head 3af7c95 has all 14 CI checks passing. Review identified an Ask-mode admission path that returns before the regular queue-marker clear. Reproduced by switching a queued automation thread to Ask through services.startAsk; the marker remains attached while working. Added a regression for a single Ask completion, a single user prompt, and final automation settlement. The scoped fix clears runQueue in Ask's working transition and honors skipUserAppend. Focused red/green verified; running neighboring suites including ask-runner before pushing.

  5. currentbits commented on Nov 7, 2026

    @currentbits
    OwnerAuthor

    Pushed review fix aec19a9 to PR #1922. Ask-mode queue admission now clears the marker atomically with working and preserves the existing queued user message. The new real-runner regression failed before the change and passes after it. Final local verification: 232 backend tests across 15 suites and typecheck pass; review itinerary updated. Prior head had all 14 CI checks green; CI is rerunning for the new head. Issue remains plan:doing pending PR 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:doing

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions