diff --git a/CHANGELOG.md b/CHANGELOG.md index 37c262be5..f35c53281 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -259,6 +259,7 @@ Docs: https://docs.openclaw.ai - Models/merge mode provider precedence: when `models.mode: "merge"` is active and config explicitly sets a provider `baseUrl`, keep config as source of truth instead of preserving stale runtime `models.json` `baseUrl` values; includes normalized provider-key coverage. (#39103) Thanks @BigUncle. - UI/Control chat tool streaming: render tool events live in webchat without requiring refresh by enabling `tool-events` capability, fixing stream/event correlation, and resetting/reloading stream state around tool results and terminal events. (#39104) Thanks @jakepresent. - Models/provider apiKey persistence hardening: when a provider `apiKey` value equals a known provider env var value, persist the canonical env var name into `models.json` instead of resolved plaintext secrets. (#38889) Thanks @gambletan. +- Discord/model picker persistence check: add a short post-dispatch settle delay before reading back session model state so picker confirmations stop reporting false mismatch warnings after successful model switches. (#39105) Thanks @akropp. ## 2026.3.2 diff --git a/src/discord/monitor/native-command.ts b/src/discord/monitor/native-command.ts index 401c30f01..1ac9d582a 100644 --- a/src/discord/monitor/native-command.ts +++ b/src/discord/monitor/native-command.ts @@ -937,6 +937,11 @@ async function handleDiscordModelPickerInteraction( return; } + // The session store write happens asynchronously after the command dispatch + // completes. Give it a short window to flush before reading back the persisted + // value, otherwise the check races the write and reports a false mismatch. + await new Promise((resolve) => setTimeout(resolve, 250)); + const effectiveModelRef = resolveDiscordModelPickerCurrentModel({ cfg: ctx.cfg, route,