feat(bot): add /session_delete command with two-stage confirmation flow#101
feat(bot): add /session_delete command with two-stage confirmation flow#101georgernstgraf wants to merge 4 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.
|
This is a simple implementation. I considered modifying the |
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
|
I am still not sure if this should be merged. The An alternative would be: find out if its possible to add a trash icon to each listed session and thus give the user the possiblity to delete a session. But then the confirmation dialog would be challenging, or we would skip it in this case .. Good we have a maintainer to decide ;) worked with it a couple of days ... it's actually nice. |
|
I will look an this, but I have in plans another implementation, something like this: when you choose session you see buttions: switch, rename, delete, cancel. |
That might be the better idea. BUT: the session-change workflow will involve one user-tap extra. |
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