Repository navigation
Start and continue threads from Telegram, with approvals as chat buttons - #1728
Conversation
) Long-polls getUpdates from main, allowlisted senders only. Results, approvals (inline Allow/Deny) and ask_user questions go back to the chat. Bot token sealed at rest and redacted from the renderer. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
…include telegram (#1718) Save leaves enabled to Connect/Disconnect, since the section's props can be stale. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…bers (#1718) An allowed sender messaging the bot in a group would have had the agent's replies (code, diffs, maybe secrets) posted to every member. Messages and button presses from non-private chats are now ignored and logged once. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: be903ef695
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| // ponytail: grows by one per unanswered prompt; prune if that ever matters. | ||
| /** @type {Map<string, { chatId: string, threadId: string, requestId?: string, questionId?: string }>} */ | ||
| const buttons = new Map(); | ||
| let nextKey = 1; |
There was a problem hiding this comment.
Make button keys unique across application restarts
After an application restart, nextKey resets to 1 while previously sent Telegram keyboards remain usable. Once a new approval receives the same key in the same chat, pressing Allow on the old message approves the new request instead of reporting that the button expired. I reproduced an old ok:1 button approving a different request after recreating the channel manager. Use restart-unique identifiers (for example, random UUIDs) so stale buttons cannot authorize unrelated actions.
Useful? React with 👍 / 👎.
| if (channels && isNotifyTransition(prev, next)) { | ||
| channels.onThreadUpdate(payload.thread, next); |
There was a problem hiding this comment.
Deliver approvals added while a thread is already waiting
When a provider adds a second permission request while the first remains pending, this gate suppresses delivery because the notification state stays waiting. In electron/runner-permissions.js, the Codex permission handler appends each request and pushes thread detail, but only clears awaitingInput after all pending permissions are resolved. Consequently, an additional request arriving after the first Telegram delivery receives no buttons, and approving the visible request leaves the run blocked with no way to approve the remaining request from Telegram. Invoke the channel's deduplicated approval delivery on updates while waiting rather than only on notification-state transitions.
Useful? React with 👍 / 👎.
…in (#1751) * Package every electron/ .js including subdirectories (electron/channels/) package-app.sh and package-cross.sh copied electron/*.js only, so the electron/channels/ folder from #1728/#1740 never reached the bundle and every packaged build hung at boot on Electron's uncaught-error dialog (require ./channels/index.js). Found by verify-package's boot probe while cutting a nightly from e2f2fb3. Copy recursively, tests still excluded. Co-Authored-By: Claude Opus 5.5 <[email protected]> * Test: packaging copies every electron/ .js recursively in both scripts The old assertion pinned the top-level electron/*.js glob that dropped electron/channels/. Assert the recursive rsync (tests excluded) in package-app.sh and package-cross.sh instead. Co-Authored-By: Claude Opus 5.5 <[email protected]> --------- Co-authored-by: Willem <[email protected]> Co-authored-by: Claude Opus 5.5 <[email protected]>
Part of #1718 (Telegram first; Slack and Discord follow on the same
electron/channels/layer).What changes for users
/newstarts fresh;/statusshows the current thread.respondPermissionpath as the desktop approvals inbox. Single-choiceask_userquestions arrive as buttons; anything richer says "answer in Solenta".Security
channel. It can only reach chats that have already messaged the bot, and that client can already read thread output.Tested only against a fake Telegram Bot API. Smoke-test with a real bot:
Testing
electron/test/channels-telegram.test.js(fake Bot API), 14/14:/newtest/channelsSection.test.tsx3/3; typecheck clean. The worker reports the full electron and renderer suites andvite buildpassed before the private-chat fix (be903ef6), which touched onlyelectron/channels/*, its test and one line of settings copy.🤖 Generated with Claude Code