fix(queue): harden busy-queue ordering and identity - #225
Conversation
|
@Marenz thanks for the follow-up work on #219 — the per-message identity idea is the right direction. Unfortunately the branch cannot be merged yet: it does not survive the first message in a real chat, and there are a few other issues. Blockers1. Verified manually against OpenCode Server 1.18.29. Three places generate the id with
So text, voice, albums and the whole queue path are broken. The test suite does not catch this because the SDK is mocked everywhere and nothing asserts the id format — please add a test that checks the id we actually send. 2. An album is silently dropped when there is no active session. currentSession?.id !== options.target.sessionId // undefined !== null → trueSteps: 3. A legitimate context-change refusal is invisible to the user. 4. The branch conflicts with Major5. The user is no longer told when a prompt fails to reach OpenCode. 6. "Remove from queue" is now a race. 7. The ordering middleware blocks every callback in the chat while an album is downloading. 8. 9. No minimum OpenCode Server version is documented or checked. Minor10. This is a product change, not only hardening. The bot stops owning the queue and pushes prompts to OpenCode immediately. That makes 11. Changes outside the stated scope. 12. Dead code. After the switch to 13. Unused parameter. 14. Session-wide cleanup undoes the per-message scoping. On |
Bind Telegram-origin suppression to message IDs instead of text so identical external input is never hidden. Expire missed-event entries on wall clock time and clear them across session and runtime teardown.
Track text and TTS delivery by session and parent message identity. A failed response can now retire only its own mode without stripping TTS from another queued response.
Defer later commands, callbacks, voice, audio, photos, documents, and albums behind earlier album batches. Capture the original project and session so a delayed album cannot land in a newly selected context.
Allow /settings only when no unrelated interaction owns input, while preserving the active settings flow. Update queue wording and documentation for durable OpenCode admission semantics.
Signed-off-by: Mathias L. Baumann <mathias.baumann@frequenz.com>
4f57e49 to
7b2bad2
Compare
|
Restored the bot-owned queue and fixed the applicable review points. Full checks pass. Tested against real OpenCode 1.18.29: plain UUIDs reproduce the 400; |
|
@Marenz thanks for the follow-up — this is a clear improvement over the previous revision. The There are still a few things I would fix before merging. Major
Minor
|
Follow-up to #219 that hardens the busy-queue against Telegram ordering and OpenCode delivery-identity races.