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

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