Revert org-billed Copilot CLI opt-in and restore max-ai-credits to -1#1473
Merged
jonathanpeppers merged 1 commit intoJun 16, 2026
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
Reverts the java-interop-reviewer agentic workflow’s opt-in to org-billed Copilot CLI inference by removing the copilot-requests: write permission and regenerating the compiled lock workflow to use the PAT-backed COPILOT_GITHUB_TOKEN secret again.
Changes:
- Removed
copilot-requests: writefrom the workflow permissions. - Regenerated
java-interop-reviewer.lock.ymlto restoreCOPILOT_GITHUB_TOKEN: ${{ secrets.COPILOT_GITHUB_TOKEN }}, removeS2STOKENS: true, and re-add secret redaction wiring.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
.github/workflows/java-interop-reviewer.md |
Removes copilot-requests: write from the agentic workflow permissions. |
.github/workflows/java-interop-reviewer.lock.yml |
Regenerated compiled workflow to switch Copilot inference back to secrets.COPILOT_GITHUB_TOKEN and remove org-billed signals/permissions. |
jonathanpeppers
added a commit
to dotnet/android-tools
that referenced
this pull request
Jun 16, 2026
The "GITHUB_TOKEN-billed-to-org" feature (https://github.blog/changelog/2026-06-11-agentic-workflows-no-longer-need-a-personal-access-token/) requires the "Allow use of Copilot CLI billed to the organization" Copilot policy to be enabled at the org level. The `dotnet` org has not enabled that policy yet, so the GITHUB_TOKEN flow returns HTTP 403 from `api.githubcopilot.com/models`. Re-adding the `COPILOT_GITHUB_TOKEN` secret to the `copilot-pr-reviewer` environment is faster than getting the org policy enabled, so revert to the PAT-based flow for now. Only the `copilot-requests: write` line in the workflow markdown is reverted. The gh-aw CLI v0.79.8 bump from the earlier commit and the AIC guardrail tweaks are intentionally left in place. Mirrors dotnet/java-interop#1473. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
jonathanpeppers
added a commit
to jonathanpeppers/xamarin-android
that referenced
this pull request
Jun 16, 2026
Matches dotnet/java-interop#1473. The "GITHUB_TOKEN-billed-to-org" feature requires the "Allow use of Copilot CLI billed to the organization" Copilot policy to be enabled at the org level, and the dotnet org has not enabled it yet — so without that policy the workflows fail with HTTP 403 from api.githubcopilot.com/models. This commit removes copilot-requests: write from both agentic workflow markdown files and regenerates the lock files. COPILOT_GITHUB_TOKEN: secrets.COPILOT_GITHUB_TOKEN is restored, SECRET_COPILOT_GITHUB_TOKEN is re-added to the redaction step, and the gh-aw v0.79.8 + max-ai-credits/max-daily-ai-credits changes from earlier commits on this branch are intentionally retained. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This was referenced Jun 16, 2026
PR #1469 added `copilot-requests: write` to the java-interop-reviewer workflow permissions block to opt into the new feature where gh-aw uses the built-in GITHUB_TOKEN for Copilot CLI inference, with AI credits billed to the org. That feature requires the "Allow use of Copilot CLI billed to the organization" Copilot policy to be enabled at the org level. The dotnet org has not enabled that policy yet, so the workflow now fails with HTTP 403 from api.githubcopilot.com/models. See failing run: https://github.com/dotnet/java-interop/actions/runs/27628125187/job/81695629467 Revert just the opt-in line in java-interop-reviewer.md and recompile the lock file. After this merges, the COPILOT_GITHUB_TOKEN secret needs to be re-added to the copilot-pr-reviewer environment so the PAT-based flow works again. Also revert max-ai-credits from 100M back to -1 (truly unlimited). PR #1472 capped it at 100M based on a wrong theory that -1 was causing the auth 403; that 403 reproduced under 100M too, so the cap wasn't the issue and the user prefers -1. The gh-aw CLI v0.79.8 bump and the agentics-maintenance.yml updates from PR #1469 are intentionally left in place. See: https://github.blog/changelog/2026-06-11-agentic-workflows-no-longer-need-a-personal-access-token/ Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
c677f51 to
667e566
Compare
jonathanpeppers
added a commit
to dotnet/android-tools
that referenced
this pull request
Jun 16, 2026
Earlier commit capped at 100M based on a theory that `-1` was the cause of the auth 403. The 403 reproduced under `100M` too, so the cap was not the issue and `-1` (truly unlimited / disabled) is the preferred value. Mirrors the second revert in dotnet/java-interop#1473. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
jonathanpeppers
added a commit
to jonathanpeppers/xamarin-android
that referenced
this pull request
Jun 16, 2026
Matches the latest force-push on dotnet/java-interop#1473. The 100M cap from dotnet#1472 was only needed when running on the GITHUB_TOKEN-billed-to-org flow, where the AWF api-proxy required token steering to inject Copilot provider credentials. Now that this branch reverts to the PAT-based flow (secrets.COPILOT_GITHUB_TOKEN), token steering is no longer in the path, so -1 is safe and matches dotnet#1471's original intent. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
simonrozsival
approved these changes
Jun 16, 2026
jonathanpeppers
added a commit
to dotnet/android
that referenced
this pull request
Jun 16, 2026
## What Disables the AI-credit guardrails for both agentic workflows. Two-line frontmatter delta per workflow: ```yaml max-daily-ai-credits: -1 max-ai-credits: -1 ``` Applied to: - `.github/workflows/android-reviewer.md` - `.github/workflows/nightly-fix-finder.md` `gh aw compile` then regenerates the `*.lock.yml` files, `.github/aw/actions-lock.json`, and `.github/workflows/agentics-maintenance.yml` (the latter two also pick up a routine `gh-aw` CLI bump from `v0.79.6` → `v0.79.8`). Mirrors [dotnet/java-interop#1471](dotnet/java-interop#1471) + [#1473](dotnet/java-interop#1473). ## Verification `git diff origin/main...HEAD --stat`: ``` .github/aw/actions-lock.json | 12 ++-- .github/workflows/agentics-maintenance.yml | 43 ++++++------- .github/workflows/android-reviewer.lock.yml | 89 +++++++++------------------ .github/workflows/android-reviewer.md | 2 + .github/workflows/nightly-fix-finder.lock.yml | 89 +++++++++------------------ .github/workflows/nightly-fix-finder.md | 2 + ``` The only hand-authored change is the four added lines above. Everything else is mechanical output of `gh aw compile`. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Two reverts to the
java-interop-reviewerworkflow:copilot-requests: writefrom.github/workflows/java-interop-reviewer.md, which switches Copilot CLI inference back from the built-inGITHUB_TOKENto the stored PAT (secrets.COPILOT_GITHUB_TOKEN).max-ai-creditsfrom100Mback to-1(truly unlimited / disabled). Fix PR reviewer auth: cap max-ai-credits at 100M instead of -1 #1472 capped it at100Mbased on a theory that-1was the cause of the auth 403, but the 403 reproduced under100Mtoo — the cap was not the issue and-1is the preferred value.The lock file (
.github/workflows/java-interop-reviewer.lock.yml) is regenerated viagh aw compile java-interop-reviewerto reflect both changes.The gh-aw CLI v0.79.8 bump and the
agentics-maintenance.ymlupdates from #1469 are intentionally left in place — only the org-billed-CLI opt-in is being reverted.Why
The "GITHUB_TOKEN-billed-to-org" feature (changelog) requires the "Allow use of Copilot CLI billed to the organization" Copilot policy to be enabled at the org level. The
dotnetorg has not enabled that policy yet, so after #1469 merged the workflow started failing with HTTP 403 fromapi.githubcopilot.com/models:Re-adding the
COPILOT_GITHUB_TOKENsecret to thecopilot-pr-reviewerenvironment is faster than getting the org policy enabled, so we revert to the PAT-based flow for now.Verification
Regenerated
java-interop-reviewer.lock.ymlconfirms the expected changes:COPILOT_GITHUB_TOKEN: ${{ secrets.COPILOT_GITHUB_TOKEN }}(was${{ github.token }}) in both the agent and threat-detection jobs.copilot-requests: writeremoved from both jobs'permissions:blocks.S2STOKENS: trueenv (the org-billed-CLI signal) removed from both jobs.SECRET_COPILOT_GITHUB_TOKENre-added to the redaction step.GH_AW_MAX_AI_CREDITS: "-1"(was"100000000");apiProxy.maxAiCreditsandenableTokenSteeringremoved from the firewall config.Follow-up (manual)
After this merges, re-add the
COPILOT_GITHUB_TOKENsecret to thecopilot-pr-reviewerenvironment so the PAT-based flow works again. The user will do that manually — no secret values are touched in this PR.