New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

@0xsero/opencode-queue

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@0xsero/opencode-queue

Message queue plugin for OpenCode - control message flow with hold/immediate modes

latest
npmnpm
Version
0.1.0
Version published
Maintainers
1
Created
Source

OpenCode Message Queue Plugin

queue-power.svg

npm version

Control how messages behave while a session is running. Queue them up or send them immediately.

NOTE

Be aware that when a message is sent while model is running it looks like it's sent, then when the model is really done it gets sent again.

I can't fix that yet, but the functionality does work the model won't see the 2nd message until after it's done

Modes

ModeBehavior
immediateMessages are sent right away (default)
holdMessages are queued until the current run finishes, then sent in order

Installation

cd .opencode
bun add @0xsero/open-queue

Then add to your .opencode/opencode.jsonc:

{
  "plugin": ["@0xsero/open-queue"]
}

Optionally, copy the slash command to your project:

cp node_modules/@0xsero/open-queue/command/queue.md .opencode/command/

Usage

Slash Command

The easiest way to control the queue is with the /queue command:

/queue status     # Check current mode and queue size
/queue hold       # Start queueing messages
/queue immediate  # Send messages immediately (drains any queued)

Environment Variable

Set the initial mode via environment variable:

# Start in hold mode
OPENCODE_MESSAGE_QUEUE_MODE=hold opencode

# Start in immediate mode (default)
OPENCODE_MESSAGE_QUEUE_MODE=immediate opencode

Programmatic (via LLM)

The plugin exposes a queue tool that the LLM can invoke directly:

  • "Set queue mode to hold"
  • "Check queue status"
  • "Switch to immediate mode"

How It Works

Hold Mode

When in hold mode:

  • Incoming messages are intercepted by the chat.message hook
  • Message parts are converted and stored in a per-session queue
  • Text parts are marked as ignored to hide them from the current run
  • When the session becomes idle (session.status or session.idle events), queued messages are drained in order via client.session.prompt()

Immediate Mode

When in immediate mode:

  • Messages pass through without modification
  • Any existing queued messages are drained when switching from hold to immediate

API

Tool: queue

ActionDescription
statusReturns current mode, queue size, and session busy state
holdSets mode to hold (queue messages)
immediateSets mode to immediate and drains any queued messages

Events Handled

  • session.status - Tracks busy/idle state, drains queue when idle
  • session.idle - Alternative idle detection, drains queue

Hooks Used

  • chat.message - Intercepts messages in hold mode, queues them, marks text as ignored

Limitations

  • Best-effort queueing: OpenCode does not yet allow plugins to fully defer message creation. The plugin hides text content but non-text attachments may still be sent.
  • Global mode: The mode is global across all sessions. Per-session mode could be added if needed.
  • Plugin scope: Queued messages are lost if OpenCode restarts.

License

MIT

Keywords

opencode

FAQs

Package last updated on 28 Dec 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts