Skip to content

A Gemini capacity error fails the thread as a provider error, so Resume after usage limits never continues it #38901

Closed as not planned

Description

@9kdr

What happened

Resume after usage limits only continues a thread whose latest failure is usage_limit and whose reset time is still ahead of that failure. limitRecoveryCommand in UsageLimitRecoveryWorker.ts returns nothing otherwise. At the reset it sends a server message, Continue where you left off. The thread can cancel that. A restart still sends a continuation that is overdue by up to 24 hours. Stopping the thread, sending a new message, archiving, or settling it disarms the pending continuation.

Antigravity does not put Gemini capacity on that path. In turnFailure (AntigravityTurnOutcome.ts, main 70e4319da82f), 429, RESOURCE_EXHAUSTED, and QUOTA_EXHAUSTED are usage_limit. Any other API failure is provider_error, and a 5xx is marked retryable. That includes 503 / UNAVAILABLE, which is how Gemini reports the model being overloaded or out of capacity. The thread ends failed. Nothing arms a continuation. A usage_limit with no resetAt is the same: docs/user/thread-sidebar.md says to press Resume, because nothing continues the turn on its own.

Codex serverOverloaded retries inside the turn (5 attempts, 2s to 30s, shipped in v0.1.4). That does not cover these Antigravity failures, and Gemini capacity lasts longer than that window.

Expected

A server setting next to Resume after usage limits, off by default: Resume after provider errors. When it is on, a thread that failed on a retryable provider_error is continued the same way:

  1. The continuation is the same server message, Continue where you left off., using native continuation when the provider supports it.
  2. The thread can cancel it. Stop, a new user message, archive, and settle disarm it.
  3. A restart still delivers an overdue continuation, with the same 24-hour bound.
  4. These failures usually have no reset time. Wait, then try again if the continuation fails with another retryable provider error, until the turn succeeds or the user cancels. Do not send the continuation immediately.
  5. Do not continue permission_error, validation_error, or a provider_error that is not retryable. The shell summary only stores lastErrorClass and lastErrorCode today, so the worker needs the failure's retryable flag.
  6. A quota stop that already has a reset time stays on Resume after usage limits.

Where

  • apps/server/src/orchestration-v2/UsageLimitRecoveryWorker.ts (limitRecoveryCommand requires usage_limit and usageLimitResetAt)
  • apps/server/src/provider/acp/AntigravityTurnOutcome.ts (turnFailure)
  • apps/web/src/components/settings/SettingsPanels.tsx, the Usage limits section
  • docs/user/thread-sidebar.md

Activity

  1. juliusmarminge commented on Nov 19, 2026

    @juliusmarminge
    Member

    Thanks for writing this up. It asks for new behaviour rather than reporting a defect, so it does not belong in the bug tracker and I'm closing it as not planned here. Feature ideas are discussed in Discussions: please post it there.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions