fix: remove truncated preview from inbound system events#67761
fix: remove truncated preview from inbound system events#67761jgallowa07 wants to merge 1 commit intoopenclaw:mainfrom
Conversation
Greptile SummaryRemoves the 160-character truncated message body preview from Confidence Score: 5/5Safe 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 |
|
Codex review: needs real behavior proof before merge. Summary Reproducibility: yes. Source inspection gives a high-confidence reproduction path: current main enqueues a 160-character Slack/MS Teams preview into the system-event prompt while separately delivering the full inbound body to the agent payload. Real behavior proof Next step before merge Security Review detailsBest possible solution: Land the narrow Slack/Teams label-only system-event change after adding real after-fix proof and resolving the exact-head CI gate, while preserving Mattermost's no-user-post-system-event behavior. Do we have a high-confidence way to reproduce the issue? Yes. Source inspection gives a high-confidence reproduction path: current main enqueues a 160-character Slack/MS Teams preview into the system-event prompt while separately delivering the full inbound body to the agent payload. Is this the best way to solve the issue? Yes for the code direction. The latest diff is the narrow maintainable fix for Slack and MS Teams and has dropped the stale Mattermost change, but merge should wait for real behavior proof and green or waived exact-head CI. Acceptance criteria:
What I checked:
Likely related people:
Remaining risk / open question:
Codex review notes: model gpt-5.5, reasoning high; reviewed against fb66a101e272. |
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
8091d60 to
4db272b
Compare
|
Prepared this one for maintainer review/CI.\n\nChanges made on top of the original patch:\n- Rebased onto current |
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:
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:
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 eventTesting
pnpm test:extension slack— ✅ 641 tests passedpnpm test:extension msteams— ✅ 862 tests passedpnpm test:extension mattermost— ✅ 316 passed (1 timeout failure unrelated to changes)pnpm build— ✅Fixes #67503