fix: sanitize block reply previews#86634
Conversation
|
Codex review: needs real behavior proof before merge. Reviewed May 29, 2026, 1:19 AM ET / 05:19 UTC. Summary PR surface: Source +14, Tests +62. Total +76 across 2 files. Reproducibility: yes. source inspection gives a high-confidence path: emit an Review metrics: none identified. Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Proof guidance:
Risk before merge
Maintainer options:
Next step before merge
Security Review findings
Review detailsBest possible solution: Use the existing Do we have a high-confidence way to reproduce the issue? Yes, source inspection gives a high-confidence path: emit an Is this the best way to solve the issue? No, not as submitted: sanitizing at this chokepoint is the right narrow direction, but the import must use the current helper path and the PR needs real behavior proof before merge. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model gpt-5.5, reasoning high; reviewed against 8eb5ff08c86b. Label changesLabel changes:
Label justifications:
Evidence reviewedPR surface: Source +14, Tests +62. Total +76 across 2 files. View PR surface stats
What I checked:
Likely related people:
What the crustacean ranks mean
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 PR egg 🎁 Pass real behavior proof to wake the egg and unlock a hatchable treat. Where did the egg go?
|
This comment was marked as spam.
This comment was marked as spam.
|
I consolidated the overlapping dispatcher work into #86672 so reviewers have one branch for this shared Rationale:
I am closing this PR to reduce queue pressure and remove the cross-PR conflict. Please review/merge #86672 for the combined sanitizer + Discord marked |
Summary
Fixes a visible-output leak where streamed/block reply previews could receive raw internal runtime context before the normal user-facing sanitizer ran.
The final reply path already normalizes text via
sanitizeUserFacingText, but the generic block reply callback path handed raw block payloads to queued/progress callbacks first. Channels that render live previews from those callbacks could expose internal runtime context.Changes
dispatch-from-configbefore it reaches:Test plan
git diff --check timeout 600s node scripts/run-vitest.mjs run src/auto-reply/reply/dispatch-from-config.test.ts -t "sanitizes internal runtime context before queued and dispatched block replies"Targeted regression passed in a dependency-populated stage checkout (
1 passed,106 skipped,rc=0). A fresh disposable clone with symlinked dependencies could not complete the same test because a local package dependency was unavailable in that checkout; CI should exercise the normal workspace dependency graph.Real behavior proof
Behavior or issue addressed: Queued block previews and dispatched block replies should strip the internal runtime-context sentinel before visible delivery, while preserving the user-visible intro/outro text.
Real environment tested: Disposable OpenClaw source checkout of this PR branch on Linux with workspace dependencies installed from the locked package graph. The proof exercised the real block-reply dispatch/sanitization seam with the targeted source-level regression test. No production Gateway, live runtime state, live config, or real provider/channel orchestration was used.
Exact steps or command run after this patch:
Evidence after fix: Copied terminal output from the disposable checkout showed that
git diff --checkproduced no whitespace errors, and the targeted regression test passed:Observed result after fix: The regression test confirms both queued block previews and dispatched block replies remove the internal-context sentinel and keep the surrounding visible text intact.
What was not tested: No live provider/channel orchestration, production Gateway, production runtime state, or production config was exercised. This proof is intentionally limited to the sanitizer/dispatch seam changed by this PR.