Skip to content

fix(queue): support voice and media prompts - #219

Merged
grinev merged 2 commits into
grinev:mainfrom
Marenz:feat/queue-voice-and-media
Sep 4, 2026
Merged

fix(queue): support voice and media prompts#219
grinev merged 2 commits into
grinev:mainfrom
Marenz:feat/queue-voice-and-media

Conversation

@Marenz

@Marenz Marenz commented Aug 28, 2026

Copy link
Copy Markdown
Contributor
  • queue transcribed voice, photos, supported documents, and media groups while a run is active
  • retain at most 5 queued items and 20 MB of aggregate raw Telegram media bytes, measured from file_size before media preparation
  • preserve albums as one queue item and keep queue entries individually removable

npm run lint, npm run typecheck, npm run build, and npm test pass.

@grinev

grinev commented Aug 29, 2026

Copy link
Copy Markdown
Owner

@Marenz thanks for PR. Overal it looks good, but please fix 2 issues before merging:

  1. Major — queued media needs an explicit aggregate size limit.

MAX_QUEUED_PROMPTS = 5 limits only the number of queue items. It does not limit the amount of media kept in memory. A queued item
may contain several files from an album, and every file is stored as a base64 data: URI. Five albums can therefore retain hundreds
of megabytes or more and may terminate the Node.js process with an out-of-memory error.

Please add an aggregate limit for queued media. I recommend starting with 20 MB for all media currently held by the queue, not 20 MB
per queue item. The exact value may be adjusted, but it must be explicit and documented. The limit should be checked before
downloading/preparing files, and a full queue should reject the message before downloading it.

  1. Moderate — documentation must be updated in this PR.

README.md and PRODUCT.md still describe the message queue as supporting text messages only. This PR changes user-visible behavior
by adding voice messages, photos, documents, and media groups. Please update the documentation to describe the supported media types,
the queue limit, and the media-size restriction. This is required for the feature and should not be left as an optional follow-up.

@Marenz
Marenz force-pushed the feat/queue-voice-and-media branch from 6843bbd to 21eb0ed Compare September 4, 2026 09:00
Signed-off-by: Mathias L. Baumann <mathias.baumann@frequenz.com>
@Marenz
Marenz force-pushed the feat/queue-voice-and-media branch from 38d7ed4 to 0ed04b4 Compare September 4, 2026 14:10
Count raw Telegram file_size metadata across all queued media, rather than per item or expanded data-URI bytes. Reject full, unknown-size, or over-cap media before preparation and release accounting on dequeue, removal, and clear.

Signed-off-by: Mathias L. Baumann <mathias.baumann@frequenz.com>
@Marenz
Marenz force-pushed the feat/queue-voice-and-media branch from 0ed04b4 to fdeea35 Compare September 4, 2026 15:15
@Marenz

Marenz commented Sep 4, 2026

Copy link
Copy Markdown
Contributor Author

Rebased onto main; the 20 MiB aggregate cap is now enforced from Telegram file_size before any download or data-URI preparation — photos, documents including PDF/office, and albums (rejected as a whole). Unknown file_size is rejected rather than admitted. Accounting is released on dispatch/removal. README/PRODUCT updated.

Voice is unchanged: it's transcribed on arrival and the queue keeps only text, so no media bytes are retained.

Lint, typecheck, build and the full suite (1695 tests) pass.

@grinev
grinev merged commit 6ef5953 into grinev:main Sep 4, 2026
1 check passed
@grinev

grinev commented Sep 4, 2026

Copy link
Copy Markdown
Owner

@Marenz thanks for contribution!!

rubenperezrial added a commit to primigenum/opencode-telegram-bot that referenced this pull request Sep 10, 2026
* feat(i18n): add Korean locale (grinev#211)

Co-authored-by: ashcastle <ashcastle@users.noreply.github.com>

* fix(bot): retry transient Telegram server errors instead of dropping responses (grinev#196)

* fix(telegram): prevent duplicate messages after transient errors

* feat(bot): allow /opencode_stop during an active request

* feat(voice): show recognized text as a quote

* fix(logger): stop console writes after EPIPE to prevent crash loop (grinev#209)

Co-authored-by: Iago Durán Romera <iagorobo24-hub@users.noreply.github.com>

* chore: strict tsconfig (grinev#212)

* feat(telegram): raise stream edit interval on long runs to avoid 429

* chore(release): v0.24.1

* feat(docker): add containerized deployment (grinev#213)

Co-authored-by: Iago Durán Romera <iagorobo24-hub@users.noreply.github.com>

* feat(docker): add Desktop compose and in-container command warnings

* feat(OTB-63): switching to a session adopts the agent, model and variant it last ran with

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

* feat(OTB-62): picking a model opens the variant picker when the model offers a choice

* chore: gitignore updated

* feat(bot): accept incoming Telegram rich formatted messages

* feat(bot): accept incoming Telegram rich formatted messages

* feat(status): show bot version in /status

* chore: update e2e screenshots dir

* fix(subagent): stop replaying finished subagent runs in later messages

* feat: add PROJECTS_EXCLUDED_PATHS to hide unwanted projects from /projects (grinev#197)

Co-authored-by: Johell1NS <alessio.perilli@me.com>

* fix(OTB-59): diff file attachments open as readable UTF-8 text (grinev#221)

* chore(release): v0.25.0

* feat(OTB-69): add local json commands support

* feat(settings): add option to delete compact progress on finish (grinev#223)

* fix(queue): support voice and media prompts (grinev#219)

Signed-off-by: Mathias L. Baumann <mathias.baumann@frequenz.com>

* fix(queue): count rich photos and text files toward the 20 MiB media limit

* fix(OTB-54): restore settings from backup in installed mode

* fix(OTB-77): do not show command or prompt errors after detach

* feat(OTB-74): apply the agent's configured model and variant on pick

* feat(OTB-75): show the subagent variant on the Model line

* feat(OTB-78): show the variant beside the model on /status and the pinned dashboard

* chore(release): v0.25.1

* test: install the model-selection mock the merge dropped

The session/message command tests define getStoredModelMock but the
vi.mock registration for model-selection-service was lost while resolving
the sync conflicts. The tests then read the real getStoredModel, which is
environment-dependent (local .env vs CI defaults), so the keyboard model
assertions failed on CI while passing locally.

---------

Signed-off-by: Mathias L. Baumann <mathias.baumann@frequenz.com>
Co-authored-by: AshCastle <119788134+ashcastle@users.noreply.github.com>
Co-authored-by: ashcastle <ashcastle@users.noreply.github.com>
Co-authored-by: Haochen <38915833+hcsum@users.noreply.github.com>
Co-authored-by: Ruslan Grinev <grinevruslan@gmail.com>
Co-authored-by: Iago Durán Romera <iagorobo24@gmail.com>
Co-authored-by: Iago Durán Romera <iagorobo24-hub@users.noreply.github.com>
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
Co-authored-by: Johell1NS <78345296+Johell1NS@users.noreply.github.com>
Co-authored-by: Johell1NS <alessio.perilli@me.com>
Co-authored-by: Renan Rodrigo Vignato <renanvignato@gmail.com>
Co-authored-by: Mathias L. Baumann <Marenz@users.noreply.github.com>
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