Help Center/ CodeArts Agent/ FAQs/ Tool Environment and Performance/ How Can I Handle Sliding Window Rate Limits?
Updated on 2026-07-30 GMT+08:00

How Can I Handle Sliding Window Rate Limits?

Symptom

When CodeArts Agent is used, one of the following error messages is displayed:

  • The current model's quota for the 5-hour window has been exhausted. It will gradually recover in 60 minutes.
  • The current model's quota for the 7-day window has been exhausted. It will gradually recover in 24 hours.

Cause Analysis

CodeArts Agent uses sliding window rate limiting to implement refined quota management for each user's usage on a specified model through dual-dimension and dual-window control.

  • Dual-dimension monitoring
    • Token quota: calculated based on the total number of tokens consumed by a user
    • Request frequency: calculated based on the number of inference requests initiated by a user
  • Dual-window mechanism
    • 5-hour sliding window: current hour + four complete hours before the current hour. When a new hour (xx:00) starts, the usage of the earliest hour automatically slides out of the window, and the corresponding quota is released.
    • 7-day sliding window: current day + six complete days before the current day. When a new day (00:00) starts, the usage of the earliest day automatically slides out of the window, and the corresponding quota is released.

The two mechanisms work together to implement refined usage management, ensuring stable system operation and fair and sustainable resource allocation.

Solution

  • Method 1: Wait for automatic recovery (the system dynamically releases the quota based on the time window).
    • 5-hour window: The quota for the earliest hour is released at the next full hour (for example, xx:00).
    • 7-day window: The quota for the earliest day is released at 00:00 on the next day.

    If there is no actual usage within the sliding period, the corresponding quota is not released. The final recovery time depends on when the time period of the earliest usage slides out.

  • Method 2: Switch to another model.

    The sliding window quota is calculated independently for each model. When the current model is rate-limited, you can immediately switch to another available model without waiting.

  • Method 3: Upgrade the package (effective immediately).

    Advanced packages provide higher token quotas and request frequencies under the sliding window mechanism. You can contact your enterprise administrator to upgrade the yearly/monthly package by referring to Subscriptions. The upgrade takes effect immediately to ensure that services are not affected.