Skip to content

fix: honor Gemini structured retry delays - #267

Open
mikemikimike wants to merge 3 commits into
AtomicBot-ai:mainfrom
mikemikimike:codex/atomic-agent-106-gemini-retry-info
Open

fix: honor Gemini structured retry delays#267
mikemikimike wants to merge 3 commits into
AtomicBot-ai:mainfrom
mikemikimike:codex/atomic-agent-106-gemini-retry-info

Conversation

@mikemikimike

@mikemikimike mikemikimike commented Aug 28, 2026

Copy link
Copy Markdown

Summary

Gemini's OpenAI-compatible endpoint can return its retry cooldown in error.details[].retryDelay without a Retry-After header. The existing OpenAI retry path ignored that value and could exhaust its bounded attempts before the server-advertised cooldown.

This change:

  • reads valid Google RetryInfo-style retryDelay values for 429 and 503 responses when the header is absent;
  • preserves valid Retry-After precedence and existing capped, cancellation-aware waits;
  • ignores malformed, negative, and non-finite durations.

Tests

  • npx vitest run src/llm/provider/openai/openai-http.test.ts — 27 passed
  • npx vitest run src/llm/provider/openai — 93 passed
  • npm run lint
  • npm run build

Validation note

The focused provider suite, type-check, and build pass locally. A full repository run on Windows completed with 6,302 of 6,317 tests passing; 11 unrelated test files failed and 4 tests were pending because of platform, tooling, and timing constraints in this environment, including ls/node ENOENT, Windows shell/PATH/path semantics, symlink expectations, and a concurrency timing case. No failure was in src/llm/provider/openai.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant