fix(slack): recognize MiniMax mm: namespaced reasoning tags in monito… · openclaw/openclaw@d2bf67f
Alix-007
·
2026-06-17
·
via Recent Commits to openclaw:main
File tree
extensions/slack/src/monitor/message-handler
| Original file line number | Diff line number | Diff line change |
|---|
@@ -1829,6 +1829,31 @@ describe("dispatchPreparedSlackMessage preview fallback", () => {
|
1829 | 1829 | expect(updates.join("\n")).not.toContain("Checking Reading"); |
1830 | 1830 | }); |
1831 | 1831 | |
| 1832 | +it("extracts mm:think reasoning snapshots for Slack progress draft previews", async () => { |
| 1833 | +const draftStream = createDraftStreamStub(); |
| 1834 | +createSlackDraftStreamMock.mockReturnValueOnce(draftStream); |
| 1835 | +mockedDispatchSequence = []; |
| 1836 | +mockedReplyOptionEvents = [ |
| 1837 | +{ |
| 1838 | +kind: "reasoning", |
| 1839 | +text: "<mm:think>Reading\nChecking</mm:think>", |
| 1840 | +isReasoningSnapshot: true, |
| 1841 | +}, |
| 1842 | +]; |
| 1843 | + |
| 1844 | +await dispatchPreparedSlackMessage( |
| 1845 | +createPreparedSlackMessage({ |
| 1846 | +accountConfig: { streaming: { progress: { label: "Shelling" } } }, |
| 1847 | +}), |
| 1848 | +); |
| 1849 | + |
| 1850 | +expect(draftStream.update).toHaveBeenLastCalledWith( |
| 1851 | +["Shelling", "• Reading Checking"].join("\n"), |
| 1852 | +); |
| 1853 | +const updates = draftStream.update.mock.calls.map((call) => String(call[0])); |
| 1854 | +expect(updates.join("\n")).toContain("Reading Checking"); |
| 1855 | +}); |
| 1856 | + |
1832 | 1857 | it("keeps plain Slack reasoning content that starts with Thinking", async () => { |
1833 | 1858 | const draftStream = createDraftStreamStub(); |
1834 | 1859 | createSlackDraftStreamMock.mockReturnValueOnce(draftStream); |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -122,7 +122,8 @@ const UNICODE_TO_SLACK: Record<string, string> = {
|
122 | 122 | "🛠️": "hammer_and_wrench", |
123 | 123 | "💻": "computer", |
124 | 124 | }; |
125 | | -const SLACK_REASONING_TAG_RE = /<\s*(\/?)\s*(?:think(?:ing)?|thought|antthinking)\b[^<>]*>/gi; |
| 125 | +const SLACK_REASONING_TAG_RE = |
| 126 | +/<\s*(\/?)\s*(?:(?:antml:|mm:)?(?:think(?:ing)?|thought)|antthinking)\b[^<>]*>/gi; |
126 | 127 | const SLACK_REASONING_LABEL_PREFIX_RE = /^\s*(?:>\s*)?Reasoning:\s*/iu; |
127 | 128 | const SLACK_THINKING_LABEL_PREFIX_RE = /^\s*(?:>\s*)?Thinking\.{0,3}(?=\s*(?:\n|_))/iu; |
128 | 129 | |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。