Skip to content

fix(channels): preserve forwarded text and threaded sender commands - #137313

Merged
steipete merged 8 commits into
openclaw:mainfrom
Marvinthebored:fix/discord-forward-snapshot-body
Sep 5, 2026
Merged

steipete merged 8 commits into
openclaw:mainfrom
Marvinthebored:fix/discord-forward-snapshot-body

Conversation

@Marvinthebored

@Marvinthebored Marvinthebored commented Sep 3, 2026 •

Copy link
Copy Markdown
Contributor

Related: #137239

What Problem This Solves

Fixes an issue where Discord forwarded messages lose their forwarded text when a sender caption is present. Shared reply routing could also interpret commands in forwarded context or dispatch a sender shortcut twice. Teams thread history and Slack rendered mentions exposed sibling failures in the same command-provenance path. Reported by community members on Discord.

Why This Change Was Made

Discord passes its prepared message text to the agent while preserving sender-only command input. Shared routing selects commands from sender text and carries that decision to dispatch. Teams carries Graph history as structured supplemental context; the optional sessionTranscriptMode field keeps that provider window independent of canonical transcript enrichment. Slack carries the rendered sender span and exact mention strings through its channel context.

The maintainer cleanup removes duplicate lazy-loading wrappers, prompt-body updates, skill lookup options, Slack routing arguments, and the one-use mention mapper. It preserves the existing lazy caches and invalidation, authorization, metadata omission, array copies, and error responses. Whole-prompt rescanning and trailing-text guessing were rejected because they consume quoted commands or fail beside attachment context.

The optional exported preservation field has SDK-owner acceptance. No new configuration option, dependency, schema, protocol version, or storage mechanism is introduced.

User Impact

Forwarded Discord content stays visible beside captions. Sender commands run once, while command-looking quoted content stays intact. Teams retains Graph parent/reply history, canonical history, and pending backlog. Slack shortcuts continue working with rendered mentions, direct messages, multiline text, and display names containing parentheses.

Thanks to @Marvinthebored. Their commits and the existing maintainer improvements remain in the original PR history; this continuation appends a maintainer commit without replacing ancestry.

Evidence

  • Final head: 5601417af995c46a9e26bbfdb946f5b9a26dc45d.
  • Existing contributor PR delta: production +173/-60 (net +113), tests +951/-73 (net +878), docs +4/-2.
  • Maintainer cleanup: production +83/-202 (net -119), plus a test-only conversation fixture update. Main was merged without rewriting contributor commits after exact-head CI exposed the changed conversation contract.
  • Combined final PR: production +256/-262 (net -6), tests +952/-73 (net +879), docs +4/-2.
  • Fresh complete-candidate independent Codex review after main integration: no accepted P0/P1/P2 findings.
  • Final-head focused Testbox suites: 252 passed across inline command dispatch, Slack preparation, and transcript context; five Doctor contract guard cases passed as well. Earlier owner suites also covered Discord context, Teams Graph/authz, directive routing, and media-only replies.
  • pnpm check:changed: passed every selected guard, formatting, four typecheck lanes, three dead-export scans, and scoped lint. Testbox command exit 0: https://github.com/openclaw/openclaw/actions/runs/33992782182 . The command result owns the proof; later lease cleanup can mark its hosting workflow cancelled.
  • Exact-head full CI: success, including the required openclaw/ci-gate: https://github.com/openclaw/openclaw/actions/runs/33992513667 . All fetched checks are successful, skipped, or neutral.
  • git diff --check origin/main...HEAD: passed. Native review artifacts and OPENCLAW_TESTBOX=1 scripts/pr prepare-run 137313 passed on this head.

The earlier continuation CI run found that main had replaced groupResolution with a prepared conversation. The fixture now uses the canonical producer. An unrelated UI toast timer failure was also observed in that run and did not recur on the final head; no UI source was changed. Initial raw changed-file runs selected unrelated newer-main drift, and source-capsule attempts rejected checkout movement. Final proof used a frozen candidate and completed successfully.

Previously accepted compiled Gateway evidence exercised Discord forwarded content, Teams parent/reply history with media and backlog, and Slack rendered-mention command delivery through emulated channel and model endpoints. This continuation does not claim authenticated external-service delivery or a new run of those recordings. Final-head regressions and CI preserve those owner boundaries.

ClawSweeper completed review of the exact final head at 2026-09-05T21:21:07.884Z; native merge validated that receipt. There are no inline review conversations requiring resolution.

Merged as fc5e53d086a72c50f347b1d6c1fbd0132499ffed. Main ancestry and the landed source were verified; the actual landed production delta remains net -6.

@clawsweeper

clawsweeper Bot commented Sep 3, 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 channel: discord Channel integration: discord triage: needs-pr-context Candidate: external PR body lacks required problem context or evidence. size: XS and removed triage: needs-pr-context Candidate: external PR body lacks required problem context or evidence. labels Sep 3, 2026
@clawsweeper clawsweeper Bot added P1 High-priority user-facing bug, regression, or broken workflow. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Sep 3, 2026
@clawsweeper

clawsweeper Bot commented Sep 3, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 5, 2026, 5:21 PM ET / 21:21 UTC.

ClawSweeper review

What this changes

Preserves forwarded Discord content, separates sender commands from supplemental channel context, and consolidates reply preparation while retaining Teams history and Slack mention handling.

Merge readiness

✅ Ready for maintainer review

This PR remains necessary: current main and the latest release retain the Discord text-selection defect. The prior Slack and Teams blockers are addressed, and the reviewed candidate has no remaining actionable correctness finding.

Priority: P2
Reviewed head: 5601417af995c46a9e26bbfdb946f5b9a26dc45d

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A coherent owner-boundary repair with useful recorded Gateway proof, retained regression coverage, and no remaining actionable finding.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (logs): Recorded compiled-Gateway runs exercise the changed channel preparation, sender-command routing, model input, and reply boundaries, including Slack’s single help dispatch and Teams’ populated-session context retention; service endpoints were emulated rather than authenticated external channels.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (logs): Recorded compiled-Gateway runs exercise the changed channel preparation, sender-command routing, model input, and reply boundaries, including Slack’s single help dispatch and Teams’ populated-session context retention; service endpoints were emulated rather than authenticated external channels.
Evidence reviewed 10 items Pinned patch and parent identity: The complete local base-to-head diff matches the host’s introduced-file list. The original head records parents 094900d and 69587bb; the stale GitHub test merge was not used to infer removal of main-branch behavior.
Current main still needs the repair: Current main still selects baseText ahead of prepared Discord text and reparses agentText during directive cleanup. These are the concrete boundaries repaired by the branch; no merged replacement is established by the supplied related-item context.
Latest release retains Discord failure mechanism: The supplied latest release, v2026.9.2, still uses baseText ?? text for the agent-facing body, allowing empty sender text or a caption to replace forwarded content.
Findings None None.
Security None None.

How this fits together

Channel plugins prepare incoming messages, sender command text, and supplemental history for OpenClaw’s shared reply pipeline. That pipeline selects commands and builds the model prompt before dispatching replies.

flowchart TD
  A[Incoming channel message] --> B[Channel preparation]
  B --> C[Sender command text]
  B --> D[Forwarded content and history]
  C --> E[Authorized command selection]
  E --> F[Model prompt assembly]
  D --> F
  E --> G[Command reply]
  F --> H[Agent reply]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source -6, Tests +879, Docs +2. Total +875 across 27 files.

View PR surface stats
Area Files Added Removed Net
Source 15 256 262 -6
Tests 9 952 73 +879
Docs 3 4 2 +2
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 27 1212 337 +875

Review metrics

Metric Value Why it matters
Production versus regression coverage Production net -6 lines; tests net +879 lines The cleanup offsets production growth while retaining regression coverage across message preparation, command dispatch, and transcript enrichment.

Technical review

Best possible solution:

Keep sender command provenance separate from model context, using plugin-produced facts and the existing shared routing and transcript owners.

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

Yes, from source: forwarding a Discord message with empty sender text or a caption reaches an agent-body selection that discards the prepared forwarded content on current main and v2026.9.2; this review did not execute that path.

Is this the best way to solve the issue?

Yes. Repairing the channel producer and carrying sender-only command selection through shared dispatch avoids whole-prompt rescanning and trailing-text guesses; the Teams preservation marker keeps independent history windows intact.

AGENTS.md: found and applied where relevant.

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

Labels

Label justifications:

  • P2: Repairs bounded forwarded-content and sender-command failures across channel preparation without evidence of an emergency outage.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (logs): Recorded compiled-Gateway runs exercise the changed channel preparation, sender-command routing, model input, and reply boundaries, including Slack’s single help dispatch and Teams’ populated-session context retention; service endpoints were emulated rather than authenticated external channels.
  • proof: sufficient: Contributor real behavior proof is sufficient. Recorded compiled-Gateway runs exercise the changed channel preparation, sender-command routing, model input, and reply boundaries, including Slack’s single help dispatch and Teams’ populated-session context retention; service endpoints were emulated rather than authenticated external channels.

Evidence

What I checked:

  • Pinned patch and parent identity: The complete local base-to-head diff matches the host’s introduced-file list. The original head records parents 094900d and 69587bb; the stale GitHub test merge was not used to infer removal of main-branch behavior. (5601417af995)
  • Current main still needs the repair: Current main still selects baseText ahead of prepared Discord text and reparses agentText during directive cleanup. These are the concrete boundaries repaired by the branch; no merged replacement is established by the supplied related-item context. (src/auto-reply/reply/get-reply-directives-routing.ts:115, e6a0eb9ff39b)
  • Latest release retains Discord failure mechanism: The supplied latest release, v2026.9.2, still uses baseText ?? text for the agent-facing body, allowing empty sender text or a caption to replace forwarded content. (extensions/discord/src/monitor/message-handler.context.ts:184, 3928bad9badf)
  • Command provenance and dispatch: Routing selects shortcuts from sender command text, validates the prepared Slack span through existing mention normalization, and projects cleanup only onto a demonstrated sender block. Dispatch retains authorization checks and leaves standalone commands on ordinary dispatch. (src/auto-reply/reply/get-reply-directives-routing.ts:119, 5601417af995)
  • Prior Teams and Slack findings addressed: Slack now supplies the exact rendered sender span for direct messages and multiline messages preceding attachments. Teams marks Graph windows for preservation, and both transcript enrichment and prompt history suppression honor that marker; the populated-session regression checks Graph content, canonical history, and pending backlog. (src/channels/inbound-event/session-transcript-context.runtime.ts:89, 5601417af995)
  • Prepared-conversation fixture matches its callee: The sender-command regression passes prepareReplyConversation({ ctx: sessionCtx, sessionEntry }); resolveReplyDirectives consumes conversation.group. The fixture exercises standalone, inline, forwarded, alias, and skill-reference cases without weakening their dispatch assertions. (src/auto-reply/reply/get-reply-inline-actions.skip-when-config-empty.test.ts:2543, 5601417af995)

Likely related people:

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

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 (16 earlier review cycles; latest 8 shown)
  • reviewed 2026-09-04T07:53:57.235Z sha 806a87c0d916a3bd3f46a1680719e28398585589 :: needs real behavior proof before merge. :: [P2] [P2] Preserve Slack shortcuts after mention rendering
  • reviewed 2026-09-04T08:28:06.869Z sha 806a87c0d916a3bd3f46a1680719e28398585589 :: blocked before merge. :: [P2] [P2] Preserve Slack shortcuts after mention rendering
  • reviewed 2026-09-05T03:52:52.466Z sha 719267511295aa7a72df8c0c3870f3a5072744e0 :: needs real behavior proof before merge. :: [P2] [P2] Preserve Slack shortcut normalization in direct messages | [P2] [P2] Retain the complete sender span before Slack attachment context
  • reviewed 2026-09-05T04:47:54.009Z sha 6b9b78c28aebf08c2e85ec963205f82de97aaeb6 :: needs real behavior proof before merge. :: [P2] [P2] Preserve Slack shortcut normalization in direct messages | [P2] [P2] Retain the complete sender span before Slack attachment context | [P2] [P2] Preserve Teams thread context through transcript merging
  • reviewed 2026-09-05T05:01:27.507Z sha 08b3b5546ecc284ac0e7231f80c585eeba500117 :: blocked before merge. :: [P2] [P2] Preserve Teams thread context through transcript merging
  • reviewed 2026-09-05T05:49:59.130Z sha 8aaae89 :: blocked before merge. :: [P2] Preserve Teams thread context through transcript merging
  • reviewed 2026-09-05T06:52:14.773Z sha e7326d1 :: needs maintainer review before merge. :: none
  • reviewed 2026-09-05T21:12:05.831Z sha 094900d :: needs maintainer review before merge. :: none

