Skip to content

Conversation

@DustyShoe
Copy link
Collaborator

@DustyShoe DustyShoe commented Feb 7, 2026

Summary

This PR adds an optional setting in Invokeai.yaml:

  • Added max_queue_history config to keep the most recent N terminal session-queue items on startup (0 prunes all).
  • Startup logic now prunes terminal queue history based on max_queue_history, while preserving pending/staged items.
  • Clarified config precedence and log output around queue cleanup.

Previously, the only available setting was clear_queue_on_startup, which wiped the entire session queue (including staged/pending items).

This addition fixes slow startups caused by massive session-queue history buildup, while avoiding loss of staged/pending items.

Tip

To use the new option, add max_queue_history: <N> to invokeai.yaml (or set INVOKEAI_MAX_QUEUE_HISTORY=<N>).

QA Instructions

QA Instructions (skip installation)

  1. Set max_queue_history in invokeai.yaml, e.g.:
    • max_queue_history: 5
  2. Ensure clear_queue_on_startup: false.
  3. Create enough completed/failed/canceled queue items to exceed the limit (e.g., run several quick generations).
  4. Restart InvokeAI.
  5. Verify:
    • Only the most recent N terminal items remain in history.
    • Pending/staged items are preserved.
    • Logs include: Pruned X completed/failed/canceled queue items (kept up to N).
  6. Set max_queue_history: 0, restart, and verify all terminal items are pruned while pending/staged items remain.
  7. Set clear_queue_on_startup: true, restart, and verify the entire session queue is cleared (including staged items).

Merge Plan

Versioning/schema

  • No schema version bump is required; this is a new optional config setting.
  • No DB migration change.
  • Docs are generated from InvokeAIAppConfig, so the built docs will include max_queue_history without manual edits.

Checklist

  • The PR has a short but descriptive title, suitable for a changelog
  • Tests added / updated (if applicable)
  • ❗Changes to a redux slice have a corresponding migration
  • Documentation added / updated (if applicable)
  • Updated What's New copy (if doing a release after this PR)

@github-actions github-actions bot added python PRs that change python files services PRs that change app services labels Feb 7, 2026
@DustyShoe DustyShoe changed the title Feat(backend): queue prune on startup Feature(backend): Add optional setting to prune queue on startup Feb 7, 2026
@github-actions github-actions bot added the frontend PRs that change frontend files label Feb 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

frontend PRs that change frontend files python PRs that change python files services PRs that change app services

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant