feat(bot): add /session_delete command with two-stage confirmation flow#101
Open
georgernstgraf wants to merge 3 commits intogrinev:mainfrom
Open
feat(bot): add /session_delete command with two-stage confirmation flow#101georgernstgraf wants to merge 3 commits intogrinev:mainfrom
georgernstgraf wants to merge 3 commits intogrinev:mainfrom
Conversation
There was a problem hiding this comment.
Pull request overview
Adds a new Telegram bot command /session_delete to delete OpenCode sessions via an inline, two-step confirmation UI, with i18n strings added across supported locales.
Changes:
- Register new
/session_deletecommand and callback handler in the bot router. - Implement
src/bot/commands/session-delete.tswith paginated session list → details → confirm delete flow. - Add i18n keys for the new command and flow messages (en, de, es, fr, ru, zh).
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| src/bot/index.ts | Wires /session_delete command + callback dispatch logging/handling. |
| src/bot/commands/definitions.ts | Adds /session_delete to the bot command list for Telegram. |
| src/bot/commands/session-delete.ts | Implements the session deletion interaction flow (list/details/confirm + pagination). |
| src/i18n/en.ts | Adds English strings for the session delete flow. |
| src/i18n/de.ts | Adds German strings for the session delete flow. |
| src/i18n/es.ts | Adds Spanish strings for the session delete flow. |
| src/i18n/fr.ts | Adds French strings for the session delete flow. |
| src/i18n/ru.ts | Adds Russian strings for the session delete flow. |
| src/i18n/zh.ts | Adds Chinese strings for the session delete flow. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Contributor
Author
|
This is a simple implementation. I considered modifying the |
added 3 commits
April 25, 2026 15:44
grinev#81) - Add busy-guard to callback handler - Full session cleanup when deleting current session (detach, stop events, clear pinned) - Import from session/manager for consistency - Handle session.get error separately from not-found - Truncate session title for callback toast (200-char limit) - Answer callback query before deleting message in error paths
740cb6c to
73778a7
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 #81
What
Adds a
/session_deletecommand that lets users delete OpenCode sessions directly from Telegram.Flow
/session_delete→ paginated session list as inline keyboard[Delete][Cancel]opencodeClient.session.delete(), clears interactionIf the deleted session is the currently active one, the session state is reset and the user is prompted to use
/sessionsor/new.Implementation
/tasklistcommand pattern (two-stage custom interaction)/sessionscommand