Skip to content

fix(slack): allow group DMs to be opened from the message tool - #132928

Merged
sjf-oa merged 3 commits into
mainfrom
fix/slack-group-dm-open
Aug 30, 2026
Merged

sjf-oa merged 3 commits into
mainfrom
fix/slack-group-dm-open

Conversation

@sjf-oa

@sjf-oa sjf-oa commented Aug 30, 2026

Copy link
Copy Markdown
Contributor

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-open action 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 existing send action. 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

  • Before the fix, both SDK-backed group-DM flow regressions fail with action-not-supported. With the fix, the open-to-send flow succeeds for C- and G-prefixed group conversations.
  • Reapplied cleanly on upstream 145b071729596a7012c50156fc0b1a84dbad2856; all 570 focused routing, message-tool, Slack, and conversation-read security tests pass, including 25 new SDK-backed tests.
  • Core typecheck, scoped Slack production/test typecheck, changed-file lint, and formatting pass.
  • Required autoreview completed with its TruffleHog secret-scan gate and no P0 findings.

Remaining validation limits (draft PR):

  • The full local build is blocked by the unrelated missing Canvas dependency @a2ui/web_core/v0_9; full extension package-boundary preparation also lacks Matrix dependencies in this validation environment.
  • Live Slack verification remains outstanding: the running gateway does not include this unmerged plugin change, and no live group-DM test recipients were authorized. No live DM was created and no live message was sent.

@clawsweeper

clawsweeper Bot commented Aug 30, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation channel: slack Channel integration: slack size: M maintainer Maintainer-authored PR labels Aug 30, 2026
@clawsweeper clawsweeper Bot added merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Aug 30, 2026
@clawsweeper

clawsweeper Bot commented Aug 30, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 30, 2026, 4:31 AM ET / 08:31 UTC.

ClawSweeper review

What this changes

The 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 readiness

⚠️ Ready for maintainer review - 3 items remain

No 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
Reviewed head: 88b9b9faa6ee018288a917a7b798276685b6b5a8
Owner decision: Required. See Decision needed.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) The action is coherently integrated with focused and staging evidence; the final discovery-only commit awaits exact-head CI.
Proof confidence 🐚 platinum hermit (4/6) Not applicable: Repository State identifies the author as a MEMBER, so the external-contributor proof gate does not apply; independently, staging evidence reports real group-DM open/reuse, send, and no-send negative behavior at c6d778f.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: Repository State identifies the author as a MEMBER, so the external-contributor proof gate does not apply; independently, staging evidence reports real group-DM open/reuse, send, and no-send negative behavior at c6d778f.
Evidence reviewed 7 items Slack action owner: The new plugin-local owner validates 1–8 distinct Slack user IDs, calls the Slack client, validates the returned conversation ID, and produces the canonical target.
Existing gate and write identity: The action is admitted through the existing messages gate, resolves only a trusted or explicit workspace, and passes the existing write operation options to the Slack owner.
Cross-channel finding resolved: The new schema contribution is explicitly all-configured; the shared discovery path only blocks current-channel schema contributions, so the prior discovery blocker no longer applies.
Findings None None.
Security None None.

How this fits together

Slack’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]
Loading

Decision needed

Question Recommendation
Should OpenClaw expose Slack conversation opening by default through the existing messages action gate? Accept the action: Keep conversation opening behind the existing messages gate and Slack scope requirements after exact-head checks pass.

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

  • Resolve merge risk (P1) - The staging report covers the preceding commit; the current head additionally changes cross-channel discovery, so exact-head CI remains required before landing.
  • Complete next step (P2) - The protected maintainer label and the new default-enabled Slack action require explicit maintainer acceptance; no mechanical repair is identified.
Agent review details

Security

None.

PR surface

Source +117, Tests +287, Docs +12. Total +416 across 15 files.

View PR surface stats
Area Files Added Removed Net
Source 9 117 0 +117
Tests 5 287 0 +287
Docs 1 14 2 +12
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 15 418 2 +416

Review metrics

Metric Value Why it matters
Production vs test delta production +117, tests +287, docs +12 The production growth implements one new action and its routing contracts, with proportionate plugin-boundary coverage.

Merge-risk options

Maintainer options:

  1. Decide the mitigation before merge
    Accept the plugin-local Slack action only if a maintainer confirms the default-enabled capability and the exact head’s required checks pass.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Technical review

Best 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.

Labels

Label changes:

  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: Repository State identifies the author as a MEMBER, so the external-contributor proof gate does not apply; independently, staging evidence reports real group-DM open/reuse, send, and no-send negative behavior at c6d778f.
  • remove rating: 🦐 gold shrimp: Current PR rating is rating: 🐚 platinum hermit, so this older rating label is no longer current.
  • remove status: ⏳ waiting on author: Current PR status label is status: 👀 ready for maintainer look.

Label justifications:

  • P2: This is a bounded Slack workflow improvement without evidence of an urgent regression.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: Repository State identifies the author as a MEMBER, so the external-contributor proof gate does not apply; independently, staging evidence reports real group-DM open/reuse, send, and no-send negative behavior at c6d778f.

Evidence

What I checked:

  • Slack action owner: The new plugin-local owner validates 1–8 distinct Slack user IDs, calls the Slack client, validates the returned conversation ID, and produces the canonical target. (extensions/slack/src/conversation-open.ts:5, 88b9b9faa6ee)
  • Existing gate and write identity: The action is admitted through the existing messages gate, resolves only a trusted or explicit workspace, and passes the existing write operation options to the Slack owner. (extensions/slack/src/action-runtime.ts:636, 88b9b9faa6ee)
  • Cross-channel finding resolved: The new schema contribution is explicitly all-configured; the shared discovery path only blocks current-channel schema contributions, so the prior discovery blocker no longer applies. (extensions/slack/src/message-tool-api.ts:101, 88b9b9faa6ee)
  • Focused boundary coverage: The added tests exercise open-to-send routing, recipient rejection before Slack I/O, the messages gate, token selection, Enterprise workspace handling, and failed-open no-send behavior. (extensions/slack/src/conversation-open.test.ts:100, 88b9b9faa6ee)
  • Staging behavior evidence: The contributor’s staging report records group-DM open/reuse, sending destination markers, negative no-send cases, and unchanged inbound/reply behavior. It covers commit c6d778f; the current head subsequently changes discovery only. (c6d778fc7dc0)
  • Current-main and release check: The fetched current-main Slack discovery files contain no conversation-open match, and no release tag contains this PR head; the requested capability is therefore not already implemented or shipped. (extensions/slack/src/message-tool-api.ts, 43d259069c83)

Likely related people:

  • Peter Steinberger: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Let required checks complete for 88b9b9f.

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (3 earlier review cycles)
  • reviewed 2026-08-30T00:15:10.970Z sha 17caf90 :: needs maintainer review before merge. :: none
  • reviewed 2026-08-30T00:53:08.871Z sha 22d34c8 :: found issues before merge. :: [P2] Expose conversation opening to cross-channel discovery
  • reviewed 2026-08-30T01:10:17.643Z sha c6d778f :: found issues before merge. :: [P2] Expose conversation opening to cross-channel discovery

@sjf-oa
sjf-oa force-pushed the fix/slack-group-dm-open branch from 17caf90 to 22d34c8 Compare August 30, 2026 00:45
@sjf-oa
sjf-oa marked this pull request as ready for review August 30, 2026 00:46
@clawsweeper clawsweeper Bot added status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Aug 30, 2026
@clawsweeper clawsweeper Bot removed the merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. label Aug 30, 2026
@sjf-oa

sjf-oa commented Aug 30, 2026

Copy link
Copy Markdown
Contributor Author

Staging verification — c6d778fc7dc062a907e3c2a552b7c66ebe993c09

Verified on 2026-08-30 against the exact PR head deployed to staging.

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.

@sjf-oa

sjf-oa commented Aug 30, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

Addressed the cross-channel discovery finding in 88b9b9faa6e: the conversation-open schema contribution is now visibility: "all-configured", with a Slack discovery regression asserting that contract.

Focused Slack suite: 116/116 passed. Live staging behavior and negative-boundary proof are attached in #132928 (comment).

@clawsweeper

clawsweeper Bot commented Aug 30, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@clawsweeper clawsweeper Bot added rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Aug 30, 2026
@sjf-oa
sjf-oa merged commit a66dfa7 into main Aug 30, 2026
254 of 255 checks passed
@sjf-oa
sjf-oa deleted the fix/slack-group-dm-open branch August 30, 2026 08:39
@sjf-oa

sjf-oa commented Aug 30, 2026

Copy link
Copy Markdown
Contributor Author

Merged via squash.

sjf-oa added a commit that referenced this pull request Aug 30, 2026
…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]>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 31, 2026
…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]>
obviyus added a commit that referenced this pull request Oct 11, 2026
…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.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 11, 2026
…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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

channel: slack Channel integration: slack docs Improvements or additions to documentation maintainer Maintainer-authored PR P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: M status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants