Skip to content

fix(slack): stop logging inbound message previews#96312

Merged
steipete merged 1 commit into
mainfrom
codex/slack-log-metadata
Jul 4, 2026
Merged

fix(slack): stop logging inbound message previews#96312
steipete merged 1 commit into
mainfrom
codex/slack-log-metadata

Conversation

@steipete-oai

@steipete-oai steipete-oai commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

What Problem This Solves

Slack verbose ingress logging currently includes the first 160 characters of every prepared inbound message. That can copy direct-message text, channel text, or resolved attachment text into production logs even when operators only need routing and correlation data.

Why This Change Was Made

  • Remove raw Slack message previews from the verbose inbound log.
  • Retain useful non-content metadata: account, agent, channel, message/thread IDs, sender route, chat type, and character count.
  • Add regression coverage that enables verbose logging and verifies confidential message content is absent from every captured verbose entry.

User Impact

Operators keep the metadata needed to correlate Slack ingress with routing and sessions, while inbound message text is no longer duplicated into verbose logs. Message preparation and delivery behavior are unchanged.

Evidence

  • Exact rebased head: 47d039f9a0fe9b1e9800872b09f74f2efb80857e.
  • node scripts/run-vitest.mjs extensions/slack/src/monitor/message-handler/prepare.test.ts — 1 file, 92 tests passed.
  • Blacksmith Testbox through Crabbox tbx_01kwq136yxfgxrhfmyt925swen — changed extension production/test typechecks, focused lint, database-first and media guards, and import-cycle checks passed. Actions: https://github.com/openclaw/openclaw/actions/runs/28713269172
  • File-scoped Oxfmt check passes.
  • git diff --check passes.
  • Repository autoreview reports no accepted/actionable findings (patch is correct, confidence 0.98).
  • A read-only Slack logging audit found no other raw inbound-content log sink in the Slack extension.
  • Live Slack canary on exact head 47d039f9a0fe9b1e9800872b09f74f2efb80857e passed through the native Slack driver in 4259ms. With debug file logging enabled, the run emitted two metadata-only slack inbound: entries and zero occurrences of the live input phrase, generated marker prefix, or preview=. The local artifact contains workspace metadata and is intentionally not published.

@openclaw-barnacle openclaw-barnacle Bot added channel: slack Channel integration: slack size: XS maintainer Maintainer-authored PR labels Jun 24, 2026
@clawsweeper

clawsweeper Bot commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge. Reviewed July 4, 2026, 1:06 PM ET / 17:06 UTC.

Summary
The PR replaces Slack inbound verbose logging of a raw message preview with routing metadata plus character count and adds a Vitest regression for content-free verbose logs.

PR surface: Source +2, Tests +38. Total +40 across 2 files.

Reproducibility: yes. Source inspection on current main shows Slack rawBody becomes preview and logVerbose emits it when verbose/debug logging is enabled; rawBody is built from user message and attachment content.

Review metrics: 1 noteworthy metric.

  • Content-bearing Slack inbound log sink: 1 changed, 0 added. The diff targets the audited slack inbound: verbose sink that logged prepared message preview content.

Stored data model
Persistent data-model change detected: vector/embedding metadata: extensions/slack/src/monitor/message-handler/prepare.test.ts. Confirm migration or upgrade compatibility proof before merge.

Merge readiness
Overall: 🧂 unranked krab
Proof: 🧂 unranked krab
Patch quality: 🦞 diamond lobster
Result: blocked until real behavior proof from a real setup is added.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Rank-up moves:

  • [P1] Add redacted terminal/log output or a recording from a real Slack ingress run with verbose or debug logging enabled, showing metadata-only slack inbound: output and no message text.
  • [P1] Redact private details such as tokens, phone numbers, user IDs if needed, workspace names, IP addresses, and non-public endpoints before posting proof.
  • Update the PR body after adding proof so ClawSweeper re-reviews automatically; if it does not, ask a maintainer to comment @clawsweeper re-review.

Proof guidance:

  • [P1] Needs real behavior proof before merge: Tests, CI/Testbox claims, and an audit are present, but no redacted real Slack ingress or runtime log output demonstrates the after-fix metadata-only behavior. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.

Mantis proof suggestion
A live Slack ingress smoke with verbose logging would directly prove the runtime log behavior missing from the PR proof. A maintainer can ask Mantis to capture proof by posting this exact PR comment:

@openclaw-mantis slack desktop smoke: verify a Slack inbound message with verbose logging emits metadata-only slack inbound output and no message text in logs.

Risk before merge

  • [P1] No redacted real Slack/runtime verbose-log output currently proves the after-fix slack inbound: line is metadata-only in a real setup.
  • [P1] The protected maintainer label means this PR should not be closed or merged by cleanup automation without explicit maintainer handling.

Maintainer options:

  1. Decide the mitigation before merge
    Land the metadata-only Slack verbose log after redacted real Slack ingress proof shows the runtime log is content-free and maintainer handling clears the protected-label flow.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Next step before merge

  • [P1] Human handling is needed because the patch looks correct, but contributor-provided real Slack/runtime proof is still absent and the PR has a protected maintainer label.

