Skip to content

fix(agents): keep top-level Slack requests' sessions_send completions top-level - #187065

Merged
obviyus merged 3 commits into
openclaw:mainfrom
wr-web:fix/slack-sessions-send-top-level-completion
Oct 29, 2026
Merged

obviyus merged 3 commits into
openclaw:mainfrom
wr-web:fix/slack-sessions-send-top-level-completion

Conversation

@wr-web

@wr-web wr-web commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

With Slack replyToMode: "off", a delayed sessions_send completion promotes the triggering top-level message timestamp into thread_ts, creating an unsolicited thread.

Keep sessions_send's existing admitted-current destination and thread precedence. Do not adopt the spawn route resolver: its fallback-first pairing can choose stale agentTo/agentThreadId instead of the admitted current route. Remove only Slack's off-mode synthetic reply anchor when it equals the current inbound message ID. Genuine threads and non-Slack routing retain the existing path. No SDK/config fields or authority rules change.

Evidence

Inspectable signed ingress, delayed completion chat.postMessage requests, SDK versions and threaded/admission controls.

Built main bf6bdd6c5fedb5e23f7bc206d26c625adbdec1ab and candidate 19a51e9d4de3d5b317edd67ca0b55d01c86481c2 runtime artifacts in secretless Node 24.22.1. The shipped Gateway loads its bundled Slack plugin and actual Slack Bolt 5.1.0 / Web API 8.2.0 SDKs against local Slack-compatible HTTP services. Signed Events API requests enter the real HTTP adapter. A deterministic local Chat Completions fixture exercises shipped Tool Search discovery/description and dispatches the real sessions_send; a real worker agent run is held until the requester acknowledges and another DM turn has replied on the same main session. The completion calls message without a destination or thread override.

  • Main twice: the SDK posts the delayed completion with thread_ts equal to the original top-level message timestamp.
  • Candidate twice: the SDK omits thread_ts; the result stays in the original conversation, not the later DM.
  • Genuine threaded requests retain the actual thread root on both refs, including after the later inbound turn.
  • All 23 conversation/admission tests pass. The existing current-source-over-stale-fallback regression remains passing: original-recipient/thread 42 wins over stale-recipient/thread 99 after inbound metadata changes. The top-level Slack case now exercises the actual reply flow, not factory-call spying, and fails on main. Numeric-thread coverage remains in the legacy-DM case. Test count delta: zero. Formatting passes.

This is native SDK API-placement proof against local services, not a real Slack workspace, UI screenshot or real-model claim. The captures distinguish the raw user-ID DM target from the API-resolved DM channel instead of treating those representations as different recipients.

Simplification: production +8/-1 lines (9 gross), no new helper or runtime import. The contributor's two factory-spy cases are removed in favor of the existing composed admission regression; the contributor commit is preserved. The Slack threading page documents the corrected completion placement.

Merge risk

Two-way door: no migration or persisted-state change; reverting restores the prior route capture. Blast radius is delayed sessions_send requester completion placement for off-mode top-level Slack messages. The admitted destination and genuine-thread precedence remain protected by the existing regression and transport controls.

Slack exposes the triggering top-level message ts as currentThreadTs (a reply anchor), and sessions_send captured it as the requester thread, so a delayed completion created a new thread under a top-level request even with replyToMode off. Resolve the requester route through resolveSpawnRequesterConversationTarget, which keeps the session's own destination paired with its own thread.

Fixes openclaw#186914
@clawsweeper

clawsweeper Bot commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added agents Agent runtime and tooling size: XS labels Oct 28, 2026
@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 message-delivery 🚨 May drop, duplicate, misroute, suppress, or wrongly target messages. proof: sufficient ClawSweeper judged the real behavior proof convincing. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. labels Oct 28, 2026
@clawsweeper

clawsweeper Bot commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This PR prevents delayed sessions_send completions from turning top-level Slack requests into threads when replyToMode is off.

Example: A top-level Slack request at timestamp 1793210000.000100 delegates work with replyToMode off.

  • Before: The delayed completion sends thread_ts=1793210000.000100 and creates an unsolicited thread.
  • After: The delayed completion omits thread_ts and stays top-level in the original conversation.

Review scores

Measure Result What it means
Overall readiness 🦞 diamond lobster (5/6) A focused repair with shipped-entry-point delivery traces, preserved routing controls, and no open code findings; exact-head CI remains pending.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (logs): The exact candidate’s shipped Gateway, bundled Slack plugin, and actual Slack SDK process signed ingress and delayed sessions_send completion against local Slack-compatible HTTP services; recorded API requests omit thread_ts for top-level requests, preserve genuine roots, and retain the original conversation after another DM turn. The model is deterministic, and the evidence claims API placement rather than live Slack UI behavior.
Patch quality 🦞 diamond lobster (5/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: A delayed delegated answer creates an unwanted Slack thread despite replyToMode off.
Reason: The repair restores documented placement with a narrow condition, preserves existing routing contracts, and addresses the official-release report.

Merge readiness

✅ Ready for maintainer review

This PR fixes a current Slack completion-placement bug and resolves the previous destination-precedence finding; no actionable defects remain in the reviewed diff, while exact-head CI is still pending.

Priority: P2
Reviewed head: 19a51e9d4de3d5b317edd67ca0b55d01c86481c2

Before merge

None.

Findings

None.

Agent review details

How this fits together

Slack supplies current-turn routing metadata to hosted conversation tools, which capture the requester destination for the delayed sessions_send reply flow and eventual Slack delivery.

flowchart LR
  A[Slack inbound message] --> B[Slack threading context]
  B --> C[Hosted conversation tools]
  C --> D[sessions_send worker]
  D --> E[Requester completion turn]
  E --> F[Slack SDK delivery]
Loading

Technical review

Best possible solution:

Keep the existing requester-route capture and omit only Slack’s synthetic off-mode reply anchor from the delayed completion thread.

Do we have a high-confidence way to reproduce the issue?

Current-main source shows the anchor-to-thread promotion, consistent with the official-release report and supplied paired Gateway/SDK captures; this read-only review ran no target code.

Is this the best way to solve the issue?

The condition is the smallest complete repair at the existing capture owner and preserves both admitted-current precedence and Slack’s intentional reply-anchor behavior.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against d821a7fd1dc8.

Provenance checked

  • Captured requester route and current-target precedence keeps the original intent (e157b56: Preserve the admitted requester destination and generation after later inbound messages; subsequently relocated by cf3702e without intended behavior changes.)
  • Slack standalone reply anchors keeps the original intent (fix(slack): preserve standalone reply anchors #102905: Keep standalone metadata accurate while retaining CurrentMessageId as a non-explicit message-tool anchor and honoring off mode.)
  • Admission regression consolidation keeps the original intent (1ff58ce: Reduce repeated fixtures while preserving distinct behavior checks; the new head extends the existing composition and retains numeric-thread and stale-fallback coverage.)

Testing

Proof path: shipped entry point.

Security

None.

Evidence

What I checked:

PR surface

Source +7, Tests +8, Docs +2. Total +17 across 3 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 1 8 1 +7
Tests 1 12 4 +8
Docs 1 2 0 +2
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 3 22 5 +17

Review metrics

Metric Value Why it matters
Production versus test LOC Production +8/-1; tests +12/-4 The focused condition reuses the existing owner and regression table without adding runtime machinery or test cases.

Labels

Label changes:

  • add rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.
  • remove rating: 🦪 silver shellfish: Current PR rating is rating: 🦞 diamond lobster, so this older rating label is no longer current.
  • remove merge-risk: 🚨 message-delivery: Current PR review selected no merge-risk labels.
  • remove status: ⏳ waiting on author: Current PR status label is status: 👀 ready for maintainer look.
  • remove proof: 📸 screenshot: Current real behavior proof evidence kind is logs.

Label justifications:

  • P2: Delayed Slack answers appear in an unsolicited thread, but delivery succeeds and the affected workflow has a bounded blast radius.
  • rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.
  • proof: sufficient: Contributor real behavior proof is sufficient.

Rating scale

6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

History

Review history (1 earlier review cycle)
  • reviewed 2026-10-28T23:12:43.604Z sha 08c504e :: needs changes before merge. :: [P1] Preserve the admitted current destination for sessions_send

Reviewed October 28, 2026, 8:29 PM ET / October 29, 2026, 00:29 UTC (Revision 2).

@obviyus

obviyus commented Oct 29, 2026

Copy link
Copy Markdown
Collaborator

Observed Slack SDK delivery captures

Main bf6bdd6c5fedb5e23f7bc206d26c625adbdec1ab; candidate 19a51e9d4de3d5b317edd67ca0b55d01c86481c2. Built Gateway artifacts in secretless Node 24.22.1, bundled Slack plugin, actual Slack Bolt/Web API SDKs against local Slack-compatible HTTP services. Signed Events API requests enter the shipped Gateway HTTP adapter. The model is a deterministic local Chat Completions fixture, not a hosted or real-model claim. This is API request placement proof, not a real Slack workspace/client screenshot.

The model discovers and describes sessions_send through shipped Tool Search, then dispatches it with timeoutSeconds=0. The real worker agent request is held until the requester has acknowledged and a later inbound message from another DM has also been processed on the same main session. After release, the requester completion uses message(action=send, message=FINAL...) with no target, threadId, replyTo or topLevel override. The oracle is the thread_ts actually submitted by the real Slack SDK.

Identifiers and endpoint/state paths are redacted consistently. <request-ts> is the top-level request timestamp (or the child message timestamp in the thread control), and <thread-root> is a distinct genuine root. Slack chat.postMessage accepts a user ID as a DM target; the local API resolves <original-user> to <original-DM>, just as conversations.open does. Both the raw posted target and API-resolved conversation are shown, never silently equated.

base-top-1

{
  "sdkUserAgents": [
    "@slack:socket-mode/3.1.0 @slack:bolt/5.1.0 @slack:web-api/8.2.0 openclaw-gateway/24.22.1"
  ],
  "signedIngress": {
    "status": 200,
    "channel": "<original-DM>",
    "messageTs": "<request-ts>"
  },
  "laterModelRetainsOriginalUserRequest": true,
  "events": [
    {
      "event": "signed-ingress",
      "msSinceIngress": 0,
      "httpStatus": 200,
      "target": "<original-DM>"
    },
    {
      "event": "worker-model-held",
      "msSinceIngress": 2005
    },
    {
      "event": "initial-ack-observed",
      "msSinceIngress": 2131
    },
    {
      "event": "signed-ingress",
      "msSinceIngress": 2136,
      "httpStatus": 200,
      "target": "<later-DM>"
    },
    {
      "event": "later-inbound-ack-observed",
      "msSinceIngress": 2383
    },
    {
      "event": "worker-model-released",
      "msSinceIngress": 2383
    }
  ],
  "slackApiRequests": [
    {
      "method": "chat.postMessage",
      "msSinceIngress": 1774,
      "apiRequest": {
        "channel": "<original-DM>",
        "text": "ACK187065-TOP-1"
      },
      "apiResponseChannel": "<original-DM>"
    },
    {
      "method": "chat.postMessage",
      "msSinceIngress": 2298,
      "apiRequest": {
        "channel": "<later-DM>",
        "text": "LATER_ACK187065-TOP-1"
      },
      "apiResponseChannel": "<later-DM>"
    },
    {
      "method": "chat.postMessage",
      "msSinceIngress": 2655,
      "apiRequest": {
        "channel": "<original-DM>",
        "text": "FINAL187065-TOP-1",
        "thread_ts": "<request-ts>"
      },
      "apiResponseChannel": "<original-DM>"
    }
  ],
  "finalThreadFieldPresent": true,
  "finalResolvedConversation": "<original-DM>",
  "workerReleasedAfterLaterAck": true,
  "gatewayExit": {
    "code": 0,
    "signal": null
  }
}

base-top-2

{
  "sdkUserAgents": [
    "@slack:socket-mode/3.1.0 @slack:bolt/5.1.0 @slack:web-api/8.2.0 openclaw-gateway/24.22.1"
  ],
  "signedIngress": {
    "status": 200,
    "channel": "<original-DM>",
    "messageTs": "<request-ts>"
  },
  "laterModelRetainsOriginalUserRequest": true,
  "events": [
    {
      "event": "signed-ingress",
      "msSinceIngress": 0,
      "httpStatus": 200,
      "target": "<original-DM>"
    },
    {
      "event": "worker-model-held",
      "msSinceIngress": 1989
    },
    {
      "event": "initial-ack-observed",
      "msSinceIngress": 2196
    },
    {
      "event": "signed-ingress",
      "msSinceIngress": 2202,
      "httpStatus": 200,
      "target": "<later-DM>"
    },
    {
      "event": "later-inbound-ack-observed",
      "msSinceIngress": 2560
    },
    {
      "event": "worker-model-released",
      "msSinceIngress": 2560
    }
  ],
  "slackApiRequests": [
    {
      "method": "chat.postMessage",
      "msSinceIngress": 1751,
      "apiRequest": {
        "channel": "<original-DM>",
        "text": "ACK187065-TOP-2"
      },
      "apiResponseChannel": "<original-DM>"
    },
    {
      "method": "chat.postMessage",
      "msSinceIngress": 2378,
      "apiRequest": {
        "channel": "<later-DM>",
        "text": "LATER_ACK187065-TOP-2"
      },
      "apiResponseChannel": "<later-DM>"
    },
    {
      "method": "chat.postMessage",
      "msSinceIngress": 2797,
      "apiRequest": {
        "channel": "<original-DM>",
        "text": "FINAL187065-TOP-2",
        "thread_ts": "<request-ts>"
      },
      "apiResponseChannel": "<original-DM>"
    }
  ],
  "finalThreadFieldPresent": true,
  "finalResolvedConversation": "<original-DM>",
  "workerReleasedAfterLaterAck": true,
  "gatewayExit": {
    "code": 0,
    "signal": null
  }
}

candidate-top-1

{
  "sdkUserAgents": [
    "@slack:socket-mode/3.1.0 @slack:bolt/5.1.0 @slack:web-api/8.2.0 openclaw-gateway/24.22.1"
  ],
  "signedIngress": {
    "status": 200,
    "channel": "<original-DM>",
    "messageTs": "<request-ts>"
  },
  "laterModelRetainsOriginalUserRequest": true,
  "events": [
    {
      "event": "signed-ingress",
      "msSinceIngress": 0,
      "httpStatus": 200,
      "target": "<original-DM>"
    },
    {
      "event": "worker-model-held",
      "msSinceIngress": 1994
    },
    {
      "event": "initial-ack-observed",
      "msSinceIngress": 2214
    },
    {
      "event": "signed-ingress",
      "msSinceIngress": 2222,
      "httpStatus": 200,
      "target": "<later-DM>"
    },
    {
      "event": "later-inbound-ack-observed",
      "msSinceIngress": 2620
    },
    {
      "event": "worker-model-released",
      "msSinceIngress": 2620
    }
  ],
  "slackApiRequests": [
    {
      "method": "chat.postMessage",
      "msSinceIngress": 1761,
      "apiRequest": {
        "channel": "<original-DM>",
        "text": "ACK187065-TOP-1"
      },
      "apiResponseChannel": "<original-DM>"
    },
    {
      "method": "chat.postMessage",
      "msSinceIngress": 2413,
      "apiRequest": {
        "channel": "<later-DM>",
        "text": "LATER_ACK187065-TOP-1"
      },
      "apiResponseChannel": "<later-DM>"
    },
    {
      "method": "chat.postMessage",
      "msSinceIngress": 2888,
      "apiRequest": {
        "channel": "<original-user>",
        "text": "FINAL187065-TOP-1"
      },
      "apiResponseChannel": "<original-DM>"
    }
  ],
  "finalThreadFieldPresent": false,
  "finalResolvedConversation": "<original-DM>",
  "workerReleasedAfterLaterAck": true,
  "gatewayExit": {
    "code": 0,
    "signal": null
  }
}

candidate-top-2

{
  "sdkUserAgents": [
    "@slack:socket-mode/3.1.0 @slack:bolt/5.1.0 @slack:web-api/8.2.0 openclaw-gateway/24.22.1"
  ],
  "signedIngress": {
    "status": 200,
    "channel": "<original-DM>",
    "messageTs": "<request-ts>"
  },
  "laterModelRetainsOriginalUserRequest": true,
  "events": [
    {
      "event": "signed-ingress",
      "msSinceIngress": 0,
      "httpStatus": 200,
      "target": "<original-DM>"
    },
    {
      "event": "worker-model-held",
      "msSinceIngress": 2011
    },
    {
      "event": "initial-ack-observed",
      "msSinceIngress": 2168
    },
    {
      "event": "signed-ingress",
      "msSinceIngress": 2175,
      "httpStatus": 200,
      "target": "<later-DM>"
    },
    {
      "event": "later-inbound-ack-observed",
      "msSinceIngress": 2543
    },
    {
      "event": "worker-model-released",
      "msSinceIngress": 2544
    }
  ],
  "slackApiRequests": [
    {
      "method": "chat.postMessage",
      "msSinceIngress": 1770,
      "apiRequest": {
        "channel": "<original-DM>",
        "text": "ACK187065-TOP-2"
      },
      "apiResponseChannel": "<original-DM>"
    },
    {
      "method": "chat.postMessage",
      "msSinceIngress": 2351,
      "apiRequest": {
        "channel": "<later-DM>",
        "text": "LATER_ACK187065-TOP-2"
      },
      "apiResponseChannel": "<later-DM>"
    },
    {
      "method": "chat.postMessage",
      "msSinceIngress": 2778,
      "apiRequest": {
        "channel": "<original-user>",
        "text": "FINAL187065-TOP-2"
      },
      "apiResponseChannel": "<original-DM>"
    }
  ],
  "finalThreadFieldPresent": false,
  "finalResolvedConversation": "<original-DM>",
  "workerReleasedAfterLaterAck": true,
  "gatewayExit": {
    "code": 0,
    "signal": null
  }
}

base-thread-1

{
  "sdkUserAgents": [
    "@slack:socket-mode/3.1.0 @slack:bolt/5.1.0 @slack:web-api/8.2.0 openclaw-gateway/24.22.1"
  ],
  "signedIngress": {
    "status": 200,
    "channel": "<original-DM>",
    "messageTs": "<request-ts>",
    "thread_ts": "<thread-root>"
  },
  "laterModelRetainsOriginalUserRequest": true,
  "events": [
    {
      "event": "signed-ingress",
      "msSinceIngress": 0,
      "httpStatus": 200,
      "target": "<original-DM>"
    },
    {
      "event": "worker-model-held",
      "msSinceIngress": 2022
    },
    {
      "event": "initial-ack-observed",
      "msSinceIngress": 2162
    },
    {
      "event": "signed-ingress",
      "msSinceIngress": 2168,
      "httpStatus": 200,
      "target": "<later-DM>"
    },
    {
      "event": "later-inbound-ack-observed",
      "msSinceIngress": 2512
    },
    {
      "event": "worker-model-released",
      "msSinceIngress": 2512
    }
  ],
  "slackApiRequests": [
    {
      "method": "chat.postMessage",
      "msSinceIngress": 1787,
      "apiRequest": {
        "channel": "<original-DM>",
        "text": "ACK187065-THREAD-1",
        "thread_ts": "<thread-root>"
      },
      "apiResponseChannel": "<original-DM>"
    },
    {
      "method": "chat.postMessage",
      "msSinceIngress": 2343,
      "apiRequest": {
        "channel": "<later-DM>",
        "text": "LATER_ACK187065-THREAD-1"
      },
      "apiResponseChannel": "<later-DM>"
    },
    {
      "method": "chat.postMessage",
      "msSinceIngress": 2763,
      "apiRequest": {
        "channel": "<original-DM>",
        "text": "FINAL187065-THREAD-1",
        "thread_ts": "<thread-root>"
      },
      "apiResponseChannel": "<original-DM>"
    }
  ],
  "finalThreadFieldPresent": true,
  "finalResolvedConversation": "<original-DM>",
  "workerReleasedAfterLaterAck": true,
  "gatewayExit": {
    "code": 0,
    "signal": null
  }
}

candidate-thread-1

{
  "sdkUserAgents": [
    "@slack:socket-mode/3.1.0 @slack:bolt/5.1.0 @slack:web-api/8.2.0 openclaw-gateway/24.22.1"
  ],
  "signedIngress": {
    "status": 200,
    "channel": "<original-DM>",
    "messageTs": "<request-ts>",
    "thread_ts": "<thread-root>"
  },
  "laterModelRetainsOriginalUserRequest": true,
  "events": [
    {
      "event": "signed-ingress",
      "msSinceIngress": 0,
      "httpStatus": 200,
      "target": "<original-DM>"
    },
    {
      "event": "worker-model-held",
      "msSinceIngress": 2050
    },
    {
      "event": "initial-ack-observed",
      "msSinceIngress": 2127
    },
    {
      "event": "signed-ingress",
      "msSinceIngress": 2132,
      "httpStatus": 200,
      "target": "<later-DM>"
    },
    {
      "event": "later-inbound-ack-observed",
      "msSinceIngress": 2454
    },
    {
      "event": "worker-model-released",
      "msSinceIngress": 2455
    }
  ],
  "slackApiRequests": [
    {
      "method": "chat.postMessage",
      "msSinceIngress": 1789,
      "apiRequest": {
        "channel": "<original-DM>",
        "text": "ACK187065-THREAD-1",
        "thread_ts": "<thread-root>"
      },
      "apiResponseChannel": "<original-DM>"
    },
    {
      "method": "chat.postMessage",
      "msSinceIngress": 2324,
      "apiRequest": {
        "channel": "<later-DM>",
        "text": "LATER_ACK187065-THREAD-1"
      },
      "apiResponseChannel": "<later-DM>"
    },
    {
      "method": "chat.postMessage",
      "msSinceIngress": 2695,
      "apiRequest": {
        "channel": "<original-DM>",
        "text": "FINAL187065-THREAD-1",
        "thread_ts": "<thread-root>"
      },
      "apiResponseChannel": "<original-DM>"
    }
  ],
  "finalThreadFieldPresent": true,
  "finalResolvedConversation": "<original-DM>",
  "workerReleasedAfterLaterAck": true,
  "gatewayExit": {
    "code": 0,
    "signal": null
  }
}

Focused production-composition checks: 23 tests pass across conversation tools and sessions_send admission. The existing admitted-current-over-stale-fallback case still passes unchanged (original-recipient/thread 42 wins over stale-recipient/thread 99 after later inbound metadata changes). The new top-level Slack route case uses the actual reply flow rather than spying on factory arguments; it fails on main (1 failed, 17 skipped). Numeric-thread coverage remains in the legacy-DM case. Test count delta zero. Formatting passes.

The repair retains sessions_send current-target/current-thread precedence, and removes only an off-mode Slack reply anchor equal to the current message ID. It does not reuse the spawn route resolver or change public SDK/config fields. Producer source SHA-256 a4f4b7e1410693d48be7d83d34b31bd1300ecdaaa8fb7641ad9bec8a37e8cbef matches the final worktree and built candidate container.

@obviyus

obviyus commented Oct 29, 2026

Copy link
Copy Markdown
Collaborator

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation channel: slack Channel integration: slack labels Oct 29, 2026
@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. merge-risk: 🚨 message-delivery 🚨 May drop, duplicate, misroute, suppress, or wrongly target messages. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Oct 29, 2026
@wr-web

wr-web commented Oct 29, 2026

Copy link
Copy Markdown
Contributor Author

Thanks @obviyus. I reran the live Slack rig (real Gateway, Slack HTTP mode with signed Events API, Web API stand-in via SLACK_API_URL) on your head 19a51e9:

live run on 19a51e9

request main 3d96ad7 head 19a51e9
top-level, replyToMode: "off" R12_PENDING top-level, then R12_COMPLETE with thread_ts set to the request's own ts, which creates a new thread R12_PENDING and R12_COMPLETE both top-level (thread_ts: null)
inside the existing thread 1793209000.000050 not run on main R12_PENDING (stream) and R12_COMPLETE both in 1793209000.000050

I dropped my local follow-up because yours supersedes it.

@obviyus

obviyus commented Oct 29, 2026

Copy link
Copy Markdown
Collaborator

Maintainer override:

Both red jobs reproduce identically on frozen main, and all four failing files are byte-identical between main and this head:

  • check-lint-core-2 (run 40793760707, job 123186578419): the max-lines rule flags session-manager.ts at 705 lines and session-manager-core.ts at 701, over the 700 limit.
  • checks-fast-baseline-ratchets (run 40793760707, job 123185742835): the same 14 mock-export violations in src/gateway/server-shutdown.runtime.test.ts and server.spawn-broker.test.ts that unrelated PR runs show (for example run 40791394819, job 123177885661).
    This PR only changes Slack delivery threading. The exact-head review is 5/6 with no findings. Evidence: fix(agents): keep top-level Slack requests' sessions_send completions top-level #187065 (comment)

@obviyus
obviyus merged commit cb5a438 into openclaw:main Oct 29, 2026
137 of 142 checks passed
@obviyus

obviyus commented Oct 29, 2026

Copy link
Copy Markdown
Collaborator

Landed in cb5a438. Thanks @wr-web. Delayed Slack completions for top-level requests now post at the top level.

github-actions Bot pushed a commit to kickb1049kickb10492660/openclaw that referenced this pull request Oct 29, 2026
… top-level (#187065)

fix(slack): don't thread a delayed sessions_send completion under a top-level request

When a sessions_send completion arrived later for a request that was made at the top level of a Slack channel, delivery used the request's own timestamp as thread_ts, so the reply opened a new thread instead of posting at the top level. A top-level request's completion is now posted without thread_ts. Requests made inside a thread keep their thread root, and the existing admitted-current routing precedence is unchanged.

Evidence: built Gateway with the bundled Slack plugin and real Slack SDKs against local Slack-compatible services. On main the delayed completion was posted with the top-level request timestamp as thread_ts (twice); with this change it was posted at the top level (twice). Real-thread controls keep the thread root on both refs, and completions for later DM turns stay in the original conversation. Details: openclaw/openclaw#187065 (comment).

Thanks @wr-web.

Co-authored-by: Ayaan Zaidi <[email protected]>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 29, 2026
… top-level (openclaw#187065)

fix(slack): don't thread a delayed sessions_send completion under a top-level request

When a sessions_send completion arrived later for a request that was made at the top level of a Slack channel, delivery used the request's own timestamp as thread_ts, so the reply opened a new thread instead of posting at the top level. A top-level request's completion is now posted without thread_ts. Requests made inside a thread keep their thread root, and the existing admitted-current routing precedence is unchanged.

Evidence: built Gateway with the bundled Slack plugin and real Slack SDKs against local Slack-compatible services. On main the delayed completion was posted with the top-level request timestamp as thread_ts (twice); with this change it was posted at the top level (twice). Real-thread controls keep the thread root on both refs, and completions for later DM turns stay in the original conversation. Details: openclaw#187065 (comment).

Thanks @wr-web.

Co-authored-by: Ayaan Zaidi <[email protected]>
obviyus added a commit that referenced this pull request Oct 30, 2026
… request (#187965)

fix(slack): post visible spawn completions at the top level for top-level requests

A visible spawn started from a top-level Slack message posted its completion as a thread reply under that message, instead of at the top level where the request was. The completion now uses the same rule delayed sessions_send completions use since #187065 (moved into a shared helper): a top-level request's completion is posted at the top level, and requests made inside a thread keep their thread.

Evidence: built Gateway with the bundled Slack plugin against a signed HTTP fixture. On main the top-level visible-spawn completion was threaded (twice); with this change it was posted at the top level (twice). Genuine-thread requests stay threaded, and delayed sessions_send completions stay top level with the original recipient after later inbound activity. Details: #187965 (comment).

Thanks @masatohoshino.

Co-authored-by: Ayaan Zaidi <[email protected]>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 30, 2026
… request (openclaw#187965)

fix(slack): post visible spawn completions at the top level for top-level requests

A visible spawn started from a top-level Slack message posted its completion as a thread reply under that message, instead of at the top level where the request was. The completion now uses the same rule delayed sessions_send completions use since openclaw#187065 (moved into a shared helper): a top-level request's completion is posted at the top level, and requests made inside a thread keep their thread.

Evidence: built Gateway with the bundled Slack plugin against a signed HTTP fixture. On main the top-level visible-spawn completion was threaded (twice); with this change it was posted at the top level (twice). Genuine-thread requests stay threaded, and delayed sessions_send completions stay top level with the original recipient after later inbound activity. Details: openclaw#187965 (comment).

Thanks @masatohoshino.

Co-authored-by: Ayaan Zaidi <[email protected]>
github-actions Bot pushed a commit to clawhaven/openclaw that referenced this pull request Nov 23, 2026
… request (openclaw#187965)

fix(slack): post visible spawn completions at the top level for top-level requests

A visible spawn started from a top-level Slack message posted its completion as a thread reply under that message, instead of at the top level where the request was. The completion now uses the same rule delayed sessions_send completions use since openclaw#187065 (moved into a shared helper): a top-level request's completion is posted at the top level, and requests made inside a thread keep their thread.

Evidence: built Gateway with the bundled Slack plugin against a signed HTTP fixture. On main the top-level visible-spawn completion was threaded (twice); with this change it was posted at the top level (twice). Genuine-thread requests stay threaded, and delayed sessions_send completions stay top level with the original recipient after later inbound activity. Details: openclaw#187965 (comment).

Thanks @masatohoshino.

Co-authored-by: Ayaan Zaidi <[email protected]>
(cherry picked from commit d2d663a)
Co-authored-by: RomneyDa <[email protected]>
(cherry picked from commit 5ab84cee9136fcfef263f30a2b9262ea35558a4a)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling channel: slack Channel integration: slack docs Improvements or additions to documentation P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. size: XS 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