Repository navigation
fix(ai): name an exhausted usage limit first and do not retry it - #110
Merged
Merged
Conversation
…d usage limit
A sample run stopped with "AI command failed: warning: Untrusted project-local
configuration is disabled. ...": the agent CLI's first stderr line was a
benign warning, and the real cause ("ERROR: You've hit your usage limit. ...
try again at <time>") sat near the end. The call was also retried as a
transient transport error because the long transcript contained transport
words.
- The failure message puts the CLI's last own error line ("error:", "ERROR:",
"fatal:") first; the full detail follows unchanged.
- An error line saying the usage limit, quota or credits are exhausted makes
the failure non-transient, so it is not auto-retried. Only the CLI's error
lines count, not words anywhere in the transcript.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014yyaLv8ZQ3GiQnmizx4cqb
Review follow-up.
- Only an exhausted usage limit or credit balance ("usage limit", "purchase
more credits", "out of credits", "insufficient credits") in the CLI's last
own error line changes anything; per-minute quotas and rate limits stay
transient, and earlier "ERROR:" lines the agent printed while working do not
count.
- Only that case gets a headline; every other failure keeps its message
byte for byte (existing exact-message tests are unchanged).
- The caller-side retry loop (`retries=`) no longer retries it either, and a
usage line that is already the first line is recognised.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014yyaLv8ZQ3GiQnmizx4cqb
CoDD Audit❌ Audit failed to run. Check workflow logs. |
Coverage Matrix ReportProject: /home/runner/work/codd-dev/codd-dev
Totals: 369 axes, 176 covered signals (47.70%), 193 unknown. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
A sample run stopped with
AI command failed: warning: Untrusted project-local configuration is disabled. .... The agent CLI's first stderr line was a benign warning; the real cause was near the end:ERROR: You've hit your usage limit. ... try again at <time>. The call was also retried once as a "transient transport error" because the long transcript happened to contain transport words, and failed again the same way.Change
error:,ERROR:,fatal:) says the usage limit or credit balance is exhausted (usage limit,purchase more credits,out of credits,insufficient credits), that line is put first in theAI command failed:message so the one-line stage summary names it; the full detail follows unchanged.retries=loop.429,quota exceeded for ... per minute) stay transient; earlierERROR:lines the agent printed while working do not count.Tests
tests/test_ai_failure_headline.py(6 cases: headline and no retry for an exhausted usage limit, also withretries=2and when it is already the first line; per-minute quota still retried; earlier log error lines do not block a transient retry; other failure messages unchanged). Onmainthe usage-limit cases fail (the warning is the first line and the call is retried).tests/test_ai_invoke*.py+ the new file: 120 passed.mainhere (realtsc/npmthrough the Windows toolchain); the threereal_tsctests that differ between the two runs fail identically on both when run alone.🤖 Generated with Claude Code
https://claude.ai/code/session_014yyaLv8ZQ3GiQnmizx4cqb