Skip to content

Conclusion job mis-flags an allowed out_of_credits rate_limit_event as Effective-Token-Budget exhaustion (false failure on successful runs) #40835

Description

@norrietaylor

The conclusion job files an [aw] … failed issue ("Effective Token Budget Exhausted" / rate-limit error) for runs that concluded success and produced their intended output, when the agent stream contains a rate_limit_event whose status is allowed but whose overage metadata is rejected / out_of_credits.

Root cause

The effective-token / rate-limit classifier in the conclusion job (collect-effective-tokens / handle_agent_failure in the generated .lock.yml) sets GH_AW_EFFECTIVE_TOKENS_RATE_LIMIT_ERROR=true from a rate_limit_event that did not throttle the request:

GH_AW_EFFECTIVE_TOKENS:                          # empty — no effective tokens counted
GH_AW_EFFECTIVE_TOKENS_RATE_LIMIT_ERROR: true
GH_AW_MAX_EFFECTIVE_TOKENS: 25000000
Effective tokens: (none)
Effective tokens rate-limit error: true

The event that trips it (Claude Code stream-json, claude_code_version 2.1.156):

{"type":"rate_limit_event","rate_limit_info":{"status":"allowed","resetsAt":1782154800,"rateLimitType":"five_hour","overageStatus":"rejected","overageDisabledReason":"out_of_credits","isUsingOverage":false}}

status: "allowed" means the request was served, not rate-limited. overageStatus: "rejected" / out_of_credits only reports that the account has overage disabled — it is account-billing metadata, not a throttle on this run. The classifier conflates "an event mentioning overage rejection exists" with "the run hit an effective-token budget limit," and emits a failure report even though GH_AW_EFFECTIVE_TOKENS is empty and the run succeeded.

Impact

Every successful run on an account with overage disabled (Claude Code Max, out of overage credits) files a spurious failure issue. In our operator repo this produced false [aw] … failed reports on runs that completed normally and posted their output (a weekly telemetry digest; a dependency-review chore that filed its results).

Expected

The classifier should not set the rate-limit-error flag, and should not emit "Effective Token Budget Exhausted", when:

  • the triggering rate_limit_event has status: "allowed" (request not throttled), AND/OR
  • GH_AW_EFFECTIVE_TOKENS is empty (no effective-token count was computed) AND the run concluded success.

overageStatus/overageDisabledReason are account-billing signals and should not by themselves mark a successful run as failed.

Environment

  • gh-aw: v0.77.5
  • engine: claude (claude-sonnet-4-6), claude_code_version 2.1.156
  • Trigger: scheduled and dependency-review workflows.

References

  • Downstream false-failure reports (now closed): gominimal/min-aw#493, gominimal/min-aw#497.
  • Evidence is from the conclusion-job log and the agent rate_limit_event stream of two runs whose conclusion was success.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions