Repository navigation
feat(opencode): unify prompt queue across surfaces - #4
Merged
Merged
Conversation
Register input.queue on the session prompt textarea, send delivery=deferred via session.prompt, and share submit guards with a common promptInFlight lock.
Process deferred prompts one at a time after the open turn completes, persist delivery on user messages, and exclude sibling queued rows from model context. Add dock/queue helpers, run TUI parity, and serve+script smoke tests with a mocked LLM endpoint.
Keep deferred prompts in memory until the open turn (including steer follow-ups) settles, re-key on persist for correct transcript order, and drive the TUI queue dock from session.deferred.updated instead of the DB.
Extract QueueDock for TUI and run --interactive, reserve footer rows when the queue is visible, and edit queued prompts in place (Alt+Up/Down cycle) instead of removing them from the queue.
Pause FIFO auto-drain while editing queued prompts so items are not sent until the user wakes the session via send-now or a normal submit. Allow the run loop to exit when drain is paused but items remain. Add service and HTTP coverage for pause/resume edge cases across sessions, clear, and queue CRUD.
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.
[ai-agent-generated] LLM-generated PR description.
Summary
Unifies prompt queue behavior across the web app, full TUI, and direct
opencode run -iaround the server-backedsession.queue.*flow.Architectural Flow
session.queue.*API and emitsession.queue.updatedevents for UI sync.run -i, so row reservation and rendered queue rows stay aligned.Validation
git diff --checkcd packages/opencode && bun typecheckcd packages/app && bun typecheckbun typecheckbun turbo test:cicd packages/opencode && bun test test/session/prompt.test.ts --grep "resuming paused queue drain|sending a queued prompt while busy"cd packages/opencode && bun test test/session/revert-compact.test.ts --grep "clears queued prompts after revert"cd packages/opencode && bun test test/data-migration.test.ts test/session/prompt-queue-drain.test.tscd packages/app && bun test src/components/prompt-input/submit.test.ts src/pages/session.queue-save.test.tscd packages/opencode && bun test test/cli/tui/prompt-queue-actions.test.ts test/cli/tui/prompt-queue.test.ts test/cli/tui/prompt-queue-dock.test.ts test/cli/tui/prompt-queue-smoke.test.tsx test/cli/run/runtime.queue.test.ts test/cli/run/runtime.queue-remote.test.ts test/cli/run/footer.view.test.tsx test/cli/run/footer.queue-dock.test.tsx test/cli/run/prompt.shared.test.ts test/session/prompt.test.ts test/server/session-queue.test.ts test/session/prompt-queue-drain.test.tscd packages/app && bun test src/components/prompt-input/submit.test.ts src/components/prompt-input/build-request-parts.test.ts src/context/global-sync/session-cache.test.ts src/context/global-sync/bootstrap.test.ts./build-local.shopencode-local run -iwith Nemotron: busy turn, queue edit switching, empty dequeue, send-now steering, and three-item edit dock window.opencode-localTUI: queue edit switching and three-item edit dock window.