[aw] Primer API Review exceeded max AI credits

Open
#8,433 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
38/100
Issue type
Bug
Clarity
Needs clarification
Activity status
Active
Tech stack
github-actions
Domain
ci-cd, devops

Research direction

Inspect .github/workflows/primer-api-review.md and the linked Actions run first. Check the configured model, max-ai-credits limit, and provider authentication against the reported failures; done means the Primer API Review workflow completes successfully without the same model, credit, or authentication errors.

Written by the indexing model from the issue text.

Description

agentic-workflows
Workflow Failure

Workflow: Primer API Review
Branch: main
Run: https://github.com/primer/react/actions/runs/35580962225

[!WARNING]
Invalid or Unsupported Model: The agent failed because the configured model name is invalid, unknown, or unavailable for this engine/account.

This is a configuration issue, not a transient error — retrying will not help.

How to fix this

Specify a valid model for the selected engine in the workflow frontmatter:

---
engine: copilot
model: gpt-5-mini
---

To find valid models, check your engine/provider documentation (for Copilot see supported models).

If the error text is No model available. Check policy enablement under GitHub Settings > Copilot, the model is not disabled in the workflow but by Copilot policy. Enable the model under GitHub Settings > Copilot > Policies for the org/repo, or pick a model that is already enabled. This can also be triggered by a subagent (task tool) dispatch requesting a model that the policy does not allow, even when the main agent's model is enabled.

[!WARNING]
AI Credits Budget Exceeded

The workflow hit the configured max-ai-credits guardrail. Used 1K of 1K max (over by 10.1).

Increase the limit

Update max-ai-credits in your workflow frontmatter:

max-ai-credits: 2000
Tips for reducing AI credit usage
  • Review the cost optimization guidance.
  • Reduce unnecessary model or tool calls in the prompt.
  • Trim large inputs or excess context that does not change the outcome.
  • Split large tasks across smaller runs when possible.

[!WARNING]
Engine Failure: The copilot engine terminated unexpectedly.

Last agent output:

  Check your COPILOT_PROVIDER_API_KEY, COPILOT_PROVIDER_API_KEY_COMMAND, or COPILOT_PROVIDER_BEARER_TOKEN.
Changes    +0 -0
Duration   16m 15s
Tokens     ↑ 19.9m (19.0m cached) • ↓ 439.8k
Resume     copilot --resume=4dd36fd7-e660-4c01-8497-62c7ceac24dc
Authentication failed with provider at http://172.30.0.30:10002 (HTTP 403).
  Check your COPILOT_PROVIDER_API_KEY, COPILOT_PROVIDER_API_KEY_COMMAND, or COPILOT_PROVIDER_BEARER_TOKEN.
Changes    +0 -0
Duration   0s
Resume     copilot --resume=11daa582-ad09-4edc-b045-643b64a37890
Action Required

Assign this issue to an agent to debug and fix the issue.

Optimize token consumption

This failure was triggered by a guardrail limit (max-ai-credits). Use this prompt with any coding agent (GitHub Copilot, Claude, Gemini, etc.) to analyze token usage and reduce costs:

Optimize the agentic workflow token consumption using https://raw.githubusercontent.com/github/gh-aw/main/optimize.md

The workflow run is at https://github.com/primer/react/actions/runs/35580962225
Debug with any coding agent

Use this prompt with any coding agent (GitHub Copilot, Claude, Gemini, etc.):

Debug the agentic workflow failure using https://raw.githubusercontent.com/github/gh-aw/main/debug.md

The failed workflow run is at https://github.com/primer/react/actions/runs/35580962225
Manually invoke the agent

Debug this workflow failure using your favorite Agent CLI and the agentic-workflows prompt.

[!TIP]

Stop reporting this workflow as a failure

To stop a workflow from creating failure issues, set report-failure-as-issue: false in its frontmatter:

safe-outputs:
  report-failure-as-issue: false

Generated from Primer API Review · copilot · 1K AIC ·

  • expires on Sep 28, 2026, 9:20 AM UTC
Dominant language
TypeScript
Stars
3.9k
Forks
680
Avg merge
3d 13h
Merged PRs (30d)
56

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from primer/react

All issues in primer/react

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.