fix(doctor): stop repeat talk normalization loop from key order

This commit is contained in:
evann 2026-04-02 18:39:09 -02:30 committed by masonxhuang
parent 022618e887
commit 1c450b5e13
2 changed files with 24 additions and 1 deletions

View File

@ -759,6 +759,28 @@ describe("normalizeCompatibilityConfigValues", () => {
]);
});
it("does not report talk provider normalization for semantically identical key ordering differences", () => {
const input = {
talk: {
interruptOnSpeech: true,
silenceTimeoutMs: 1500,
providers: {
elevenlabs: {
apiKey: "secret-key",
voiceId: "voice-123",
modelId: "eleven_v3",
},
},
provider: "elevenlabs",
},
};
const res = normalizeCompatibilityConfigValues(input);
expect(res.config).toEqual(input);
expect(res.changes).toEqual([]);
});
it("migrates tools.message.allowCrossContextSend to canonical crossContext settings", () => {
const res = normalizeCompatibilityConfigValues({
tools: {

View File

@ -1,5 +1,6 @@
import { migrateVoiceCallLegacyConfigInput } from "../../extensions/voice-call/config-api.js";
import { normalizeProviderId } from "../agents/model-selection.js";
import { isDeepStrictEqual } from "node:util";
import { shouldMoveSingleAccountChannelKey } from "../channels/plugins/setup-helpers.js";
import type { OpenClawConfig } from "../config/config.js";
import { resolveNormalizedProviderModelMaxTokens } from "../config/defaults.js";
@ -386,7 +387,7 @@ export function normalizeCompatibilityConfigValues(cfg: OpenClawConfig): {
return;
}
const sameShape = JSON.stringify(normalizedTalk) === JSON.stringify(rawTalk);
const sameShape = isDeepStrictEqual(normalizedTalk, rawTalk);
if (sameShape) {
return;
}