Skip to content

fix(agent): quota枯渇時のagy失敗を quota-exhausted に分類する (#229) - #230

Merged
rebuildup merged 1 commit into
release/rex-remotefrom
229
Nov 23, 2026
Merged

rebuildup merged 1 commit into
release/rex-remotefrom
229

Conversation

@rebuildup

@rebuildup rebuildup commented Nov 23, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • Issue eval(agent): agy 視覚レビューの品質評価(検出率・誤検出・根拠・使用量) #226 の評価実行中、Claude/GPT 5時間枠の枯渇で agy が exit 3 + RESOURCE_EXHAUSTED (code 429) を返した際、classifier が agy-error / auth-required に誤分類することを確認
  • run.code !== 0 分岐で quota 枯渇シグナル(RESOURCE_EXHAUSTED / quota reached / rate limit / 429)を auth heuristic より先に判定し quota-exhausted に分類
  • preflight --min-remaining gate の既存挙動は変更なし

Test plan

  • bun test script/agent.agy-review.test.ts — 34 pass(RESOURCE_EXHAUSTED → quota-exhausted、quota+auth混在stderrでquota優先の2件追加)
  • bunx tsc --noEmit clean
  • ./script/test ./script/test-workflow ./script/check-secrets pass
  • 実機観測値(Individual quota reached ... Resets in 2h37m)を再現する stub で分類を確認

Generated with Devin

Summary by CodeRabbit

  • Bug Fixes
    • Errors indicating that an AI review quota has been exhausted are now reported as quota-related, including when the error output also contains authentication messages. This provides a clearer distinction between quota limits and authentication issues when an AI review cannot complete.

…229)

agy exits 3 with RESOURCE_EXHAUSTED (code 429) when the model quota
window is exhausted. The classifier mapped these to agy-error or, when
the error payload tripped the auth heuristic, auth-required. Check for
quota-exhaustion signals before the auth heuristic so callers can
distinguish quota deferral from credential failure.

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@coderabbitai

coderabbitai Bot commented Nov 23, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

For nonzero agy exits, the classifier checks stdout and stderr for quota-exhaustion indicators before applying the authentication heuristic. Tests cover quota-only output and output containing both quota and authorization errors.

Changes: agy quota classification

Layer / File(s) Summary
Nonzero exit classification
script/agent/agy-review.ts, script/agent.agy-review.test.ts
The classifier checks for quota indicators before the authentication heuristic. Tests cover RESOURCE_EXHAUSTED and mixed quota and authorization errors.

Estimated code review effort: 2 (Simple) | ~8 minutes

Change: Bug fix

Possibly related issues

  • Issue 229: The PR implements quota classification for mid-run failures and checks quota indicators before authentication, as requested.

Possibly related PRs

  • rebuildup/dotfiles#222: This PR changes how the agy review harness introduced there classifies nonzero exits.
Merge Risk: Minimal · up to 9e52c

This change classifies mid-run quota exhaustion separately from authentication failures, so callers can defer on quota instead of treating it as a credential problem. The change is small and tested, and no merge-blocking risk is evident.

Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title names the main change: when the agy command fails after quota exhaustion, the failure is classified as quota-exhausted. The raw summary and PR objectives both describe this classification ch…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the main change: when the agy command fails after quota exhaustion, the failure is classified as quota-exhausted. The raw summary and PR objectives both describe this classification change in script/agent/agy-review.ts, with tests added to script/agent.agy-review.test.ts. The title is in Japanese, which is acceptable for this check. It is specific and matches the changeset. The scope prefix and issue number are minor and do not affect relevance.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 7145e9f and 9e52cb3.

Files selected for processing: 2

  • script/agent.agy-review.test.ts
  • script/agent/agy-review.ts

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

@rebuildup
rebuildup merged commit 7477f18 into release/rex-remote Nov 23, 2026
4 checks passed
@rebuildup
rebuildup deleted the 229 branch November 23, 2026 11:21
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.

1 participant