fix(kotlin): Honor Retry-After for pool warmups - #1512
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a499814066
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| if (error is SandboxRateLimitException) { | ||
| run.rateLimitState.recordRateLimit(error.retryAfter) | ||
| scheduleRateLimitReconcile(run) |
There was a problem hiding this comment.
Keep rate-limit pool behavior aligned across SDKs
This branch makes HTTP 429 warmup failures stop contributing to degraded backoff only in Kotlin, but the same client-pool warmup exists in Python and Go and their reconcilers still count every thrown warmup error into record_failures/recordFailures (checked sdks/sandbox/python/src/opensandbox/_pool_reconciler.py:161-164 and sdks/sandbox/go/pool_reconciler.go:271-282). Without the same handling or a documented platform constraint, server 429/Retry-After produces different quota/back-pressure semantics across SDKs.
AGENTS.md reference: sdks/AGENTS.md:L122-L122
Useful? React with 👍 / 👎.
Summary
SandboxRateLimitExceptionduring Kotlin pool warmup completion and pause new warmups forRetry-After, with a 10-second default and the existing 60-second SDK cap.The rate-limit state is scoped to the active pool run, avoiding a shared
PoolStateStorecontract change and keeping this fix separate from the windowed degraded-detection work in #1499.Fixes #1500.
Testing
./gradlew :sandbox:test(324 tests, 0 failures)Retry-Afterrecovery and stop/start reset tests./gradlew spotlessCheckpnpm docs:buildBreaking Changes
Checklist