Context
A production code-review run with CLI 0.4.3 and zai-coding-plan/glm-5.3 reached the provider’s five-hour rolling usage limit. The CLI treated that response as retryable, made ten retry attempts, and remained alive until the executor's two-hour deadline.
Problem / Goal
A provider response that says its usage limit will reset hours later cannot be recovered within a normal task-execution deadline. Retrying it keeps executions appearing to run while consuming capacity, then reports a timeout instead of the actionable provider limit.
Reproduction
- Configure a provider response that is marked retryable and says
Usage limit reached for 5 hour with a reset time beyond the task deadline.
- Run
aictrl run --format json.
- Observe the current session retry loop accepts the long delay and retries until the outer executor timeout.
- Expected: classify this rolling usage-limit response as terminal, emit the normal structured failure lifecycle, and exit non-zero without sleeping/retrying.
Environment
- CLI:
@aictrl/cli 0.4.3
- Provider/model: Z.ai GLM-5.3 Coding Plan
- Downstream executor deadline: two hours
Proposed Approach
In src/session/retry.ts, recognize provider usage-limit/reset responses as non-retryable before the retry delay is accepted. Preserve ordinary transient rate-limit retries, and keep the terminal session_error / invocation completion events and error text available to headless consumers.
Acceptance Criteria
Out of Scope
- Changing retry policy for all provider errors.
- Product dashboard/heartbeat instrumentation (handled downstream).
- Retrying automatically after the provider reset time.
Roadmap Alignment
- Pillar: EXEC
- Priority: P1 — production reliability and operator diagnosis.
- Milestone: Enterprise Observability
References
Context
A production code-review run with CLI 0.4.3 and
zai-coding-plan/glm-5.3reached the provider’s five-hour rolling usage limit. The CLI treated that response as retryable, made ten retry attempts, and remained alive until the executor's two-hour deadline.Problem / Goal
A provider response that says its usage limit will reset hours later cannot be recovered within a normal task-execution deadline. Retrying it keeps executions appearing to run while consuming capacity, then reports a timeout instead of the actionable provider limit.
Reproduction
Usage limit reached for 5 hourwith a reset time beyond the task deadline.aictrl run --format json.Environment
@aictrl/cli0.4.3Proposed Approach
In
src/session/retry.ts, recognize provider usage-limit/reset responses as non-retryable before the retry delay is accepted. Preserve ordinary transient rate-limit retries, and keep the terminalsession_error/ invocation completion events and error text available to headless consumers.Acceptance Criteria
Usage limit reachedand a future reset is not retried.Out of Scope
Roadmap Alignment
References