fix(doctor): scope discord off hint to legacy migration

This commit is contained in:
Vincent Koc 2026-03-22 12:40:31 -07:00
parent 285f903462
commit 59837b25bd
2 changed files with 19 additions and 1 deletions

View File

@ -32,6 +32,20 @@ describe("normalizeCompatibilityConfigValues preview streaming aliases", () => {
]);
});
it("does not label explicit discord streaming=false as a default-off case", () => {
const res = normalizeCompatibilityConfigValues({
channels: {
discord: {
streaming: false,
},
},
});
expect(res.config.channels?.discord?.streaming).toBe("off");
expect(res.config.channels?.discord?.streamMode).toBeUndefined();
expect(res.changes).toEqual(["Normalized channels.discord.streaming boolean → enum (off)."]);
});
it("explains why discord preview streaming stays off when legacy config resolves to off", () => {
const res = normalizeCompatibilityConfigValues({
channels: {

View File

@ -142,7 +142,11 @@ export function normalizeCompatibilityConfigValues(cfg: OpenClawConfig): {
`Normalized ${params.pathPrefix}.streaming (${beforeStreaming}) → (${resolved}).`,
);
}
if (params.pathPrefix.startsWith("channels.discord") && resolved === "off") {
if (
params.pathPrefix.startsWith("channels.discord") &&
resolved === "off" &&
hadLegacyStreamMode
) {
changes.push(
`${params.pathPrefix}.streaming remains off by default to avoid Discord preview-edit rate limits; set ${params.pathPrefix}.streaming="partial" to opt in explicitly.`,
);