Repository navigation
fix(slack): allow group DMs to be opened from the message tool - #132928
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 30, 2026, 4:31 AM ET / 08:31 UTC. ClawSweeper reviewWhat this changesThe PR adds a Slack message-tool action that opens or reuses a direct or group conversation and returns a target for the existing send action. Merge readinessNo blocking correctness finding remains: the re-review commit makes the Slack schema available across configured channels. Keep this maintainer-owned, protected PR open for an explicit decision on the new default-enabled action and exact-head CI. Priority: P2 Review scores
Verification
How this fits togetherSlack’s message tool exposes configured channel actions to agent runs. This change sends recipient IDs through the Slack plugin to Slack’s conversation-opening API and returns a target that the existing send action consumes. flowchart LR
A[Agent message tool] --> B[Slack action discovery]
B --> C[Conversation-open action]
C --> D[Slack write identity]
D --> E[Slack conversation API]
E --> F[Returned conversation target]
F --> G[Existing send action]
Decision needed
Why: This adds a user-visible write capability rather than restoring an established message-tool contract, so product intent is needed even though the implementation follows existing boundaries. Before merge
Agent review detailsSecurityNone. PR surfaceSource +117, Tests +287, Docs +12. Total +416 across 15 files. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Accept the plugin-local Slack action only if a maintainer confirms the default-enabled capability and the exact head’s required checks pass. Do we have a high-confidence way to reproduce the issue? Not applicable as a bug reproduction: this is a new message-tool capability, and the supplied staging report demonstrates the intended positive and negative paths. Is this the best way to solve the issue? Unclear pending product acceptance: the plugin-local implementation is the cleanest technical shape, but maintainers must decide whether the default-enabled action belongs in the product. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 43d259069c83. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (3 earlier review cycles)
|
17caf90 to
22d34c8
Compare
Staging verification —
|
| Scenario | Result |
|---|---|
| Focused Slack extension tests | PASS — 116/116 |
| Exact-head CI | PASS — 191 checks passed, 43 skipped, none failing/pending |
| Open group DM with two human recipients | PASS — opened and sent marker |
| Reopen same recipients in reverse order | PASS — reused the same conversation |
| Open group DM containing another Slack app | PASS — opened and sent marker |
| Second Slack app opens/reuses the app group DM | PASS — opened and sent marker |
One-recipient conversation-open |
PASS — opened a normal DM and sent marker |
| Explicit workspace/team routing | PASS — reused the expected conversation |
| Empty recipient list | PASS — rejected locally; no message sent |
| Duplicate recipient IDs | PASS — rejected locally; no message sent |
| More than eight recipients | PASS — rejected locally; no message sent |
| Malformed recipient ID | PASS — rejected locally; no message sent |
| Calling app included in recipients | PASS — Slack normalized to the existing 1:1 DM |
| Existing group-DM inbound/reply behavior | PASS — both staging apps replied normally |
| Normal channel thread reply | PASS |
| Normal channel reaction | PASS |
Live test markers used the prefix GDM-E2E-20260830; every positive case was verified at the destination conversation, and every negative case explicitly confirmed that no target message was sent.
|
@clawsweeper re-review Addressed the cross-channel discovery finding in Focused Slack suite: 116/116 passed. Live staging behavior and negative-boundary proof are attached in #132928 (comment). |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Merged via squash.
|
…tool (#133199) * fix(slack): allow group DMs to be opened from the message tool Backport-Of: #132928 * chore(plugin-sdk): update API baseline --------- Co-authored-by: Sarah Fortune <[email protected]>
…law#132928) * fix(slack): allow group DMs to be opened from the message tool * test(slack): cover group DM action discovery * fix(slack): expose conversation opening cross-channel --------- Co-authored-by: Sarah Fortune <[email protected]>
…lures (#168738) ## What Problem This Solves Fixes Telegram final answers being replaced by a delivery warning after an ambiguous network failure, even though the completed answer is already saved. ## User Impact Telegram automatically re-delivers a saved ordinary text or rich-text final once, without running the model or completed tools again. A rare duplicate answer is possible when Telegram accepted the original send but its response was lost. Media, interactive or side-effect payloads, tool-initiated sends, known accepted chunks, identityless results, and untyped failures retain the existing no-blind-replay behavior. Other channels remain default-off. There is no new user setting or database schema. ## Why This Change Was Made **Maintainer decision:** reverse the automatic-resend exclusion in #155906 only for ordinary Telegram text finals, accepting the duplicate tradeoff. Preserve its accepted-content, partial-delivery, and visible-failure invariants. The proven-pre-connect recovery from #101024 remains unchanged. Telegram explicitly opts into the shared durable-delivery contract. The existing queue owns the saved prepared payload, exact send-attempt claim, two-attempt budget, backoff, recovery, and completion. The original caller waits for that recovery before reporting failure. Transcript-correlation metadata remains eligible without admitting controls; retries retain live authority checks and the last attempt's partial-delivery evidence. Transport diagnostics retain only bounded cause codes/syscalls, not request data. After exhaustion, the notice is `I couldn't deliver my reply because of a network problem. Please ask again.` when a typed network cause exists; otherwise it is `I couldn't deliver my reply. Please ask again.` Slack owner changes #151069 and #132928 do not overlap this diff. Follow-ups for Discord, Slack, and other channels must assess each transport's reconciliation and duplicate-prevention contract before opting in; this PR does not enable them. ## Evidence ### Real Telegram Test Server, live model All cases use the same isolated Gateway configuration: streaming off, rich messages enabled, a leased real-user observer, and a proxy that changes only the selected Bot API response. Each case records 90 seconds. Each candidate case made **one primary model request**; two auxiliary model requests and three embedding requests were tracked separately. No tools were requested or rerun. | Case | Userbot sent message | Observed replies | Result | | --- | --- | --- | --- | | Main before-forward drop | `83211845632` | `83212894208`: `I couldn't confirm the reply reached Telegram. Check OpenClaw chat history for the answer before retrying the task.` | No answer; only the old notice. | | Candidate before-forward drop | `83219185664` | `83220234240`: `SAVED_FINAL_repaired-before` | Saved answer automatically delivered; no failure notice. | | Candidate forward-then-drop | `83221282816` | `83222331392` and `83223379968`: both `SAVED_FINAL_repaired-duplicate` | First send was accepted upstream (HTTP 200, `ok:true`), then its response was lost; exactly one duplicate appeared, no third reply or notice. | | Candidate without fault | `83224428544` | `83225477120`: `SAVED_FINAL_repaired-plain` | One ordinary reply, no retry or notice. | The sent text in each row was `Reply with exactly <marker> and nothing else. Do not use tools.`, using the matching `SAVED_FINAL_<case>` marker. Baseline marker: `SAVED_FINAL_baseline-proof`. The before-forward proxy consumed the complete final-send request without forwarding it; the duplicate case forwarded it and discarded the accepted response. Baseline source: `f0a64d10805d2e7e21b4fa45235d8074a95e033d`. Candidate runtime: one immutable build of `2e2238f953bcd3c824e22384132d8e16c5977da3`, reused for all three cases. The final head adds a type-safe guard around transport diagnostic inspection, removes two invalid test-fixture variants, fixes a redundant type argument and a shadowed local name, and rebases onto green main; those changes do not alter the exercised reply path. No `dist/` copy or model stub was used. ### Regression and compatibility proof - The main-branch real final-delivery negative control fails because its caller settles before saved-text recovery. - **136 core/SQLite tests passed**, including waiting for recovery, two-attempt exhaustion, second-attempt partial acceptance, stale live authority during backoff/preparation, restart, and refusal cases. **31 existing Telegram lifecycle/HTTP tests passed.** - The final affected Telegram recovery and logging suites passed **9 tests across 2 files** (143.18 seconds including worker setup). They exercise matching transcript metadata, one model execution, saved-text retry, control refusal, and safe diagnostics. - **Stored-data compatibility:** existing storage/recovery fixtures without the new optional flags still load and retain their original behavior. Tests cover old-style unknown sends remaining non-replayable, exact same-millisecond claim fencing, ordinary stored options, and recovery after database reopen. No schema version changes or migrations are introduced. Only newly admitted Telegram finals gain explicit replay permission; the optional adapter classifier is absent for existing adapters. - Fresh independent adversarial review: **LAND**, no findings, on final head `a95b738575c6c10ee9922c25af2982d4548f20e4`. - Final exact-head hosted CI is running. The selected package/declaration boundary passed on the previous, behavior-identical head. Local package preparation timed out; hosted package validation is authoritative. Earlier TypeScript and lint failures were corrected; old-base SDK budget failures are no longer used as an exception after rebasing onto green main. ### Bounded cost The automatic policy is limited to **two total send attempts** for one saved ordinary final. It reuses existing backoff and persisted queue/claim fields; it adds no model/tool round trip, polling service, or schema. Refused payload classes do not gain a retry. The full owner/sibling run observed 136 core passes and 31 unchanged Telegram lifecycle passes; final affected suites took 143.18 seconds including worker setup. Hosted timing is available on the exact-head CI run. Simplification removed a redundant notice alias and unrelated success/suppression logging coverage. Remaining growth carries opt-in and typed ambiguity through the existing queue owner and protects the real transcript, restart, authority, and partial-delivery seams. Against the PR base: production **+454/-40**, tests **+449/-25**, docs **+19/-0**, across 31 files. Merge risk: reverting disables future automatic re-delivery, but cannot recall messages already delivered twice. The enabled user-facing blast radius is ordinary Telegram final text; shared queue claim changes retain exact attempt-ID/time fencing.
…lures (openclaw#168738) ## What Problem This Solves Fixes Telegram final answers being replaced by a delivery warning after an ambiguous network failure, even though the completed answer is already saved. ## User Impact Telegram automatically re-delivers a saved ordinary text or rich-text final once, without running the model or completed tools again. A rare duplicate answer is possible when Telegram accepted the original send but its response was lost. Media, interactive or side-effect payloads, tool-initiated sends, known accepted chunks, identityless results, and untyped failures retain the existing no-blind-replay behavior. Other channels remain default-off. There is no new user setting or database schema. ## Why This Change Was Made **Maintainer decision:** reverse the automatic-resend exclusion in openclaw#155906 only for ordinary Telegram text finals, accepting the duplicate tradeoff. Preserve its accepted-content, partial-delivery, and visible-failure invariants. The proven-pre-connect recovery from openclaw#101024 remains unchanged. Telegram explicitly opts into the shared durable-delivery contract. The existing queue owns the saved prepared payload, exact send-attempt claim, two-attempt budget, backoff, recovery, and completion. The original caller waits for that recovery before reporting failure. Transcript-correlation metadata remains eligible without admitting controls; retries retain live authority checks and the last attempt's partial-delivery evidence. Transport diagnostics retain only bounded cause codes/syscalls, not request data. After exhaustion, the notice is `I couldn't deliver my reply because of a network problem. Please ask again.` when a typed network cause exists; otherwise it is `I couldn't deliver my reply. Please ask again.` Slack owner changes openclaw#151069 and openclaw#132928 do not overlap this diff. Follow-ups for Discord, Slack, and other channels must assess each transport's reconciliation and duplicate-prevention contract before opting in; this PR does not enable them. ## Evidence ### Real Telegram Test Server, live model All cases use the same isolated Gateway configuration: streaming off, rich messages enabled, a leased real-user observer, and a proxy that changes only the selected Bot API response. Each case records 90 seconds. Each candidate case made **one primary model request**; two auxiliary model requests and three embedding requests were tracked separately. No tools were requested or rerun. | Case | Userbot sent message | Observed replies | Result | | --- | --- | --- | --- | | Main before-forward drop | `83211845632` | `83212894208`: `I couldn't confirm the reply reached Telegram. Check OpenClaw chat history for the answer before retrying the task.` | No answer; only the old notice. | | Candidate before-forward drop | `83219185664` | `83220234240`: `SAVED_FINAL_repaired-before` | Saved answer automatically delivered; no failure notice. | | Candidate forward-then-drop | `83221282816` | `83222331392` and `83223379968`: both `SAVED_FINAL_repaired-duplicate` | First send was accepted upstream (HTTP 200, `ok:true`), then its response was lost; exactly one duplicate appeared, no third reply or notice. | | Candidate without fault | `83224428544` | `83225477120`: `SAVED_FINAL_repaired-plain` | One ordinary reply, no retry or notice. | The sent text in each row was `Reply with exactly <marker> and nothing else. Do not use tools.`, using the matching `SAVED_FINAL_<case>` marker. Baseline marker: `SAVED_FINAL_baseline-proof`. The before-forward proxy consumed the complete final-send request without forwarding it; the duplicate case forwarded it and discarded the accepted response. Baseline source: `6df3d92c3994b1974cd7b342d163f41df4855950`. Candidate runtime: one immutable build of `2e2238f953bcd3c824e22384132d8e16c5977da3`, reused for all three cases. The final head adds a type-safe guard around transport diagnostic inspection, removes two invalid test-fixture variants, fixes a redundant type argument and a shadowed local name, and rebases onto green main; those changes do not alter the exercised reply path. No `dist/` copy or model stub was used. ### Regression and compatibility proof - The main-branch real final-delivery negative control fails because its caller settles before saved-text recovery. - **136 core/SQLite tests passed**, including waiting for recovery, two-attempt exhaustion, second-attempt partial acceptance, stale live authority during backoff/preparation, restart, and refusal cases. **31 existing Telegram lifecycle/HTTP tests passed.** - The final affected Telegram recovery and logging suites passed **9 tests across 2 files** (143.18 seconds including worker setup). They exercise matching transcript metadata, one model execution, saved-text retry, control refusal, and safe diagnostics. - **Stored-data compatibility:** existing storage/recovery fixtures without the new optional flags still load and retain their original behavior. Tests cover old-style unknown sends remaining non-replayable, exact same-millisecond claim fencing, ordinary stored options, and recovery after database reopen. No schema version changes or migrations are introduced. Only newly admitted Telegram finals gain explicit replay permission; the optional adapter classifier is absent for existing adapters. - Fresh independent adversarial review: **LAND**, no findings, on final head `a95b738575c6c10ee9922c25af2982d4548f20e4`. - Final exact-head hosted CI is running. The selected package/declaration boundary passed on the previous, behavior-identical head. Local package preparation timed out; hosted package validation is authoritative. Earlier TypeScript and lint failures were corrected; old-base SDK budget failures are no longer used as an exception after rebasing onto green main. ### Bounded cost The automatic policy is limited to **two total send attempts** for one saved ordinary final. It reuses existing backoff and persisted queue/claim fields; it adds no model/tool round trip, polling service, or schema. Refused payload classes do not gain a retry. The full owner/sibling run observed 136 core passes and 31 unchanged Telegram lifecycle passes; final affected suites took 143.18 seconds including worker setup. Hosted timing is available on the exact-head CI run. Simplification removed a redundant notice alias and unrelated success/suppression logging coverage. Remaining growth carries opt-in and typed ambiguity through the existing queue owner and protects the real transcript, restart, authority, and partial-delivery seams. Against the PR base: production **+454/-40**, tests **+449/-25**, docs **+19/-0**, across 31 files. Merge risk: reverting disables future automatic re-delivery, but cannot recall messages already delivered twice. The enabled user-facing blast radius is ordinary Telegram final text; shared queue claim changes retain exact attempt-ID/time fencing.
What Problem This Solves
Fixes an issue where users asking the Slack message tool to start a group DM could not create or reopen the conversation, even when their Slack app had the required permissions.
Why This Change Was Made
Expose a native
conversation-openaction for 1-8 explicitly supplied Slack member IDs. It uses the selected account's write identity and trusted or explicit workspace, and returns a canonical target for the existingsendaction. The existing messages action gate, read restrictions, and inbound policies remain unchanged.User Impact
Users can open or reuse a one-to-one or group DM, then send to its returned target. Invalid recipients, missing credentials or scopes, ambiguous Enterprise workspaces, and invalid Slack responses fail without reporting success or sending a message. A new conversation never inherits the source thread.
Evidence
145b071729596a7012c50156fc0b1a84dbad2856; all 570 focused routing, message-tool, Slack, and conversation-read security tests pass, including 25 new SDK-backed tests.Remaining validation limits (draft PR):
@a2ui/web_core/v0_9; full extension package-boundary preparation also lacks Matrix dependencies in this validation environment.