Skip to content

[aw-failures] Daily Max Ai Credits Test job fails despite recording real token/credit usage #49143

Description

@github-actions

Fix the credit-ceiling handling in this workflow — it should exit successfully when it hits the AI-credits cap, not crash the job.

Problem

Run 30539804771 (2026-07-30, scheduled trigger) concluded failure in the agent job at the Execute GitHub Copilot CLI step, but the run recorded real usage: input_tokens: 3902, output_tokens: 163, cache_write_tokens: 39832, ai_credits: 10.901. The firewall trace shows 6/6 requests to api.githubcopilot.com allowed, 0 blocked — the Copilot CLI genuinely ran and did work. Turns: 0 was recorded even though token usage is non-zero.

Affected workflow / run

Probable root cause

This workflow's stated purpose is to probe the AI-credits ceiling. Hitting that ceiling should be the expected, successful outcome of the test (report the number and exit 0). Instead the job step ends in conclusion: failure, which strongly suggests the workflow's post-processing script does not recognize/handle a credit-limit response from the Copilot CLI as a valid terminal state — it likely treats any non-zero Copilot CLI exit code as a hard failure rather than parsing the declared ai_credits_rate_limit_error output and completing gracefully.

This is mechanically distinct from the PR Code Quality Reviewer Copilot CLI issue (#49022): that case shows zero tokens recorded despite requests going out (a silent/broken response path), whereas this run shows real, non-zero usage recorded alongside a failure conclusion (a result-interpretation bug). Do not conflate the two fixes.

Proposed remediation

  1. In the workflow's post-run/output-evaluation script, treat a Copilot CLI credit-limit signal (ai_credits_rate_limit_error) as a successful test completion, not a job failure — set the job/step conclusion accordingly (e.g. exit 0 and surface the credit number as a normal output).
  2. If the Copilot CLI itself is exiting non-zero on hitting the cap, confirm whether that's expected engine behavior and adjust the wrapping script's exit-code handling to match.
  3. Add a regression test/fixture that simulates a credit-limit response and asserts the job concludes success.

Success criteria

  • A subsequent scheduled run of Daily Max Ai Credits Test that hits the credit ceiling concludes with conclusion: success and reports the consumed credits as a normal output, not a failed job.
  • No change to behavior when the Copilot CLI fails for a genuinely unexpected reason (auth, network) — those should still fail the job.

Parent report: #49095. Analyzed via agenticworkflows audit on run 30539804771 during the 2026-07-30 13:19 UTC failure-investigation pass.
Related to #49095

Generated by 🔍 [aw] Failure Investigator (6h) · agent · 180.1 AIC · ⌖ 21.7 AIC · ⊞ 6.8K ·

  • expires on Aug 6, 2026, 5:37 AM UTC-08:00

Second manifestation found — activation-job guardrail, different workflow — 2026-07-31 pass

Apply the same "credit-limit-exceeded is a success signal, not a failure" fix here too — this design flaw isn't isolated to the agent-job Copilot CLI path.

Run §30634120384 ("Daily Credit Limit Test", activation job) hard-fails before the agent job ever starts: the daily-workflow-aic guardrail script computes currentAIC: 12.62 against threshold: 1, sets exceeded: true, then emits ##[error]Daily workflow AIC guardrail exceeded for Daily Credit Limit Test: 12.62/1 — failing the activation job and skipping the agent/detection jobs entirely.

This is mechanically distinct from this issue's original bug (do not conflate): that case is a Copilot CLI response-interpretation bug in the agent job of daily-max-ai-credits-test.lock.yml; this one is a hard ##[error] raised by the activation-job guardrail script of a different workflow, daily-credit-limit-test.lock.yml. Same underlying design flaw — hitting an expected credit ceiling should be a recorded success, not a failed job — but two separate code paths need two separate, coordinated fixes.

Proposed remediation (activation-job path)

  • Update the daily-workflow-aic guardrail so an intentional credit-ceiling test exits as a graceful early-success (skip agent job, neutral/success conclusion) instead of raising a hard ##[error].

No new issue filed — cross-referencing for coordinated fix planning; do not merge with the original agent-job fix.

Generated by 🔍 [aw] Failure Investigator (6h) · agent · 249.9 AIC · ⌖ 19.3 AIC · ⊞ 6.8K ·

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions