CLI-33: Implement prompt queue feature - #629
Open
szmania wants to merge 8 commits into
Open
Conversation
added 8 commits
July 23, 2026 17:46
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.
CLI-33: Implement Prompt Queue Feature
Purpose
This PR implements the prompt queue feature requested in CLI-33. It enables users to queue prompts for processing after current tasks complete, providing better control over workflow execution in the CLI.
Design Considerations
Architecture
Commandsclass instance, ensuring it persists across command executions within a single session but is cleared on session restartasyncio.Lockfor atomic queue operations to prevent race conditions in the async event loop/queue,/list-queue, and/remove-queuecommands to prevent infinite recursion and ensure management commands can be executed during active prompt processingQueue Processing
Commands.execute()finally block, aftercmd_running_eventis set_processing_queueflag prevents infinite loops from queued prompts that queue additional itemsSwitchCoderSignalandReloadProgramSignalare re-raised to maintain proper control flowConstraints
What Changed
New Files
cecli/commands/queue.py-QueueCommandclass implementing/queue <prompt>to add prompts to the queuececli/commands/list_queue.py-ListQueueCommandclass implementing/list-queueto display queued itemscecli/commands/remove_queue.py-RemoveQueueCommandclass implementing/remove-queue [index|*]for interactive or direct removalcecli/tests/test_queue_commands.py- Comprehensive test suite with unit, integration, and E2E testsModified Files
cecli/commands/core.py:prompt_queue,_queue_counter,_queue_lock,_processing_queue,_MANAGEMENT_COMMANDSstate_enqueue_prompt(),_dequeue_prompt(),_get_queue_length(),_remove_from_queue(),_clear_queue(),_process_queued_prompts()execute()to trigger queue processing after management command checkrun()to handle all/prefixed commands properlyexecute()to skip clearingcmd_running_eventfor management commandscecli/commands/__init__.py:QueueCommand,ListQueueCommand, andRemoveQueueCommandinCommandRegistry__all__listREADME.md:Testing
All tests pass successfully:
Related Issue