fix: persist Telegram pending messages to disk#48
Open
salemsayed wants to merge 2 commits intoTinyAGI:mainfrom
Open
fix: persist Telegram pending messages to disk#48salemsayed wants to merge 2 commits intoTinyAGI:mainfrom
salemsayed wants to merge 2 commits intoTinyAGI:mainfrom
Conversation
…arts The pendingMessages Map is in-memory only, so when the Telegram client restarts (e.g. due to 409 polling conflicts or tinyclaw restart), all pending message tracking is lost. Responses from the queue processor arrive in queue/outgoing/ but get silently deleted because the client can't match them to a chat — "No pending message for X, cleaning up". Persist the map to queue/pending-telegram.json on every mutation and restore it on startup, filtering out entries older than 10 minutes. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
lucianHymer
added a commit
to lucianHymer/borg
that referenced
this pull request
Feb 19, 2026
- Extract readRecentJsonl + mergeCorrectionsOntoDecisions into shared modules, eliminating cross-process code duplication (TinyAGI#47) - Fix fetch/SSE race in routing dashboard — await initial fetch before opening SSE connection (TinyAGI#48) - Capture firstSentId in status-edit-failure branch so routing decisions are no longer silently lost (TinyAGI#49) - Replace hardcoded ALLOWED_UPDATES with grammY API_CONSTANTS (TinyAGI#50) - Derive EMOJI_TO_MODEL and VALID_MODELS from MODEL_REACTIONS (TinyAGI#54)
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.
Summary
pendingMessagesMap intelegram-client.tsis in-memory only — any restart (409 polling conflict,tinyclaw restart, crash) wipes itqueue/outgoing/successfully, but the Telegram client can't match them to a chat and silently deletes them ("No pending message for X, cleaning up")queue/pending-telegram.jsonon every mutation, restore on startup (filtering entries >10min)Test plan
tinyclaw restartwhile Claude is processing, verify response is still delivered after restartqueue/pending-telegram.jsonis created after sending a message and cleaned up after response delivery🤖 Generated with Claude Code