Disable gh-aw's daily AI-credits guardrail with `max-daily-ai-credits: -1` on the Z.AI agentic workflows

Merged
DS
1mo ago
+172-1299

This pull request was posted by Claude Code using claude-opus-5-5 on behalf of David.

Why we make these changes

Our gh-aw workflows keep exhausting the repo's GITHUB_TOKEN rate limit ("API rate limit exceeded for installation"). When that happens, CodeQL, Package Label, Protect .github and PR Bots go red. The largest single consumer is gh-aw's daily AI-credits guardrail in each workflow's activation job. To total the last 24h of AI credits, it lists every run's artifacts and downloads each usage artifact. In CI Review run 39522281523 that took about 700 REST calls: 6 run-list pages, 586 artifact listings and 108 downloads. CI Review activates about 126 times a day, so that is roughly 76–90k calls/day (estimate).

The guardrail can't trigger for us. All 108 runs it inspected computed aic: 0 ("not exceeded (0/5000)"). AI credits are gh-aw's pricing unit, not the Z.AI Coding Plan quota, which shared/provider-health.md already gates. The pydantic-ai gh-aw engine in development does report non-zero AI credits. After that migration the guardrail would start blocking CI Review on busy days (estimate), instead of just sitting there unused.

max-daily-ai-credits: -1 is now set in all 13 pydantic-ai-*.md sources, and the locks are recompiled with the same gh-aw v0.86.2. The field goes in each source, not in shared/engine-zai.md. In v0.86.2, only a -1 in the workflow's own frontmatter removes the guardrail (hasWorkflowExplicitMaxDailyAICDisable). An imported -1 only skips the scan at run time, and the conclusion job's cache steps still run whenever the conclusion job runs. stale-issues-finder doesn't import engine-zai.md anyway.

Each lock loses these pieces:

  • the activation cache-restore, artifact-fallback and guardrail steps, and their outputs;
  • the daily_ai_credits_exceeded term in the agent and conclusion if:;
  • the conclusion job's AIC cache restore/write/save/upload steps.

The conclusion jobs of attention-triage, community-demand and feature-digest drop from actions: write to actions: read. gh-aw grants write only to jobs that save a cache.

A new daily-aic-guardrail check in .github/scripts/agentic_workflow_guard.py rejects any lock that still compiles the guardrail step, so a new workflow can't bring it back. The rationale lives once, in that check's row in .github/workflows/AGENTS.md, and each source comment points there.

New public surface

None.

Verification

  • gh-aw v0.86.2 recompiles the unmodified sources byte-identical. After the change, no lock contains daily-effective-workflow-guardrail, GH_AW_MAX_DAILY_AI_CREDITS or daily_ai_credits.
  • uv run python .github/scripts/agentic_workflow_guard.py check --base-ref upstream/main passes. The new check flags the pre-change pydantic-ai-pr-review.lock.yml and a lock compiled with -1 only in shared/engine-zai.md.
  • test_daily_aic_guardrail_* in .github/scripts/test_agentic_workflow_guard.py pass.

This PR can't exercise its own change. CI Review runs on workflow_run from the default branch. After merge, take the first CI Review run that activates and list its activation steps:

gh run list -R pydantic/pydantic-ai --workflow pydantic-ai-pr-review.lock.yml --limit 10
gh api repos/pydantic/pydantic-ai/actions/runs/<run-id>/jobs --jq '.jobs[] | select(.name=="activation") | .steps[].name'

The list should contain neither "Check daily workflow token guardrail" nor "Restore daily AIC usage cache".

What changes for existing users

Nothing; this only touches the repo's own workflows.

PR decisions

2026-10-21 · pre-push review 1 of 3 at 099e343ab1634245970fee0b8bafa344f491840a · iter -

2026-10-21 · pre-push review 1 of 3 at 4cdcc6ebe6c7e9c7dfc0553779762d132fe6d497 · iter -

2026-10-21 · max-daily-ai-credits set per source, not in shared/engine-zai.md · iter -

2026-10-21 · pre-push review 2 of 3 at e295843b2b6e9065cbe4e6dce19052dfd56cb8ba · iter -

2026-10-21 · pre-push review 2 of 3 at e295843b2b6e9065cbe4e6dce19052dfd56cb8ba · iter -

2026-10-21 · pre-push review 3 of 3 at 60c88ef0dd7bd0367571e39257e474939535ae6d · iter -

2026-10-21 · pre-push review 3 of 3 at 60c88ef0dd7bd0367571e39257e474939535ae6d · iter -

Checklist

  • No breaking changes in accordance with the version policy.
  • Any permitted compatibility impact has a label, warning, migration, release note, and exact API-check waiver.
  • PR title is fit for the release changelog.