fix(discord): preserve tool progress messages#78559
Conversation
|
Codex review: needs real behavior proof before merge. Summary Reproducibility: yes. as a source-level reproduction: current main sends final Discord replies through the front-channel sanitizer that strips Real behavior proof Next step before merge Security Review findings
Review detailsBest possible solution: Preserve only validated Discord tool-progress labels or apply the Discord trace/channel-line scrub before preserving marked progress text, with unsafe-marked-payload regression coverage and redacted real Discord proof. Do we have a high-confidence way to reproduce the issue? Yes, as a source-level reproduction: current main sends final Discord replies through the front-channel sanitizer that strips Is this the best way to solve the issue? No. The final-send boundary is the right place to fix the bug, but this patch is too broad because all marked tool deliveries skip Discord-specific trace and channel-line scrubbing. Full review comments:
Overall correctness: patch is incorrect Security concerns:
Acceptance criteria:
What I checked:
Likely related people:
Remaining risk / open question:
Codex review notes: model gpt-5.5, reasoning high; reviewed against 64b94daf92c4. |
💡 Codex Reviewhttps://github.com/openclaw/openclaw/blob/a92a4aac0acd854dd52d52d2325d46ff9180df21/extensions/discord/src/monitor/message-handler.process.ts#L555 Marking every ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
a92a4aa to
5c9b693
Compare
💡 Codex Reviewopenclaw/extensions/discord/src/monitor/reply-safety.ts Lines 97 to 99 in 5c9b693 When ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Summary
Preserve Discord tool-progress messages (
📖 Read:,🛠️ Exec:, etc.) when the Discord front-channel safety scrubber runs.The Discord sanitizer intentionally strips internal trace/scaffolding lines from final channel output. However, normal tool-progress deliveries use the same visible labels, so the sanitizer also removed legitimate progress messages before they reached Discord. In practice,
📖 Read:and🛠️ Exec:disappeared while✍️ Write:happened to survive because that emoji was not part of the internal-trace regex.Fix
channelData.openclawDiscordToolProgress.channelDataas content by itself if text scrubs empty.Validation
✍️ Writevisible📖 Readvisible🛠️ Execvisiblegit diff --checkResult: the targeted Discord test pass completed successfully (
2 passed,66 passed). The repository test runner then continued into broader extension suites; I stopped that broader run after Discord coverage had passed.