Skip to content

Comments

fix: persist Telegram pending messages to disk#48

Open
salemsayed wants to merge 2 commits intoTinyAGI:mainfrom
salemsayed:fix/persist-pending-messages
Open

fix: persist Telegram pending messages to disk#48
salemsayed wants to merge 2 commits intoTinyAGI:mainfrom
salemsayed:fix/persist-pending-messages

Conversation

@salemsayed
Copy link
Contributor

Summary

  • pendingMessages Map in telegram-client.ts is in-memory only — any restart (409 polling conflict, tinyclaw restart, crash) wipes it
  • Queue processor writes responses to queue/outgoing/ successfully, but the Telegram client can't match them to a chat and silently deletes them ("No pending message for X, cleaning up")
  • Fix: persist the map to queue/pending-telegram.json on every mutation, restore on startup (filtering entries >10min)

Test plan

  • Send a message, run tinyclaw restart while Claude is processing, verify response is still delivered after restart
  • Verify queue/pending-telegram.json is created after sending a message and cleaned up after response delivery
  • Verify normal message flow (no restart) still works

🤖 Generated with Claude Code

salemsayed and others added 2 commits February 13, 2026 23:03
…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)
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.

1 participant