Skip to content

provider-reset: probe-park long declared resets (5min max per park) - #2

Merged
IEatCodeDaily merged 10000 commits into
mainfrom
fix/provider-reset-probe-park
Nov 15, 2026
Merged

IEatCodeDaily merged 10000 commits into
mainfrom
fix/provider-reset-probe-park

Conversation

@IEatCodeDaily

Copy link
Copy Markdown
Owner

Provider-reset probe park — never sleep a whole declared reset in one call

agent/turn_provider_reset.py::wait_for_provider_reset parks a retry on a
provider's DECLARED reset with a single interruptible_backoff_sleep of the
entire duration (up to the 6h total cap). Verified incident: a combo whose
secondary account returned "Individual quota reached … reset after 4h 58m"
parked four in-flight turns ~5h while the primary account was already serving
again 16 minutes later.

Fix (smallest shared-seam diff)

Each park now sleeps at most a ~5-minute probe interval (+jitter) and returns
continue to re-probe. An aggregator whose other account recovered succeeds
within ~5 minutes; a still-limited probe re-parks with the fresh declared
reset. Unchanged: the 6h total deadline against the declared reset, the retry
budget, interruptibility, and the redirected-messages break path.

Tests

tests/agent/test_provider_reset_wait.py gains
test_five_hour_reset_parks_in_probe_intervals (5h declared reset → first
park within the probe bound, attempt budget untouched, second error re-parks,
deadline still enforced); the three existing full-sleep assertions move to the
probe bound. All focused suites pass; RED evidence is the pre-fix assertion
set itself (full-sleep bounds), which this change intentionally invalidates.

Notes

  • The park already emits diagnostic status/wait lines (⏳ Provider cooldown…),
    so the visible "waiting for provider reset" surfacing on ACP clients comes
    from the existing emissions — no new display code in this PR.
  • Fleet-local module: this branch is based on the fleet line (e035263) that
    carries the turn_api_error/retry_utils/turn_retry_state park plumbing.

Loading
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.