Repository navigation
Start and continue threads from Slack and Discord DMs, next to Telegram - #1740
Conversation
…am (#1718) - Chat channels: one transport per kind, routed by thread.channel.kind - Slack over Socket Mode (DMs only, Block Kit buttons, reconnect on a fresh URL) - Discord over the Gateway (DIRECT_MESSAGES intent, heartbeat + RESUME, DMs only) - Settings: Slack and Discord cards next to Telegram - stop() never waits on a WebSocket close event - Test fixture tokens are built from parts so secret scanners never see a token-shaped literal 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: 03fbe74166
ℹ️ 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".
| if (!res.ok) { | ||
| const err = new Error(`Discord ${label} failed (HTTP ${res.status})${json && json.message ? `: ${json.message}` : ""}`); | ||
| /** @type {any} */ (err).status = res.status; | ||
| throw err; |
There was a problem hiding this comment.
Retry rate-limited posts before abandoning message delivery
When a long answer or approval prompt exhausts the API's posting limit, HTTP 429 is treated as a terminal error, aborting the chunk loop and dropping all remaining chunks. The new Slack transport has the same behavior. Neither transport honors the retry delay documented by Discord or Slack. This can also leave an approval without its buttons when an earlier text chunk is rate-limited. The channel layer only logs the failure and has already marked the answer or prompt as delivered, so it will not retry. Queue posts and honor the server's retry delay before advancing to the next chunk.
Useful? React with 👍 / 👎.
| handlers = handlers | ||
| .then(() => (stopped ? undefined : dispatch(msg.t, msg.d || {}))) | ||
| .catch((err) => log(`discord: handler failed: ${err && err.message ? err.message : err}`)); |
There was a problem hiding this comment.
Acknowledge Discord interactions before queued message processing
If a preceding DM is still awaiting runner.startRun, every subsequent button interaction—even from another user's DM—waits behind it in this shared promise chain. Startup can await project setup in electron/runner.js, so this delay can easily exceed Discord's three-second initial-response deadline, after which the interaction token is invalidated. The approval may eventually execute, but Discord reports that the interaction failed and the confirmation cannot be delivered. Acknowledge or defer interactions promptly, independently of the message-processing queue, and deliver the result afterward.
Useful? React with 👍 / 👎.
…1741) ubuntu-latest started rolling to an image whose apparmor-profiles (5.0.2) no longer ships /usr/share/apparmor/extra-profiles/bwrap-userns-restrict, so the Codex sandbox-proof setup failed before any test ran (PR #1740). Use whichever bwrap profile the image has; if none, relax apparmor_restrict_unprivileged_userns for this job only (the codex probe still fails the job if the real sandbox cannot start). Co-authored-by: Willem <[email protected]> Co-authored-by: Claude Opus 5.5 <[email protected]>
…HTTP reply (#1742) Acks go over the socket and the reply over HTTP, so the fake server can see the reply first; main's ubuntu job after #1740 read acks too early. Co-authored-by: Willem <[email protected]> Co-authored-by: Claude Opus 5.5 <[email protected]>
…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]>
Closes #1718 (Telegram shipped in #1728).
What changes for users
Settings › Integrations gets Slack and Discord cards next to Telegram, with setup steps. As with Telegram:
/newand/statuswork.Slack (Socket Mode, no public URL)
connections:write) + bot token (chat:write,im:history).disconnectmessage, with capped backoff on errors.channel_type === "im"); channels, groups and multi-person DMs are ignored.block_actions.Discord (Gateway, no public URL)
DIRECT_MESSAGESintent only: a bot's own DMs carry content without the privilegedMESSAGE_CONTENTintent.resume_gateway_urlafter a drop, op 7 or a missed ACK; op 9 handled.guild_id). Bots are ignored.INTERACTION_CREATE.Channel layer
electron/channels/index.jsnow runs one transport per kind. Replies route bythread.channel.kind. Settings, state and status are per kind. Telegram is unchanged: its test file is untouched from main and passes 14/14 against the new layer. Slack and Discord share fakes inelectron/test/support/fakeChat.js.Security (same rules for all three)
secretGroups), never sent to the renderer (hasToken-style flags only), and stripped from the diagnostics bundle.The worker's 5 commits are squashed into one: Solenta's push secret scan flagged token-shaped fake fixtures. The new fixtures are built from parts, and the Telegram test is left untouched so its existing fixture isn't pulled into the diff.
Tested only against fake Slack / Discord servers. Worth one real smoke test per platform:
Testing
channels-slack,channels-discord(27) +channels-telegram(14, unchanged file): 41/41. They cover:channelsSectionUI tests 6/6; typecheck clean.vite buildgreen.🤖 Generated with Claude Code