Repository navigation
feat: support asynchronous Telegram requests with status and cancellation - #36
Merged
Merged
Conversation
boly38
force-pushed
the
dev/issue-31-async-telegram-requests
branch
from
October 24, 2026 14:24
eaea717 to
70859e5
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #31
Overview
This PR turns long-running Telegram prompts into durable, trackable requests. Users receive an immediate request card, can monitor or control active work, and get the final answer separately. Request metadata supports safe recovery after a bridge restart without storing prompt or response text or blindly resubmitting work.
Telegram controls and commands
/status [reference]— inspect the active request or a previous request from this chat. For an active request, the result is added to its request card with a timestamp; status-check entries disappear after three minutes./cancel [reference]— cancel the active request or one identified by its reference. Submitted work is aborted through OpenCode, and the chat remains busy until the stop is confirmed./abort— stop the active request; alias for/cancel./allow [letter]— approve a pending permission once (the default)./allowAll <letter>— remember an eligible permission rule./deny [letter]— reject a pending permission.The active request card also provides Status and Abort buttons, plus explicit permission-decision buttons when needed. Permissions are never approved automatically.
Scope by commit
feat: support durable asynchronous Telegram requests (#31)Accept and acknowledge requests before background processing, assign each request a reference, prevent overlapping requests in one chat, and persist lifecycle/correlation metadata for deduplication and safe recovery. Prompts and responses are not stored in the request database.
feat: improve long-running Telegram request trackingMonitor OpenCode asynchronously, retry transient status/history timeouts, and show safe progress, elapsed time, observed usage, and tool summaries. The default request limit is five days; on timeout the bridge requests an abort and does not release the chat until OpenCode confirms it stopped.
feat: add Telegram permission controlsSurface pending permissions for the active request and its child sessions. Let the user make an explicit one-time, remembered-eligible, or reject decision through commands or request-card buttons.
feat: improve Telegram request card lifecycleKeep progress, controls, timestamped status checks, and permission requests on the original acknowledgement card. On completion, replace the active card with a summary and send the model's final answer separately.
feat: expire Telegram status checksRemove status-check entries from the request card three minutes after they were added. This affects only the requested status-check history, not the live progress shown while the request is running.
Validation
make test— 126 tests passed.python3 -m compileall -q bot/telegram/bloc_bridge— passed.git diff --check— passed.Benefits for users
Created by an LLM using the OpenCode harness and the GPT-6 Luna model.