feat: implement prompt queue management (CLI-33) - #677
Merged
Conversation
added 23 commits
August 2, 2026 00:43
Open
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.
Purpose
This PR implements the prompt queue management feature (CLI-33), allowing users to queue prompts for deferred processing, view the queue, insert prompts at specific positions, and selectively remove items.
Changes
cecli/commands/core.py):prompt_queue(list),_queue_counter(int),_queue_lock(ThreadSafeEvent), and_processing_queue(bool) to theCommandsclass._process_queued_prompts(preproc), which iterates through the queue and executes each item usingcoder.run_one.Commands.executeto trigger the queue processing in thefinallyblock, ensuring it runs as soon as a command finishes._enqueue_prompt,_insert_prompt,_dequeue_prompt,_get_queue_length, and_clear_queue./queue <text>: Adds a prompt to the FIFO queue and returns the assigned position./insert-queue [index] <text>: Inserts a prompt at a specific position in the queue (front by default, or at a given index)./list-queue: Displays all currently queued prompts with their IDs and timestamps./remove-queue <index|*>: Removes a specific prompt by index or clears the entire queue using a wildcard. Includes an interactive selection mode if no index is provided.cecli/commands/__init__.pyto import and register the new commands in theCommandRegistry.Design Considerations
asyncio.Lock(viaThreadSafeEventpatterns where appropriate) to ensure safe concurrent access to the queue./queue,/insert-queue,/list-queue,/remove-queue) do not accidentally trigger auto-processing recursively.Documentation
cecli/website/docs/usage/commands.mdto document the/insert-queuecommand alongside the other queue management commands.Testing
core.py.