@Marvinthebored

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Sep 3, 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 proof: sufficient ClawSweeper judged the real behavior proof convincing. 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: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Sep 3, 2026
@steipete steipete self-assigned this Sep 3, 2026
@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation size: L and removed size: XS labels Sep 4, 2026
@steipete

steipete commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

Supplemental maintainer proof for the Discord context boundary:

Baseline run on unchanged main d2a616bdf373a5b3cac0add8e9b2f70cd0802f42 passed 31 controls and failed only the two native DM/guild forwarded-text assertions. Both messages completed preflight and joined reply delivery, but their finalized agent text was empty.

Candidate run on 7277f42f4260551626056ee69dc42c17b78b8606 passed all 182 tests across ten files. Five native message receipts show the complete forwarded text reaching agentText and BodyForAgent; raw sender text, command classification, and mention authority remain unchanged. The required-mention negative control records its exact drop and sends no reply. Ordinary text/replies and audio transcript controls pass. Source, dependency, index, lock, docs-list and scoped cleanup checks were independently verified.

This candidate uses the same direct composed-text selection now present in the Discord context owner in db6e3e5b34afd5a30536df60a3b9605278914768. These results cover the linked candidate and that context boundary; they do not validate the new command-routing changes in the current PR head. The harness uses native message mapping and production preflight/process/context with mocked REST and inbound dispatch. It is not authenticated Discord delivery or a full Gateway/model run. Test fixtures and the isolated shared-mock reset are retained on the linked candidate branch for reuse; the current PR changes were left intact.

@steipete steipete changed the title fix(discord): forward-only messages reach agents fix(discord): preserve forwarded text beside captions and commands Sep 4, 2026
@steipete

steipete commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

@clawsweeper re-review

The forwarding fix now preserves captions and sender-owned command selection through routing and prevents duplicate standalone command dispatch. Head db6e3e5b34afd5a30536df60a3b9605278914768 matches the reviewed and tested source tree. The PR body records the failing reproductions, 299 distinct owner/sibling cases, five compiled Gateway scenarios, independent review and proof limits.

@clawsweeper

clawsweeper Bot commented Sep 4, 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 merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. 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. and removed 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. labels Sep 4, 2026
@Marvinthebored

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

Addressed the threaded MS Teams regression at head 04457409d368df68da1f32c533b0b16e0de64915. Cleanup now projects only onto an exact newline-delimited sender suffix and does not search thread history. The requested suites pass 32/32, targeted lint passes, and git diff --check passes.

@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Sep 5, 2026
Slack renders resolved mentions in sender text and may append attachment
context after that text. Shared routing could not reconstruct the sender-owned
command source in direct messages or multiline messages, so inline shortcuts
were left in the model prompt and their native replies were skipped.

Carry the exact rendered sender span from Slack preparation through channel
context. Routing accepts that span only when provider mention stripping and
normalization reproduce the command body, keeping supplemental or arbitrary
context from becoming a command source. Cover channel, direct-message, and
multiline attachment shapes through preparation, routing, and dispatch.
@Marvinthebored
Marvinthebored force-pushed the fix/discord-forward-snapshot-body branch from 08b3b55 to 8aaae89 Compare September 5, 2026 05:26
@Marvinthebored

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

Exact head: 8aaae8973d0b64b66864a1180307f9e39e261eb2.

The Slack direct-message and multiline attachment-context findings are addressed at the producer boundary. Post-rebase validation: 527 focused tests passed; the compiled isolated-Gateway Slack DM proof produced one native help reply, one model request with /help removed, and one marker reply; the full six-file changed-path gate passed all typecheck, lint, dead-export, boundary, dependency, cycle, and runtime guards. The PR body contains the refreshed evidence and diff accounting.

@clawsweeper

clawsweeper Bot commented Sep 5, 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:

Keep provider-owned Graph thread windows outside canonical transcript eviction while restoring transcript rows separately through inbound history. Cover a populated session at the prepared-turn boundary and assert the final model-facing context retains Graph history, canonical history, and pending backlog.
@Marvinthebored

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

Exact head: e7326d1e14fa3b1aec16ce0a26b9b52e1a378f72.

The populated-session Teams finding is fixed. A regression failed on the old behavior because canonical transcript rows evicted both Graph messages, then passed after provider-owned Graph windows were preserved separately. The final model-facing context retains Graph history, canonical history, and pending backlog. Focused owner/sibling suites passed 583/583. Per the author's direction, I stopped the broader repeated gate rather than running another exhaustive cycle; the PR body states that explicitly.

@clawsweeper

clawsweeper Bot commented Sep 5, 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.

@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. merge-risk: 🚨 session-state 🚨 May lose, corrupt, stale, or mis-associate session, agent, or context state. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Sep 5, 2026
Preserve sender command provenance and supplemental context while removing duplicate reply loading, prompt updates, and Slack routing setup.
@steipete

steipete commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

@clawsweeper re-review

The appended maintainer commit preserves the previously reviewed forwarding and command-provenance repairs while removing duplicate reply loading, prompt updates, and Slack routing setup. Combined production delta is now net -6 lines. SDK-owner acceptance covers the optional preservation field. Fresh independent review is clean; focused Testbox suites passed. The PR body records current proof and remaining checks.

@clawsweeper

clawsweeper Bot commented Sep 5, 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:

Merge main without rewriting contributor commits to repair the exact-head CI failure. Supply the canonical prepared conversation in the sender-command regression fixture.
@steipete

steipete commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

@clawsweeper re-review

Head 5601417 merges main without rewriting contributor history and updates the sender-command regression fixture for the current prepared-conversation contract. Fresh independent review is clean; production remains net -6. Current proof is recorded in the PR body.

@clawsweeper

clawsweeper Bot commented Sep 5, 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.

@steipete
steipete merged commit fc5e53d into openclaw:main Sep 5, 2026
216 checks passed
@steipete

steipete commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 6, 2026
…penclaw#137313)

* fix(discord): deliver forward-only messages to agents

* fix(discord): preserve forwarded text beside captions and commands

Use prepared Discord message text while preserving sender-owned command input.
Carry selected shortcuts through routing, retain raw sender tails, and keep
standalone commands on ordinary dispatch so forwarded context cannot strip
content or cause duplicate replies.

Co-authored-by: Marvinthebored <[email protected]>

* fix: clean directives after threaded context

* fix(msteams): keep sender directives separate from thread history

Supply Graph thread history through structured channel context so directive cleanup reads the current sender while history, pending backlog and unavailable-media notices remain intact. Replace the trailing-text heuristic and retain the existing thread reply and visibility owners.

Preserve Marvinthebored's original commits and subsequent threaded-context fix in the ancestry. Verified through the real compiled Gateway with emulated Teams/Graph and model endpoints, owner tests and changed-path checks.

Co-authored-by: Marvinthebored <[email protected]>

* fix(slack): keep inline shortcuts after mention rendering

Slack renders resolved mentions in sender text and may append attachment
context after that text. Shared routing could not reconstruct the sender-owned
command source in direct messages or multiline messages, so inline shortcuts
were left in the model prompt and their native replies were skipped.

Carry the exact rendered sender span from Slack preparation through channel
context. Routing accepts that span only when provider mention stripping and
normalization reproduce the command body, keeping supplemental or arbitrary
context from becoming a command source. Cover channel, direct-message, and
multiline attachment shapes through preparation, routing, and dispatch.

* fix(msteams): preserve supplemental thread context

Keep provider-owned Graph thread windows outside canonical transcript eviction while restoring transcript rows separately through inbound history. Cover a populated session at the prepared-turn boundary and assert the final model-facing context retains Graph history, canonical history, and pending backlog.

* refactor(channels): share reply preparation and lazy loading

Preserve sender command provenance and supplemental context while removing duplicate reply loading, prompt updates, and Slack routing setup.

---------

Co-authored-by: Marvinthebored <[email protected]>
Co-authored-by: Peter Steinberger <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

channel: discord Channel integration: discord channel: msteams Channel integration: msteams 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: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: XL 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.

3 participants