Security
Cleared: Cleared: the diff removes Slack message content from a verbose/debug log and does not add dependencies, workflow changes, credential handling, or code-execution paths.

Review details

Best possible solution:

Land the metadata-only Slack verbose log after redacted real Slack ingress proof shows the runtime log is content-free and maintainer handling clears the protected-label flow.

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

Yes. Source inspection on current main shows Slack rawBody becomes preview and logVerbose emits it when verbose/debug logging is enabled; rawBody is built from user message and attachment content.

Is this the best way to solve the issue?

Yes. The patch is the narrow owner-boundary fix: it keeps preview for the prepared message result while replacing only the verbose log sink with metadata and focused coverage.

AGENTS.md: found and applied where relevant.

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

Label changes

Label justifications:

  • P2: This is a focused Slack privacy hardening fix with limited runtime blast radius and no message-delivery behavior change.
  • rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab and patch quality is 🦞 diamond lobster.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs real behavior proof before merge: Tests, CI/Testbox claims, and an audit are present, but no redacted real Slack ingress or runtime log output demonstrates the after-fix metadata-only behavior. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
Evidence reviewed

PR surface:

Source +2, Tests +38. Total +40 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 1 3 1 +2
Tests 1 39 1 +38
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 42 2 +40

What I checked:

Likely related people:

  • steipete: Recent merged Slack prepare-path refactor work touched the same runtime file, and this live PR is assigned to the same human account under the maintainer flow. (role: recent area contributor; confidence: high; commits: 1507a9701b83; files: extensions/slack/src/monitor/message-handler/prepare.ts)
  • hugenshen: Authored the merged system-event preview cleanup that touched the same Slack prepare source/test surface and the same inbound-preview privacy theme. (role: adjacent preview-cleanup contributor; confidence: medium; commits: 47545e04c4bd; files: extensions/slack/src/monitor/message-handler/prepare.ts, extensions/slack/src/monitor/message-handler/prepare.test.ts)
  • sjf-oa: Recent merged Slack relay-mode work touched prepare.ts, so this person is a plausible adjacent reviewer for inbound prepare-path behavior. (role: recent adjacent Slack contributor; confidence: medium; commits: 6fa944e80f22; files: extensions/slack/src/monitor/message-handler/prepare.ts)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

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.

How this review workflow works
  • 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.
Review history (1 earlier review cycle)
  • reviewed 2026-06-24T14:36:47.815Z sha 06bf20d :: needs real behavior proof before merge. :: none

@clawsweeper clawsweeper Bot added 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. P2 Normal backlog priority with limited blast radius. labels Jun 24, 2026
@steipete-oai
steipete-oai force-pushed the codex/slack-log-metadata branch from a28dce4 to 06bf20d Compare June 24, 2026 14:17
@clawsweeper clawsweeper Bot added 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 24, 2026
@steipete steipete self-assigned this Jul 4, 2026
@steipete
steipete force-pushed the codex/slack-log-metadata branch from 06bf20d to 47d039f Compare July 4, 2026 17:02
@steipete
steipete marked this pull request as ready for review July 4, 2026 17:02
@steipete

steipete commented Jul 4, 2026

Copy link
Copy Markdown
Contributor

Maintainer verification is complete on exact head 47d039f9a0fe9b1e9800872b09f74f2efb80857e.

  • Rebased cleanly onto current main; the PR remains limited to the Slack inbound log sink and its regression test.
  • The log now preserves account, agent, channel, message/thread IDs, sender route, chat type, and character count without interpolating the 160-character inbound preview. The internal PreparedSlackMessage.preview contract remains unchanged.
  • Focused local proof: node scripts/run-vitest.mjs extensions/slack/src/monitor/message-handler/prepare.test.ts — 1 file, 92 tests passed; file-scoped Oxfmt and git diff --check also passed.
  • Remote proof: Blacksmith Testbox tbx_01kwq136yxfgxrhfmyt925swen passed extension production/test types, focused lint, database-first/media guards, and import-cycle checks. Actions run.
  • Live behavior proof: a native-driver Slack canary passed against this exact head in 4259ms with debug file logging enabled. The run emitted two metadata-only slack inbound: entries and zero occurrences of the live input phrase, generated marker prefix, or preview=.
  • Slack log-sink audit found no sibling use of raw inbound message.text, rawBody, or preview; fresh Codex autoreview found no actionable issues and rated the patch correct at 0.98 confidence.

The local live artifact contains workspace metadata and was intentionally not published.

@steipete
steipete merged commit 0869edc into main Jul 4, 2026
147 of 149 checks passed
@steipete
steipete deleted the codex/slack-log-metadata branch July 4, 2026 17:14
@steipete

steipete commented Jul 4, 2026

Copy link
Copy Markdown
Contributor

Merged via squash.

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

Labels

channel: slack Channel integration: slack maintainer Maintainer-authored PR 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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants