Skip to content

fix: clean up Telegram approval buttons and status messages - #26

Open
MackDing wants to merge 2 commits into
cosmicstack-labs:mainfrom
MackDing:fix/telegram-cleanup-loop-ui
Open

fix: clean up Telegram approval buttons and status messages#26
MackDing wants to merge 2 commits into
cosmicstack-labs:mainfrom
MackDing:fix/telegram-cleanup-loop-ui

Conversation

@MackDing

Copy link
Copy Markdown

Problem

  • Telegram approval prompts (especially loop Continue / Stop) leave stale inline buttons in chat after a choice is made.
  • Telegram status messages such as Working... can remain tracked and visible longer than intended, which clutters the private chat UX.

Fix

  • Track approval prompt message IDs for permission, loop, and permission-mode prompts.
  • After a callback is handled, replace the prompt with a short result message and remove the inline keyboard.
  • Reuse a shared helper for sending approval prompts and cleaning them up.
  • Make status-message cleanup clear in-memory tracking immediately, and await cleanup before sending the final streamed response.

Test

  • Added src/channels/telegram.test.ts covering:
    • loop prompt cleanup after approval callback
    • status cleanup when no Telegram bot is active
  • Ran:
    • npm test
    • npm run typecheck

@MackDing

Copy link
Copy Markdown
Author

Quick follow-up: CI looks clean on my side and the fix is small/surgical. If you want any tweak before merge, I can update it quickly. Otherwise this should be ready to go. Thanks!

@MackDing

Copy link
Copy Markdown
Author

Quick follow-up: I merged the latest main into this branch, resolved the conflict in src/channels/telegram.ts, and verified locally with npm run typecheck. From my side this should now be ready for maintainer review.

@MackDing

Copy link
Copy Markdown
Author

Checking in on this PR. The branch is still open, but GitHub is showing an unstable or incomplete status.

Please let me know if you want changes from my side, or if this should be rerun/reviewed by maintainers.

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