From b36a3a329595ced74b6cf4c5aae52cf2fdefe143 Mon Sep 17 00:00:00 2001 From: kiranvk2011 Date: Fri, 3 Apr 2026 13:42:04 +0000 Subject: [PATCH] fix: add .catch() to fire-and-forget stale-flag clear to prevent unhandled rejection --- src/agents/live-model-switch.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/agents/live-model-switch.ts b/src/agents/live-model-switch.ts index 3b9a63a4763..ad869cd7121 100644 --- a/src/agents/live-model-switch.ts +++ b/src/agents/live-model-switch.ts @@ -178,10 +178,12 @@ export function shouldSwitchToLiveModel(params: { // Current model already matches the persisted selection — the switch has // effectively been applied. Clear the stale flag so subsequent fallback // iterations don't re-evaluate it. - void clearLiveModelSwitchPending({ + clearLiveModelSwitchPending({ cfg, sessionKey, agentId: params.agentId, + }).catch(() => { + /* best-effort — fs/lock errors are non-fatal here */ }); return undefined; }