fix(discord): avoid false model picker mismatch warning (#39105)

Land #39105 by @akropp.

Co-authored-by: Adam Kropp <adam@thekropp.com>
This commit is contained in:
Peter Steinberger
2026-03-07 19:32:35 +00:00
parent 17ab46aedd
commit 724d2d58fa
2 changed files with 6 additions and 0 deletions

View File

@@ -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

View File

@@ -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,