fix(model-suggestion-retry): release reservation on async error path

The promptWithModelSuggestionRetry async variant did not release the
post-dispatch reservation when the wrapped promptAsync threw. Callers
that immediately retry (such as sendSyncPrompt error toast paths) hit
the gate as reserved and surfaced 'promptAsync skipped by gate: reserved'
instead of the underlying error.

Mirrors the existing sync variant fix from ff1b15d53.

Closes regression introduced by BLOCKER-2 hardening
This commit is contained in:
YeonGyu-Kim
2026-05-16 01:56:04 +09:00
parent 5a8bd05db0
commit 102d067022
+1
View File
@@ -123,6 +123,7 @@ export async function promptWithModelSuggestionRetry(
if (timeoutContext.wasTimedOut()) {
throw new Error(`promptAsync timed out after ${timeoutMs}ms`)
}
releasePromptAsyncReservation(args.path.id, "model-suggestion-retry")
throw error
} finally {
timeoutContext.cleanup()