@nice4work/open-queue
v1.1.0
Published
Message queue plugin for OpenCode - control message flow with hold/immediate modes
Maintainers
Readme
Open Queue
Queue messages while OpenCode is thinking. Instead of interrupting the model mid-response, your follow-up messages wait in line and get sent automatically when it's done.
Why?
When you send a message while OpenCode is running:
- Without this plugin: Your message interrupts the current run, causing context confusion
- With this plugin: Your message waits, then sends automatically when the model is ready
Install
pnpm add -g @nice4work/open-queue
# or: npm install -g @nice4work/open-queueOr run directly without installing:
pnpx @nice4work/open-queue
# or: npx @nice4work/open-queueThis adds the plugin to your opencode.json and sets up the /queue command.
Usage
/queue hold # Queue messages until model is done
/queue immediate # Back to normal (sends any queued messages)
/queue status # Check current mode
/queue file <path> # Parse checklist file and queue pending tasks
/queue file #tasks.md # Search docs/ or tasks/ directory for file
/queue skip # Skip current task and move to nextOr just tell the model: "Turn on message queueing"
File Queue Format
Create a markdown checklist file:
- [ ] Simple task
- [ ] Multiline task
Additional details here:
- Step 1
- Step 2
- [x] Completed task (will be skipped)Run /queue file tasks.md or /queue file #tasks.md to parse and queue all pending tasks.
#filename syntax: Searches only docs/ and tasks/ directories under the project root. If the file is not found in either directory, an error is shown.
Environment Variable
Start in hold mode:
OPENCODE_MESSAGE_QUEUE_MODE=hold opencodeModes
| Mode | What happens |
|------|--------------|
| immediate | Messages send right away (default) |
| hold | Messages queue until the model finishes, then send in order |
Loop Detection & Recovery
When a task enters an infinite loop:
- Similarity-based detection: Compares consecutive assistant outputs using Jaccard similarity. If 5 consecutive outputs are >85% similar (catches near-identical content with minor changes like timestamps), the loop is flagged
- Working tree restored:
git restore .reverts all uncommitted changes made by the looping task - Task marked failed: The checklist item is marked with
[!]in the original file - Next task continues: Queue automatically proceeds to the next pending task
Manual Controls
/queue skip: Skip the current task (running or queued) and move to the next one. The skipped task is marked as failed[!]in the checklist file.
Known Issue
When you send a message in hold mode, it briefly appears sent in the UI, then gets sent again when the model finishes. The model only sees it once (after it's done), but the visual glitch exists. This is an OpenCode limitation.
Links
License
MIT
