Repository navigation
fix: preserve multiline Slack, Feishu, and Zalo command arguments - #190730
Conversation
Keep line breaks and indentation after channel-specific mention removal. Retain existing single-line whitespace normalization. Co-authored-by: Masato Hoshino <[email protected]>
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
@clawsweeper review |
|
🦞👀 Re-review progress:
|
|
Codex review: needs maintainer review before merge. What this changesPreserves multiline slash-command arguments after mention removal in Slack, Feishu, and Zalo Personal while retaining single-line whitespace normalization. Example: Send the Slack bot
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep open: this maintainer-authored PR repairs command-text corruption still present on main, and no introduced correctness defect was found. Priority: P2 Before mergeNone. FindingsNone. Tests
Agent review detailsHow this fits togetherChannel adapters remove transport-specific mentions and construct command text that core dispatch consumes as a side question or recurring prompt. flowchart LR
A[Incoming channel message] --> B[Transport mention removal]
B --> C[Command text]
C --> D[Core command dispatch]
D --> E[Side question or recurring prompt]
Technical reviewBest possible solution: Keep mention removal in the existing channel owners and preserve multiline command text before it reaches core dispatch. Do we have a high-confidence way to reproduce the issue? Current-main source deterministically flattens multiline input before command dispatch in all three adapters, and the supplied regression results report the corresponding failures; no target code was executed during this review. Is this the best way to solve the issue? This is the smallest complete repair: preserve multiline arguments in the three existing transport owners, retain single-line behavior, and test their distinct inbound boundaries without adding another abstraction. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 71becfa19f32. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource -1, Tests +61, Other +2. Total +62 across 7 files. Added test files: 1. View PR surface stats
Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. LabelsLabel changes:
Label justifications:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment Reviewed November 1, 2026, 7:09 PM ET / November 2, 2026, 00:09 UTC. |
|
Merged via squash.
|
…enclaw#190730) Keep line breaks and indentation after channel-specific mention removal. Retain existing single-line whitespace normalization. Co-authored-by: Masato Hoshino <[email protected]>
…90730) Keep line breaks and indentation after channel-specific mention removal. Retain existing single-line whitespace normalization. Release adaptation: extend the maintenance-line Feishu bot.test.ts command admission coverage rather than restoring the newer bot.commands.test.ts harness. Production changes are the original three parser hunks. Companion dispositions: #190975 concerns the independent Zalo group cache clock test; #192608 concerns attachment handoff, not text command parsing; #197656 removes main-only retired test allocations. All are not applicable to this bounded backport. No later #190730 mention through bd692e9. (cherry picked from commit 2bd7edf) Co-authored-by: Masato Hoshino <[email protected]> Co-authored-by: RomneyDa <[email protected]>
What Problem This Solves
Fixes: Slack, Feishu, and Zalo Personal flatten multiline
/btwquestions and/loopprompts after removing bot mentions.Supersedes #185267, thanks @masatohoshino. Fixes #185266.
User Impact
Pasted stack traces, blank lines, and indentation now reach command dispatch intact. Single-line commands retain their existing whitespace normalization. There are no configuration changes or migration steps.
Why This Change Was Made
These three channel adapters collapse command whitespace before core can preserve it. Keep multiline slash arguments in the existing mention-removal owners, following core's multiline contract. Non-command text still collapses whitespace.
Simplification removes Zalo's redundant conditional around the remaining tail slice. Production code is +9/−10 (net −1); no new helper, SDK surface, or state. Regression tests grow by 61 lines, allocated specifically to the three distinct inbound boundaries.
Evidence
On current main
71becfa19f32a86eb3e62bccf713f5be7107884f, six multiline cases failed with flattened command text: two each for Slack, Feishu, and Zalo Personal. Single-line controls passed. After the fix, all three named test files pass:extensions/slack/src/monitor/message-handler/prepare.commands.test.tsextensions/feishu/src/bot.commands.test.tsextensions/zalouser/src/zalo-quote-metadata.test.tsSlack exercises real message preparation and inspects
CommandBody/BodyForCommands; Feishu drives the inbound handler and checks those fields plusCommandTurn.body; Zalo drives a synthetic listener and the production inbound normalizer, checking thecommandContentconsumed by its monitor. Slack and Zalo also check that repeated spaces in a single-line question still collapse.Affected sibling tests: Slack
message-handler.debounce-policy.test.ts; Feishusequential-key.test.tsandmonitor.message-handler.debounce-policy.test.ts; Zalomonitor.group-gating.test.ts: 31 passed, 28.16 s total.Touched-file oxfmt, syntax-only oxlint through the repository wrapper, and
git diff --checkpass. Exact-head PR CI run 41365204282 passed, including type checking, lint, ratchets, source contracts, channel test bundles, security, andopenclaw/ci-gate. CI test times above sum each file's reported case times in the extension bundle. No local broad suite, packaging, staging, container, or browser run was used on the production Team host.Local autoreview (Codex, P0–P2) reviewed the full replacement against
71becfa19f32a86eb3e62bccf713f5be7107884f: scoped-clean, no actionable findings. Hosted ClawSweeper also reviewed this exact head and reported no findings or before-merge blockers. The author simplification pass retained the existing three transport owners and removed the redundant Zalo condition.Limits: no live Slack, Feishu, Zalo, or hosted-model calls; the tests verify text at the production inbound boundary before command handlers. The contributor branch was read with GitHub view/diff only and was never checked out or executed. This is an independently implemented replacement with Masato Hoshino credited in the commit.