24
近 30 天 +4
3,424
近 7 天 1.3k
57.4
生态多维模型
4 天前
2026-10-16
快速安装与配置
opencode.json写入当前项目的 opencode.json,只对这个仓库生效。
opencode.json
{
"$schema": "https://opencode.ai/config.json",
"plugin": ["opencode-queue@2.0.2"]
}写入 ~/.config/opencode/opencode.json,对所有项目生效。
~/.config/opencode/opencode.json
{
"$schema": "https://opencode.ai/config.json",
"plugin": ["opencode-queue@2.0.2"]
}若你要在本地改造这个插件,先装到项目里再从本地路径引用。
shell
pnpm add -D opencode-queueOpenCode 启动时会通过内嵌运行时自动加载 npm 依赖并缓存至本地目录,无需手动在全局环境执行安装。
A persistent queue for prompts, slash commands, shell commands, and fresh-session boundaries. Entries stay private until released and remember their agent, model, thinking variant, and files.
Requires OpenCode v2, 2.0.27 or newer. For OpenCode v1, use 1.x, tested against OpenCode 1.19.0.
Install
Add the package to your OpenCode configuration and restart:
{
"plugins": ["opencode-queue"]
}
OpenCode installs the latest package and loads its server and TUI entrypoints.
Commands
Enter these in OpenCode's normal input:
| Input | Behavior |
|---|---|
/queue text, /q text |
Queue an entry with the selected agent/model/variant and attachments. |
/queue, /queue:list |
Show waiting entries in OpenCode's built-in dialog. |
/queue:front text |
Insert before waiting entries. |
/queue:now text |
Steer immediately, changing settings at the next model checkpoint if needed. Shell entries wait for idle. |
/queue /review arguments |
Save a slash command and expand it when released. |
/queue /compact |
Compact with the saved agent/model/variant. |
/queue !command |
Run a shell command after the session becomes idle. |
/queue:carry, /queue:carry-front |
Transfer following entries into a fresh session at this boundary. |
/queue:clear, /queue:clear 2 4 |
Remove all waiting entries or selected numbered entries. |
/queue:stop, /queue:start |
Pause or resume replay. |
/queue:abort |
Cancel active work and pause replay, including a queued shell or pending model switch. |
/queue:flush |
Release waiting entries through the next carry boundary. |
/queue:apply_model |
Apply the selected model and variant to unsent entries, keeping their agents, files, and order. |
Replay
Replay releases one entry after a successful final response and an idle transition. Tool continuations, output limits, failed compactions, provider failures, and interruptions hold the queue. Resume with /queue:start or /queue:flush, or complete a new successful run.
/queue:now can switch the active model at the next checkpoint: a running tool finishes, then the plugin stops the old execution, switches settings, and continues in the same conversation. Flush groups matching agent/model/variant selections; each new group waits for the previous one to finish successfully.
Carry boundaries create an empty session in the current directory and transfer the remaining entries, files, and paused state. The TUI follows the new session. A failed transfer leaves the source intact. Flush stops at the boundary.
Slash commands resolve when released. If a command was removed, its original text becomes a prompt. Shell commands use $SHELL and show output as a plugin message, with a bounded preview and a full log. Failed or cancelled shell commands stay queued for an explicit retry.
Removed in v2
Trailing prompt /queue and prompt /q, automatic queueing of ordinary input, and the custom composer have been removed. Use /queue prompt in OpenCode's native input. Ordinary prompts follow OpenCode's own submission behavior.
The public v2 API lacks native composer access and a way to consume a submission before it enters the conversation. Related upstream requests:
- #51209: expose the native composer to plugins.
- #51392: text and paste interception for TUI plugins.
- #30434: cancellable message hooks, a historical v1 request closed as not planned.
Storage
Queues use opencode-queue/queues.json in OpenCode's user data directory. Stop OpenCode v1 before upgrading. The plugin migrates pending entries, attachments, agent/model/variant selections, and pause state, then saves the original files in opencode-queue/v1-backup. Migrated carry boundaries use the source session's current selection. Entries survive restarts and /move, including moves between projects. One server should own a data directory.
Writes are atomic. Replay reuses prompt message IDs; commands and shells can repeat if the server crashes between execution and recording completion.
Try in Docker
From this repository, open the latest stable OpenCode v2 with the plugin loaded:
pnpm start:docker
Existing provider credentials are copied on the first launch. Sessions stay in a separate Docker volume.
同类生态推荐
Queue
@edo1994/opencode-queue
Queue OpenCode prompts and slash commands until the agent is idle
Codex Usage
opencode-plugin-codex-usage
OpenCode TUI plugin that shows live Codex usage limits in the session sidebar.
Openai Codex Headers
opencode-openai-codex-headers
Stopgap opencode plugin that smooths the OpenAI/Codex GPT-5.6 rough edges (Luna 404s, missing session titles, reasoning-summary markers) until native support lands