mirror of
https://github.com/openclaw/openclaw.git
synced 2026-08-08 02:52:15 +00:00
fix(slack): recognize MiniMax mm: namespaced reasoning tags in monitor preview (#93874)
This commit is contained in:
@@ -1829,6 +1829,31 @@ describe("dispatchPreparedSlackMessage preview fallback", () => {
|
||||
expect(updates.join("\n")).not.toContain("Checking Reading");
|
||||
});
|
||||
|
||||
it("extracts mm:think reasoning snapshots for Slack progress draft previews", async () => {
|
||||
const draftStream = createDraftStreamStub();
|
||||
createSlackDraftStreamMock.mockReturnValueOnce(draftStream);
|
||||
mockedDispatchSequence = [];
|
||||
mockedReplyOptionEvents = [
|
||||
{
|
||||
kind: "reasoning",
|
||||
text: "<mm:think>Reading\nChecking</mm:think>",
|
||||
isReasoningSnapshot: true,
|
||||
},
|
||||
];
|
||||
|
||||
await dispatchPreparedSlackMessage(
|
||||
createPreparedSlackMessage({
|
||||
accountConfig: { streaming: { progress: { label: "Shelling" } } },
|
||||
}),
|
||||
);
|
||||
|
||||
expect(draftStream.update).toHaveBeenLastCalledWith(
|
||||
["Shelling", "• Reading Checking"].join("\n"),
|
||||
);
|
||||
const updates = draftStream.update.mock.calls.map((call) => String(call[0]));
|
||||
expect(updates.join("\n")).toContain("Reading Checking");
|
||||
});
|
||||
|
||||
it("keeps plain Slack reasoning content that starts with Thinking", async () => {
|
||||
const draftStream = createDraftStreamStub();
|
||||
createSlackDraftStreamMock.mockReturnValueOnce(draftStream);
|
||||
|
||||
@@ -122,7 +122,8 @@ const UNICODE_TO_SLACK: Record<string, string> = {
|
||||
"🛠️": "hammer_and_wrench",
|
||||
"💻": "computer",
|
||||
};
|
||||
const SLACK_REASONING_TAG_RE = /<\s*(\/?)\s*(?:think(?:ing)?|thought|antthinking)\b[^<>]*>/gi;
|
||||
const SLACK_REASONING_TAG_RE =
|
||||
/<\s*(\/?)\s*(?:(?:antml:|mm:)?(?:think(?:ing)?|thought)|antthinking)\b[^<>]*>/gi;
|
||||
const SLACK_REASONING_LABEL_PREFIX_RE = /^\s*(?:>\s*)?Reasoning:\s*/iu;
|
||||
const SLACK_THINKING_LABEL_PREFIX_RE = /^\s*(?:>\s*)?Thinking\.{0,3}(?=\s*(?:\n|_))/iu;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user