feat(tui): queued follow-up messages (chain feature)#33663
Closed
theprofi wants to merge 1 commit into
Closed
Conversation
Adds /queue, /queue-com, and /queue-new prompt commands that chain follow-up messages to fire only after the current turn fully completes, plus /queue-edit-N and /queue-remove-N for managing the queue. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Contributor
|
This PR doesn't fully meet our contributing guidelines and PR template. What needs to be fixed:
Please edit this PR description to address the above within 2 hours, or it will be automatically closed. If you believe this was flagged incorrectly, please let a maintainer know. |
Contributor
|
This pull request has been automatically closed because it was not updated to meet our contributing guidelines within the 2-hour window. Feel free to open a new pull request that follows our guidelines. |
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
Adds the ability to queue follow-up prompts that fire only after the current turn has fully completed (true idle), rather than the default
steerbehavior which can inject between provider steps.Three prompt commands:
/queue <msg>— plain follow-up in the same session, after the current turn finishes./queue-com <msg>— compacts the same session first, then answers in place./queue-new <msg>— opens a brand-new standalone session and answers there.Queue management:
/queue-edit-N— load queued message N into the prompt for editing./queue-remove-N— remove queued message N from the queue.Messages chain: each waits its turn, runs to full completion, then the next runs. Mixed permutations of the three variants chain correctly.
Implementation
TUI-only; jobs are ephemeral (in-memory, lost on TUI restart, same as the upstream queue).
packages/tui/src/context/chain.tsx— new orchestrator context (ChainProvider/useChain) with a single-flight FIFO pump that threads aheadsession forward.packages/tui/src/app.tsx— mounts<ChainProvider>above the session route so/queue-newnavigation doesn't tear down the queue.packages/tui/src/component/prompt/index.tsx— intercepts the slash commands, edit-mode handling, and renders queued jobs above the input.packages/tui/src/component/prompt/autocomplete.tsx— registers the static and dynamic autocomplete entries.AGENTS.md— documents the feature.Test plan
/queue,/queue-com,/queue-neweach fire only after the active turn completes./queue-edit-Nedits a queued message; Esc cancels; empty input leaves unchanged./queue-remove-Nremoves the right job./queue-newsession shows the prompt input (noparentID).