Repository navigation
[FEATURE]: Graceful handling of queued messages after session interrupt #5333
Description
Feature hasn't been suggested before.
- I have verified this feature I'm about to request hasn't been suggested before.
Describe the enhancement you want to request
Problem
When a user sends multiple messages while an operation is in progress, the messages are queued. However, if the current operation is interrupted (aborted), the queued messages are silently rejected and lost rather than being processed. This creates a poor user experience, especially when iterating quickly with the AI assistant.
Current behavior:
current-queue-system.mp4
- User sends message A (starts processing)
- User sends message B while A is processing (queued)
- User interrupts message A
- Message B is silently discarded ❌
Expected behavior:
- User sends message A (starts processing)
- User sends message B while A is processing (queued)
- User interrupts message A
- Message B begins processing automatically ✅
Proposed Solution
This feature adds graceful queue handling with full visibility and control:
Screen.Recording.2025-12-10.at.1.47.19.PM.mov
1. Queue Persistence After Interrupts
Queued messages remain in the queue and are processed in order after an interrupt, rather than being rejected.
2. Cancel Individual Queued Messages
Users can remove specific messages from the queue via the message action dialog (click on a queued message to see the "Cancel" option).
3. Separated Queue Display
Queued messages are pinned in a dedicated section above the input prompt, visually separated from the scrolling conversation. A "Processing next task..." separator shows when tasks transition.
Implementation
A working implementation is available in the fork branch:
🔗 https://github.com/thoughtlesslabs/opencode/tree/feat/queued-message-interrupt
Key Changes
| File | Description |
|---|---|
packages/opencode/src/session/prompt.ts |
Queue handling logic with loopId tracking to prevent race conditions, cancelQueued() and getQueuedMessageIds() functions |
packages/opencode/src/cli/cmd/tui/routes/session/index.tsx |
Visual queue separation with queuedMessages and activeMessages memos, pinned queue section |
packages/opencode/src/cli/cmd/tui/routes/session/dialog-message.tsx |
Cancel action for queued messages in the message dialog |
Technical Details
- Added
loopIdtracking usingulid()to prevent race conditions when canceling/restarting loops - Queue callbacks now include
userMessageIDfor proper tracking processQueuedCallbacks()handles ordered queue processing after interrupts- UI uses SolidJS reactive memos for efficient queue state management
Why It Belongs in OpenCode
- Improves UX - User input is never silently discarded
- Provides transparency - Users can see exactly what's queued and processing
- Gives users control - Ability to cancel individual queued messages
- Common workflow - Users frequently iterate quickly, sending follow-up messages before the AI finishes
- No breaking changes - Backward compatible enhancement to existing behavior
This feature request follows the CONTRIBUTING.md guidelines for net-new functionality.
Activity
github-actions commentedon Dec 10, 2025
This issue might be a duplicate of existing issues. Please check:
Feel free to ignore if none of these address your specific case.
thoughtlesslabs commentedon Dec 10, 2025
I do understand that there are some other related issues raised, but i put this as a new one because it provides a comprehensive solution and I wanted to submit this is a feature request instead of a bug fix because it introduces updated ui/ux elements
rekram1-node commentedon Dec 10, 2025
I see...
thoughtlesslabs commentedon Dec 23, 2025
Hey @rekram1-node what would next steps be on this? Push as a pr?
rekram1-node commentedon Dec 23, 2025
The proposal sounds a bit more complicated than what i'd expect but I havent looked into this particular issue enough.
It seems like there is prolly a simple fix so that a queued message would be persisted to disk
thoughtlesslabs commentedon Jan 13, 2026
@rekram1-node the fix i originally put forward still did some weird things, but was definitely simpler. I can close these ones and figure out a better solution. It's funny how often i run into this, but I queue messages quite a bit. And also interrupt actions when i can see things going off the rails.
thdxr commentedon Mar 25, 2026
To stay organized issues are automatically closed after 90 days of no activity. If the issue is still relevant please open a new one.
robclancy commentedon Mar 25, 2026
I used opencode for a month and this always annoyed me. Then I tried out claude code and this single change is the biggest reason I will keep using it. Currently rate limited so back for a bit but this change has instantly annoyed me again.
epicwhale commentedon Jun 5, 2026
agree this feels like quite a solved problem and user expectation in claude code, and would be a great quality of life improvement in opencode!
there's literally no way to undo a queued message :( without aborting the whole turn!
aikomputeapi-web commentedon Aug 9, 2026
what on earth is the excuse for taking sooooo long for such an obvious fix...... this was annoying, but now learning how this issue is being handled has convinced me to find an alternative cli tool quickly... very sad to see.
jcode seems like an interesting new entrant to the harness engineering game, we'll see how it matures, but im excited so far..... anything to get off this horribly maintained codebase..... bye opencode
7heMech commentedon Aug 21, 2026
Dudee
stuible commentedon Sep 15, 2026
Really would love this addressed
robclancy commentedon Sep 15, 2026
I'm pretty sure it works like this on opencode2 btw. Last night when I pressed escape it seemed to be picking up what I had there but out of habit I never waited so not 100% sure.
If this issue wasn't stupidly closed they probably would have it linked to the feature.