Skip to content

fix: remove truncated preview from inbound system events#67761

Closed
jaredgalloway wants to merge 1 commit into
openclaw:mainfrom
jaredgalloway:fix/system-event-truncation
Closed

fix: remove truncated preview from inbound system events#67761
jaredgalloway wants to merge 1 commit into
openclaw:mainfrom
jaredgalloway:fix/system-event-truncation

Conversation

@jaredgalloway

Copy link
Copy Markdown

Summary

Removes the truncated 160-char message preview from system event headers for Slack, MS Teams, and Mattermost channels.

Problem

System events were including a truncated preview of the message body:

System: [2026-04-15 21:56:40 MDT] Slack DM from Jared: What I'm saying is that you are can handle this task (you just showed me you can), but starting tomorrow (and including tomorrow), When we're planning the day o

This caused the model to sometimes reference the truncated header instead of the full message body, leading to responses like "your message got cut off at 'day o'" when the full message was delivered correctly.

Solution

System events now only contain the notification label without message content:

System: [2026-04-15 21:56:40 MDT] Slack DM from Jared

The system event's purpose is notification ("a message arrived"), not content delivery. The full message body is delivered separately in the user turn.

Changes

  • extensions/slack/src/monitor/message-handler/prepare.ts — remove preview from system event (keep for debug logging/type compat)
  • extensions/msteams/src/monitor-handler/message-handler.ts — remove preview from system event (keep for debug logging)
  • extensions/mattermost/src/mattermost/monitor.ts — remove preview from system event

Testing

  • pnpm test:extension slack — ✅ 641 tests passed
  • pnpm test:extension msteams — ✅ 862 tests passed
  • pnpm test:extension mattermost — ✅ 316 passed (1 timeout failure unrelated to changes)
  • pnpm build — ✅
  • Pre-commit hooks — ✅

Fixes #67503

@openclaw-barnacle openclaw-barnacle Bot added channel: mattermost Channel integration: mattermost channel: msteams Channel integration: msteams channel: slack Channel integration: slack size: XS labels Apr 16, 2026
@greptile-apps

greptile-apps Bot commented Apr 16, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

Removes the 160-character truncated message body preview from enqueueSystemEvent calls in the Slack, MS Teams, and Mattermost extension handlers, so system events serve only as arrival notifications rather than partial content deliveries. The preview variable is retained in Slack and MS Teams where it has legitimate downstream uses (debug logging and the Slack return-value shape), and is fully removed from Mattermost where it had no other consumers.

Confidence Score: 5/5

Safe to merge — focused, well-tested fix with no behavioral regressions on the changed path.

All three changed files make the same targeted, correct change. The preview variable is kept only where it has real consumers (debug log on line 806 in MS Teams, debug log on line 829 and return field on line 844 in Slack), and is cleanly removed in Mattermost where it had no other uses. No dead code is introduced. Extension tests passed on all three plugins and the build is clean.

No files require special attention.

Reviews (1): Last reviewed commit: "fix: remove truncated preview from inbou..." | Re-trigger Greptile

@clawsweeper

clawsweeper Bot commented Apr 27, 2026

Copy link
Copy Markdown
Contributor

Thanks for the context here. I swept through the related work, and this is now duplicate or superseded.

Keep open. The patch is the right narrow fix for a source-reproducible Slack/Teams inbound message bug, but the PR is currently conflicting, lacks required real transport proof, and still carries a release-owned CHANGELOG edit.

Canonical path: Close this stale PR. The latest review rated it F, the branch still lacks merge-ready proof, and there has been no human follow-up after the durable review.

So I’m closing this here because the remaining work is already tracked in the canonical issue.

Review details

Best possible solution:

Close this stale PR. The latest review rated it F, the branch still lacks merge-ready proof, and there has been no human follow-up after the durable review.

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

Yes. Source inspection on current main shows Slack and Teams still enqueue a 160-character preview into model-visible system-event labels while separately preserving the full inbound body; I did not run a live Slack or Teams scenario in this read-only review.

Is this the best way to solve the issue?

Yes for the fix direction, but the submitted branch is not merge-ready. The narrow maintainable solution is to remove message content from arrival-only system-event labels, then refresh the branch, remove the changelog edit, and add real transport proof.

Security review:

Security review cleared: The diff changes channel event-label text, focused tests, and a changelog line; it does not touch dependencies, CI, secrets, auth, package resolution, or code-execution surfaces.

AGENTS.md: found and applied where relevant.

What I checked:

  • stale F-rated PR: PR was opened 2026-04-16T17:44:20Z, is older than 60 days, and the latest review rated it F.
  • proof blocker: real behavior proof is missing and proof tier is F, so this branch is not merge-ready without contributor follow-up.
  • no human follow-up: live comments and timeline hydrated by apply contain no non-automation activity after the ClawSweeper review.

Likely related people:

  • Tosko4: Current-main blame for the affected Slack and Teams preview-label blocks points to a broad file recreation commit by this author; semantic ownership is only medium because the commit title is unrelated to channel behavior. (role: recent area contributor; confidence: medium; commits: 8f9493c213e9; files: extensions/slack/src/monitor/message-handler/prepare.ts, extensions/msteams/src/monitor-handler/message-handler.ts)
  • Peter Steinberger: History shows the Teams plugin move and the Mattermost fix that removed the same regular-post system-event pattern, making this a strong routing signal for channel system-event behavior. (role: adjacent feature-history owner; confidence: high; commits: d9f9e93deeac, 8a98c08c8a18; files: extensions/msteams/src/monitor-handler/message-handler.ts, extensions/mattermost/src/mattermost/monitor.ts, extensions/mattermost/src/mattermost/monitor.inbound-system-event.test.ts)
  • scoootscooob: History shows the Slack channel code move into the current extension path where this inbound prepare handler now lives. (role: Slack feature-history contributor; confidence: medium; commits: 8746362f5ebf; files: extensions/slack/src/monitor/message-handler/prepare.ts)

Codex review notes: model internal, reasoning high; reviewed against c40db057da33.

System events were including a truncated 160-char preview of the message
body, leading to model confusion when the full message was delivered
separately. The model would sometimes reference the truncated header
instead of the full body.

Now system events only contain the notification label (e.g., "Slack DM
from Alice") without the message content. The preview is retained for
debug logging where applicable.

Fixes openclaw#67503
@BradGroux
BradGroux force-pushed the fix/system-event-truncation branch from 8091d60 to 4db272b Compare May 8, 2026 07:46
@BradGroux

Copy link
Copy Markdown
Contributor

Prepared this one for maintainer review/CI.\n\nChanges made on top of the original patch:\n- Rebased onto current origin/main.\n- Kept the stale Mattermost hunk out because current main already removed that inbound message system-event path.\n- Added focused Teams and Slack regression coverage proving inbound system events no longer include truncated message previews.\n- Added the missing changelog attribution.\n\nPrepared head: 4db272b29a343282f69631191b1277efca914a6d\n\nLocal verification:\n- node scripts/test-projects.mjs extensions/msteams/src/monitor-handler/message-handler.thread-parent.test.ts extensions/slack/src/monitor/message-handler/prepare.test.ts ✅ after final rebase\n- pnpm build ✅ before final rebase\n- pnpm check ✅ before final rebase\n\nFresh CI is running now.

@openclaw-barnacle openclaw-barnacle Bot added triage: needs-real-behavior-proof Candidate: external PR needs after-fix proof from a real setup. and removed channel: mattermost Channel integration: mattermost labels May 8, 2026
@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P2 Normal backlog priority with limited blast radius. labels May 19, 2026
@clawsweeper

clawsweeper Bot commented May 19, 2026

Copy link
Copy Markdown
Contributor

ClawSweeper PR egg

🎁 Pass real behavior proof to wake the egg and unlock a hatchable treat.

Where did the egg go?
  • The egg game starts only after the PR passes the real-behavior proof check.
  • Before that, no creature or rarity is rolled. The treat waits for real proof.
  • This is still just collectible flavor: proof affects review readiness, not creature quality.

@openclaw-barnacle

Copy link
Copy Markdown

This pull request has been automatically marked as stale due to inactivity.
Please add updates or it will be closed.

@openclaw-barnacle openclaw-barnacle Bot added the stale Marked as stale due to inactivity label Jun 6, 2026
@clawsweeper clawsweeper Bot added rating: 🌊 off-meta tidepool PR readiness rating does not apply to this item. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Jun 6, 2026
@openclaw-barnacle openclaw-barnacle Bot removed the stale Marked as stale due to inactivity label Jun 7, 2026
@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. and removed rating: 🌊 off-meta tidepool PR readiness rating does not apply to this item. labels Jun 14, 2026
@clawsweeper clawsweeper Bot added status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. labels Jun 14, 2026
@clawsweeper

clawsweeper Bot commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

ClawSweeper applied the proposed close for this PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

channel: msteams Channel integration: msteams channel: slack Channel integration: slack P2 Normal backlog priority with limited blast radius. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. size: XS status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. triage: needs-real-behavior-proof Candidate: external PR needs after-fix proof from a real setup.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Inbound message envelope header truncates message body, causing model confusion

2 participants