Feature: Add optional setting to prune queue on startup#8861
Merged
lstein merged 13 commits intoinvoke-ai:mainfrom Apr 14, 2026
Merged
Feature: Add optional setting to prune queue on startup#8861lstein merged 13 commits intoinvoke-ai:mainfrom
lstein merged 13 commits intoinvoke-ai:mainfrom
Conversation
Now it is possible to set Max queue history in both places: .yaml and UI.
dunkeroni
approved these changes
Apr 13, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR improves session queue cleanup by adding a configurable history limit instead of the previous all-or-nothing startup cleanup behavior.
max_queue_historyconfig to keep the most recent N terminal session-queue items on startup (0prunes all).max_queue_history.Max Queue Historycontrol to theSettingsmodal so the value can be configured in the UI as well as ininvokeai.yaml.Previously, the only available setting was
clear_queue_on_startup, which cleared the entire session queue on startup.This addition fixes slow startups caused by massive session-queue history buildup while allowing users to retain a configurable amount of recent queue history instead of choosing only between keeping everything or clearing everything.
Tip
To use the new option, add
max_queue_history: <N>toinvokeai.yaml, setINVOKEAI_MAX_QUEUE_HISTORY=<N>, or configure it inSettings > Generation.Update
The setting can now be configured both in the UI and in
invokeai.yaml.UI changes are saved to
invokeai.yaml, and manual YAML changes are shown in the UI after restart.QA Instructions
max_queue_historyininvokeai.yaml, for example:max_queue_history: 5clear_queue_on_startup: false(or not set at all).Pruned X completed/failed/canceled queue items (kept up to N).max_queue_history: 0, restart, and verify terminal queue items are fully pruned on startup.clear_queue_on_startup: true, restart, and verify the entire session queue is cleared.Merge Plan
Versioning/schema
Checklist
What's Newcopy (if doing a release after this PR)