Skip to content

Feature set 127. - #54

Merged
jackfperryjr merged 1 commit into
mainfrom
features-127
Aug 3, 2026
Merged

Feature set 127.#54
jackfperryjr merged 1 commit into
mainfrom
features-127

Conversation

@jackfperryjr

Copy link
Copy Markdown
Owner

Makes the generator say what stopped it, and stop when stopping is the right answer.

On 2026-08-03 a 400-image batch ran for the full six-hour job ceiling, attempted ~70 candidates
and generated none, logging gave up after repeated rate limiting every five minutes. It was not
rate limited. The account had run out of prepaid credit, which Gemini reports as
429 RESOURCE_EXHAUSTED — the same status as throttling — with this body:

"Your prepayment credits are depleted. Please go to AI Studio at https://ai.studio/projects ..."

Only a per-day quota ended a run, so this read as a burst limit and was retried forever. The 429
body was parsed to classify it and then discarded, never logged, so nothing in six hours of output
said what was actually wrong. The first accurate signal was a billing page showing no spend.

What changed

  • ClassifyRefusal sorts a 429 into Burst, DailyQuota or CreditsExhausted. Credit
    exhaustion is matched first because it is the only one carrying no details array, so checking
    it after the quota tests would fall through them.
  • Depleted credit now halts the run like a spent daily quota, via GenerationHaltedException
    carrying the kind, a reason and the detail. DailyQuotaSpentException is folded into it.
  • The closing summary names the cause and the remedy, which differ: waiting out a reset that
    no clock will bring is as useless as topping up a healthy account.
  • The halt line reports elapsed time and images made, so the log says what stopped it and when.
  • The first unrecognised 429 of a run is logged in full, truncated at 800 characters. Prose is
    free to change, and the next unnamed refusal should cost minutes to diagnose rather than hours.
  • gave up after N refusals — last was: <detail> replaces the old line, which asserted "rate
    limiting" about refusals it had never inspected.

Six tests cover the new classifier against a verbatim capture of the depleted-credit body, the
per-minute limit it must not be confused with, and unreadable bodies, which stay retryable.

Release notes

  • Image generation now stops immediately when the Gemini account runs out of prepaid credit,
    instead of retrying for hours, and reports the cause, the elapsed time and the fix.
  • Unrecognised rate-limit responses are logged in full so an unknown refusal can be diagnosed.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@jackfperryjr
jackfperryjr merged commit aa196d3 into main Aug 3, 2026
1 check passed
@jackfperryjr
jackfperryjr deleted the features-127 branch August 3, 2026 18:55
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