Skip to content

Pacing queue overload surfaces as 502 upstream_error instead of retryable 429 on fetchResponse and rebuildAndRefetch paths #1790

Closed

Description

@SOSANA

Client or integration

Direct HTTP/API client

Area

Proxy and routing

Summary

waitForProviderRequestSlot throws RequestPacingQueueOverloadError when a provider's request-pacing queue is full. The runTurn path in src/server/responses/core.ts (around line 3247) translates that error into a retryable 429 rate_limit_error event, but the generic transport catches around the initial fetchResponse dispatch (around lines 3451-3480) and rebuildAndRefetch (around lines 3544-3565) convert every error into 502 upstream_error. Under pacing-queue pressure, requests dispatched through those paths receive a 502 instead of the retryable-429 contract used elsewhere for the same condition.

Additionally, noteAttemptSend runs before waitForProviderRequestSlot admits the request on the fetchResponse branch (around line 3457), so overload-rejected requests still inflate the attempt send count.

Reproduction

Found by code review while working on #1743; not yet reproduced at runtime. Code-path walkthrough against dev @ 4b950101a1116d8bac4e479cb2dceca3bb80370e:

  1. Configure a provider with request pacing where the queue capacity is small relative to the burst.
  2. Send a burst of /v1/responses requests routed through a provider adapter that uses fetchResponse, or trigger the rebuild/refetch retry path.
  3. When the pacing queue is full, waitForProviderRequestSlot throws RequestPacingQueueOverloadError (src/server/responses/core.ts:3451 or :3545).
  4. The surrounding catch converts it to 502 upstream_error (lines ~3473-3480 / ~3560-3565) instead of the retryable 429 shape the runTurn path produces at ~3247.

Expected: the same retryable-429 mapping as the runTurn path, with noteAttemptSend moved after successful pacing admission so rejected requests do not count as sends.

Version

dev @ 4b950101a1116d8bac4e479cb2dceca3bb80370e (pre-existing path; unchanged by #1743)

Operating system

Linux (Debian 13); the code path is platform-independent

Provider and model

Any forward-auth Responses provider with request pacing configured

Logs or error output

No response

Screenshots and supporting files

No response

Redacted configuration

No response

Checks

  • I searched existing issues and documentation.
  • I removed secrets, tokens, account details, request credentials, and personal data.

Activity

  1. coderabbitai commented on Aug 15, 2026

    @coderabbitai
    Contributor
    🔗 Related PRs

    #463 - fix(proxy): stop empty 503 bodies becoming Codex Unknown error (#452) [merged]
    #599 - fix: scope Spark cooldowns to its native quota [merged]
    #749 - fix(responses): reject expired forward continuations [merged]
    #865 - feat(proxy): opt-in same-target 429 wait-and-retry before key failover (#487) [merged]
    #1752 - feat: land four rebuilt heavy drafts (service tiers, request pacing, native chat, empty-completion guard) [merged]


    📝 Issue Planner

    Check the box below or use the @coderabbitai plan command to generate an implementation plan and prompts that you can use with your favorite coding assistant.

    • Create Plan

    🧪 Issue enrichment is currently in open beta.

    To disable automatic issue enrichment, add the following to your .coderabbit.yaml:

    issue_enrichment:
      auto_enrich:
        enabled: false

    💬 Have feedback or questions? Drop into our discord!

  2. added
    bugSomething isn't working
    providerProvider adapters, OpenAI-compat presets, upstream API quirks
    proxyHTTP proxy, routing, reverse-proxy / management auth
    on Aug 15, 2026
  3. Wibias commented on Aug 16, 2026

    @Wibias
    Contributor

    Fixed on dev.

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

    bugSomething isn't workingproviderProvider adapters, OpenAI-compat presets, upstream API quirksproxyHTTP proxy, routing, reverse-proxy / management auth

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions