Skip to content

Commit dfbdab5

Browse files
chilu18Takhoffman
andauthored
fix(slack): map legacy streaming=false to off (openclaw#26020) thanks @chilu18
Verified: - pnpm build - pnpm check - pnpm test:macmini Co-authored-by: chilu18 <[email protected]> Co-authored-by: Tak Hoffman <[email protected]>
1 parent 9ae9439 commit dfbdab5

File tree

5 files changed

+28
-5
lines changed

5 files changed

+28
-5
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ Docs: https://docs.openclaw.ai
9696
- Slack/HTTP mode startup: treat Slack HTTP accounts as configured when `botToken` + `signingSecret` are present (without requiring `appToken`) in channel config/runtime status so webhook mode is not silently skipped. (#30567)
9797
- Slack/Usage footer formatting: wrap session keys in inline code in full response-usage footers so Slack does not parse colon-delimited session segments as emoji shortcodes. (#30258) Thanks @pushkarsingh32.
9898
- Slack/Socket Mode slash startup: treat `app.options()` registration as best-effort and fall back to static arg menus when listener registration fails, preventing Slack monitor startup crash loops on receiver init edge cases. (#21715)
99+
- Slack/Legacy streaming config: map boolean `channels.slack.streaming=false` to unified streaming mode `off` (with `nativeStreaming=false`) so legacy configs correctly disable draft preview/native streaming instead of defaulting to `partial`. (#25990) Thanks @chilu18.
99100
- Onboarding/Custom providers: raise default custom-provider model context window to the runtime hard minimum (16k) and auto-heal existing custom model entries below that threshold during reconfiguration, preventing immediate `Model context window too small (4096 tokens)` failures. (#21653) Thanks @r4jiv007.
100101
- Web UI/Assistant text: strip internal `<relevant-memories>...</relevant-memories>` scaffolding from rendered assistant messages (while preserving code-fence literals), preventing memory-context leakage in chat output for models that echo internal blocks. (#29851) Thanks @Valkster70.
101102
- Dashboard/Sessions: allow authenticated Control UI clients to delete and patch sessions while still blocking regular webchat clients from session mutation RPCs, fixing Dashboard session delete failures. (#21264) Thanks @jskoiz.

src/commands/doctor-legacy-config.test.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,21 @@ describe("normalizeCompatibilityConfigValues preview streaming aliases", () => {
3131
"Normalized channels.discord.streaming boolean → enum (partial).",
3232
]);
3333
});
34+
35+
it("normalizes slack boolean streaming aliases to enum and native streaming", () => {
36+
const res = normalizeCompatibilityConfigValues({
37+
channels: {
38+
slack: {
39+
streaming: false,
40+
},
41+
},
42+
});
43+
44+
expect(res.config.channels?.slack?.streaming).toBe("off");
45+
expect(res.config.channels?.slack?.nativeStreaming).toBe(false);
46+
expect(res.config.channels?.slack?.streamMode).toBeUndefined();
47+
expect(res.changes).toEqual([
48+
"Moved channels.slack.streaming (boolean) → channels.slack.nativeStreaming (false).",
49+
]);
50+
});
3451
});

src/config/config.legacy-config-detection.rejects-routing-allowfrom.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -597,7 +597,7 @@ describe("legacy config detection", () => {
597597
},
598598
},
599599
assert: (config: NonNullable<OpenClawConfig>) => {
600-
expect(config.channels?.slack?.streaming).toBe("partial");
600+
expect(config.channels?.slack?.streaming).toBe("off");
601601
expect(config.channels?.slack?.nativeStreaming).toBe(false);
602602
},
603603
},

src/config/discord-preview-streaming.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,9 +121,9 @@ export function resolveSlackStreamingMode(
121121
if (legacyStreamMode) {
122122
return mapSlackLegacyDraftStreamModeToStreaming(legacyStreamMode);
123123
}
124-
// Legacy `streaming` was a Slack native-streaming toggle; preview mode stayed replace.
124+
// Legacy boolean `streaming` values map to the unified enum.
125125
if (typeof params.streaming === "boolean") {
126-
return "partial";
126+
return params.streaming ? "partial" : "off";
127127
}
128128
return "partial";
129129
}

src/slack/stream-mode.test.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,17 @@ describe("resolveSlackStreamingConfig", () => {
4040
});
4141
});
4242

43-
it("moves legacy streaming boolean to native streaming toggle", () => {
43+
it("maps legacy streaming booleans to unified mode and native streaming toggle", () => {
4444
expect(resolveSlackStreamingConfig({ streaming: false })).toEqual({
45-
mode: "partial",
45+
mode: "off",
4646
nativeStreaming: false,
4747
draftMode: "replace",
4848
});
49+
expect(resolveSlackStreamingConfig({ streaming: true })).toEqual({
50+
mode: "partial",
51+
nativeStreaming: true,
52+
draftMode: "replace",
53+
});
4954
});
5055

5156
it("accepts unified enum values directly", () => {

0 commit comments

Comments
 (0)