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:
@@ -123,6 +123,7 @@ export async function promptWithModelSuggestionRetry(
|
|||||||
if (timeoutContext.wasTimedOut()) {
|
if (timeoutContext.wasTimedOut()) {
|
||||||
throw new Error(`promptAsync timed out after ${timeoutMs}ms`)
|
throw new Error(`promptAsync timed out after ${timeoutMs}ms`)
|
||||||
}
|
}
|
||||||
|
releasePromptAsyncReservation(args.path.id, "model-suggestion-retry")
|
||||||
throw error
|
throw error
|
||||||
} finally {
|
} finally {
|
||||||
timeoutContext.cleanup()
|
timeoutContext.cleanup()
|
||||||
|
|||||||
Reference in New Issue
Block a user