Repository navigation
fix(slack,feishu,zalouser): multi-line /btw and /loop arguments arrive on one line - #185267
masatohoshino wants to merge 3 commits into
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs real behavior proof before merge. What this changesPreserves multiline slash-command arguments after mention removal in Slack, Feishu, and Zalo Personal. Example: Send a Slack message containing
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness⛔ Blocked before merge - 1 item remains Keep open: this PR narrowly repairs command text corruption still present on current main, and no introduced correctness defect was found. Priority: P2 Before merge
FindingsNone. Tests
Agent review detailsHow this fits togetherChannel adapters remove mentions and produce command bodies that core command handlers pass to the agent. flowchart LR
A[Incoming channel message] --> B[Channel mention removal]
B --> C[Preserved command body]
C --> D[Core command handler]
D --> E[Agent question or recurring prompt]
Technical reviewBest possible solution: Keep the existing channel normalizers and preserve slash-command whitespace immediately after their transport-specific mention removal. Do we have a high-confidence way to reproduce the issue? Current-main source deterministically collapses multiline input before dispatch in all three paths; the supplied Slack A/B trace independently demonstrates that mechanism, but no target code was executed during this review. Is this the best way to solve the issue? The patch is the smallest complete repair: each transport retains its existing mention owner and adopts the established core whitespace rule without new machinery. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 454004eab143. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource 0, Tests +19. Total +19 across 6 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: No label changes. Label justifications:
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 HistoryReview history (1 earlier review cycle)
Reviewed October 30, 2026, 2:04 PM ET / 18:04 UTC (Revision 2). |
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
Thanks @masatohoshino for finding this and the focused repair! Landed the credited replacement in #190730 (2bd7edf), with multiline |
Closes #185266
What Problem This Solves
Fixes: in Slack, Feishu and Zalo Personal, a slash command with a multi-line argument (
/btwwith a pasted stack trace, a multi-line/loopprompt) reaches the command on one line, with its line breaks and indentation gone. In Zalo Personal this happens when the message mentions the bot.User Impact
User impact: Slack, Feishu and Zalo Personal users can paste traces, code and lists into
/btw,/sideand/loop, and the model receives them as typed, as it already does in channels whose mention stripping runs in core.Why This Change Was Made
#183606 made core
stripMentionskeep the whitespace of text that starts with/. These three channels build the command body in their own helpers (stripSlackMentionsForCommandDetection,normalizeFeishuCommandProbeBodyand Zalo Personal'sstripOwnMentionsForCommandBody), which strip mentions and then collapse every whitespace run to one space, so core never sees the line breaks. Each helper now applies the same rule as core: after mention stripping and trimming, text that starts with/keeps its whitespace; any other text is collapsed as before, so command detection for text likePlease /helpis unchanged.Behavior note: a command followed by more lines (for example a mention,
/stopand a second line) now reaches command matching with its line break, so these channels read it the way core already reads the same text since #183606.Size: production +10/-10 lines in three helpers (the Zalo Personal one also drops an
ifaround aslicethat already returns an empty string past the end); tests +21/-2 lines (one new file beside the Slack helper, one case added to an existing Feishu inbound test, one test beside the existing Zalo Personal inbound normalization tests). No config, state or SDK surface changes.Evidence
Tested at
844005b38fa(baseupstream/maine68d5552923).An isolated QA Gateway ran the real Slack plugin against a local fake Slack API with signed Events API deliveries; the model is the mock OpenAI provider, which records each request. The scenario sends a warmup DM (so the DM has a session), then this DM, and reads the
/btwquestion from the recorded model request. Same scenario on both sides.Before (base
e68d5552923):After (this PR):
Observed result: before, the model received the stack trace joined into one line; after, it receives the three lines with their indentation.
Regression tests, one per channel, each failing on the base and passing with the fix:
CommandBody(throughtextForCommandDetection) keeps the lines of a mention-prefixed multi-line/btw.prepare.test.tsalready covers the collapse of non-command text (Please /help continue); it is over its line cap, so the new case sits beside the helper./btwadded to the existing DM command test inbot.test.ts, which checksCommandBodyandBodyForCommandsin the inbound context.normalizeZaloInboundMessagekeeps the lines incommandContent(the valuemonitor.tspasses asCommandBody) for a multi-line/btwthat mentions the bot.Checks: the touched tests (
pnpm test <file> --maxWorkers=1, wall time per file at 844005b in the table below), plusextensions/feishu/src/sequential-key.test.ts,monitor.message-handler.ingress.test.ts,monitor.message-handler.debounce-policy.test.ts,extensions/slack/src/monitor/message-handler/prepare.test.ts,message-handler.test.ts,message-handler.debounce-policy.test.ts, andextensions/zalouser/src/monitor.group-gating.test.ts,ingress.test.ts,zalo-js.listener.test.ts;pnpm check:test-mock-exports,oxfmt --checkand oxlint (type-aware) on the changed files,git diff --check; the broad suites run in this PR's CI.--maxWorkers=1wallextensions/slack/src/monitor/commands.test.tschanged-extensions-config-3(16 files, Vitest 91.84 s), CI run 40428675605 at 844005bextensions/feishu/src/bot.test.tschanged-extensions-config-5(3 files, Vitest 26.51 s), CI run 40428675605 at 844005bextensions/zalouser/src/zalo-quote-metadata.test.tschanged-extensions-config-6(6 files, Vitest 75.03 s), CI run 40428675605 at 844005bbot.test.tsis an existing file of 62 tests; this PR adds one case to an existing DM command test.Not covered, and why:
/btwtext a real model would receive; no real model was called.CommandBody(for Zalo Personal,commandContent, whichmonitor.tspasses asCommandBody). For Feishu, that test goes through the inbound handler.