fix(coding-agent): respected google retry hints
Parsed provider retry hint text before falling back to quota cooldowns so Google per-minute token limits use the server-provided delay. Fixes #1253
This commit is contained in:
@@ -76,6 +76,7 @@ import {
|
||||
} from "@oh-my-pi/pi-ai";
|
||||
import { MacOSPowerAssertion } from "@oh-my-pi/pi-natives";
|
||||
import {
|
||||
extractRetryHint,
|
||||
getAgentDbPath,
|
||||
isEnoent,
|
||||
isUnexpectedSocketCloseMessage,
|
||||
@@ -6949,6 +6950,11 @@ export class AgentSession {
|
||||
}
|
||||
}
|
||||
|
||||
const retryHintMs = extractRetryHint(undefined, errorMessage);
|
||||
if (retryHintMs !== undefined) {
|
||||
return retryHintMs;
|
||||
}
|
||||
|
||||
const resetMsMatch = /x-ratelimit-reset-ms\s*[:=]\s*(\d+)/i.exec(errorMessage);
|
||||
if (resetMsMatch) {
|
||||
const resetMs = Number(resetMsMatch[1]);
|
||||
|
||||
Reference in New Issue
Block a user