Skip to content

fix(kotlin): Honor Retry-After for pool warmups - #1512

Open
Gujiassh wants to merge 1 commit into
opensandbox-group:mainfrom
Gujiassh:fix/kotlin-pool-retry-after-1500
Open

fix(kotlin): Honor Retry-After for pool warmups#1512
Gujiassh wants to merge 1 commit into
opensandbox-group:mainfrom
Gujiassh:fix/kotlin-pool-retry-after-1500

Conversation

@Gujiassh

Copy link
Copy Markdown
Contributor

Summary

  • Preserve SandboxRateLimitException during Kotlin pool warmup completion and pause new warmups for Retry-After, with a 10-second default and the existing 60-second SDK cap.
  • Keep rate-limit throttling separate from degraded failure accounting, extend concurrent deadlines monotonically, and schedule a reconcile as soon as the throttle expires.
  • Keep idle reaping and shrink active during throttling, reset the local throttle on pool restart, and document the behavior.

The rate-limit state is scoped to the active pool run, avoiding a shared PoolStateStore contract change and keeping this fix separate from the windowed degraded-detection work in #1499.

Fixes #1500.

Testing

  • Not run (explain why)
  • Unit tests: ./gradlew :sandbox:test (324 tests, 0 failures)
  • Integration tests
  • e2e / manual verification: focused one-second Retry-After recovery and stop/start reset tests
  • ./gradlew spotlessCheck
  • pnpm docs:build

Breaking Changes

  • None
  • Yes (describe impact and migration path)

Checklist

  • Linked Issue or clearly described motivation
  • Added/updated docs (if needed)
  • Added/updated tests (if needed)
  • Security impact considered
  • Backward compatibility considered

@github-actions github-actions Bot added documentation Improvements or additions to documentation sdk/java sdks size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Aug 14, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment on lines +1187 to +1189
if (error is SandboxRateLimitException) {
run.rateLimitState.recordRateLimit(error.retryAfter)
scheduleRateLimitReconcile(run)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

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

Labels

documentation Improvements or additions to documentation sdk/java sdks size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Kotlin SandboxPool ignores Retry-After on rate-limited warmup creates

1 participant