Skip to content

feat(queue): steer busy-time messages into the running turn on OpenCode V1 - #306

Closed
atn18 wants to merge 1 commit into
grinev:mainfrom
atn18:feature/v1-steer
Closed

atn18 wants to merge 1 commit into
grinev:mainfrom
atn18:feature/v1-steer

Conversation

@atn18

@atn18 atn18 commented Nov 20, 2026

Copy link
Copy Markdown
Contributor

Problem

On OpenCode V1 the bot only held messages sent while the agent was busy in its own queue and sent them after the run. The V1 server's agent loop is message-driven: a user message stored while the loop runs is picked up at its next step, between tool calls, and the turn continues — this is how the OpenCode web UI behaves, but the bot never used it.

Change

  • Message queue on V1 is now Off / Queue / Steer. V1 keeps its own mode apart from the V2 one, and the released on/off boolean still works (a disagreement favours the boolean, which only an older build can have written).
  • Steer sends the busy-time prompt through the normal promptAsync start path; the running loop picks it up at the next step, between tool calls, and the turn continues. Nothing is held by the bot, so the message-count and queued-media limits do not apply.
  • Fallbacks stay safe. A prompt that finds no running turn on the server (the bot still finalizes the finished reply) goes to the bot's queue with both limits; prompts handed over at /detach still go first; a /detach during the prompt's preparation hands the prompt over to its session instead of steering it; a provider retry counts as a running turn; media without a reliable Telegram file_size is refused when it has to fall back to the queue.
  • V2 is unchanged, and the new queue row reads the same three modes on both versions.
  • Docs (README, PRODUCT, .env.example) and all 13 locales updated; tests cover the steer path, the queue fallback, the detach handover, retries, media limits and the settings migration.

Verification

  • npm run typecheck, npm run lint, npm test — clean, 3582 tests passed.
  • A live check against OpenCode 1.19.5: a prompt sent while a bash step was running was accepted and picked up by the next step of the same loop, with no new turn.

@grinev

grinev commented Nov 21, 2026

Copy link
Copy Markdown
Owner

@atn18 OpenCode V1 is deprecated now. No need for new features there, only fixes

@atn18 atn18 closed this Nov 21, 2026
@atn18
atn18 deleted the feature/v1-steer branch November 21, 2026 10:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants