opencode-queue 0.12.0 → 0.12.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/README.md +1 -1
  2. package/index.ts +3 -1
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -113,7 +113,7 @@ When the session is idle:
113
113
  /queue clear 2 3
114
114
  ```
115
115
 
116
- Queues are scoped to the current project and session. They are stored in OpenCode's user data directory and restored after OpenCode restarts or crashes. A send interrupted by a crash remains queued because the plugin cannot know whether OpenCode accepted it before exiting.
116
+ Queues are scoped to the current project and session. They are stored in OpenCode's user data directory and restored after OpenCode restarts or crashes. A send interrupted by a crash remains queued because the plugin cannot know whether OpenCode accepted it before exiting, so restored queues stay paused until explicitly started.
117
117
 
118
118
  ## Notes
119
119
 
package/index.ts CHANGED
@@ -215,7 +215,9 @@ export const QueuePlugin: Plugin = async ({ client, project, directory }) => {
215
215
  const validHidden = Array.isArray(value.hidden) && value.hidden.every((id) => typeof id === "string")
216
216
  if (!validHidden) console.warn("QueuePlugin skipped invalid stored hidden messages", sid)
217
217
  const hidden = new Set(validHidden ? (value.hidden as string[]) : [])
218
- if (items.length || value.stopped || hidden.size) sessions.set(sid, { items, activity: { kind: "idle" }, stopped: value.stopped, failed: false, hidden })
218
+ const stopped = value.stopped || items.length > 0
219
+ if (items.length && !value.stopped) console.warn("QueuePlugin paused restored queued input to prevent duplicate replay after a restart", sid)
220
+ if (items.length || stopped || hidden.size) sessions.set(sid, { items, activity: { kind: "idle" }, stopped, failed: false, hidden })
219
221
  }
220
222
  }
221
223
  } catch (error) {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/package.json",
3
3
  "name": "opencode-queue",
4
- "version": "0.12.0",
4
+ "version": "0.12.1",
5
5
  "type": "module",
6
6
  "description": "Queue OpenCode prompts and slash commands until the agent is idle",
7
7
  "main": "./index.ts",