Skip to content

docs: fix GH_AW_AGENT_TOKEN fallback behavior documentation#14936

Merged
mnkiefer merged 2 commits intorefactor-tokens-pagefrom
copilot/sub-pr-14933-again
Feb 11, 2026
Merged

docs: fix GH_AW_AGENT_TOKEN fallback behavior documentation#14936
mnkiefer merged 2 commits intorefactor-tokens-pagefrom
copilot/sub-pr-14933-again

Conversation

Copy link
Contributor

Copilot AI commented Feb 11, 2026

The GH_AW_AGENT_TOKEN section contained contradictory statements about token fallback behavior. One part claimed "no further fallback", while another described fallback to GH_AW_GITHUB_TOKEN/GITHUB_TOKEN. The implementation uses GH_AW_AGENT_TOKEN || GH_AW_GITHUB_TOKEN || GITHUB_TOKEN (see pkg/workflow/github_token.go:getEffectiveAgentGitHubToken).

Changes

  • Added explicit "Token precedence and fallback" section documenting the fallback chain
  • Removed contradictory "no further fallback" statement
  • Simplified redundant token precedence text in Technical Implementation note to reference main section

The documentation now accurately reflects the runtime behavior:

# Token resolution order:
# 1. GH_AW_AGENT_TOKEN (if set)
# 2. GH_AW_GITHUB_TOKEN (fallback)
# 3. GITHUB_TOKEN (final fallback)

💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Fix inconsistency in token precedence documentation by:
- Adding clear "Token precedence and fallback" section explaining GH_AW_AGENT_TOKEN || GH_AW_GITHUB_TOKEN || GITHUB_TOKEN behavior
- Removing contradictory "no further fallback" statement
- Simplifying Technical Implementation note to reference main documentation

Matches implementation in pkg/workflow/github_token.go:getEffectiveAgentGitHubToken

Co-authored-by: mnkiefer <8320933+mnkiefer@users.noreply.github.com>
Copilot AI changed the title [WIP] Update tokens page based on review feedback docs: fix GH_AW_AGENT_TOKEN fallback behavior documentation Feb 11, 2026
Copilot AI requested a review from mnkiefer February 11, 2026 12:10
@mnkiefer mnkiefer marked this pull request as ready for review February 11, 2026 12:10
Copilot AI review requested due to automatic review settings February 11, 2026 12:10
@mnkiefer mnkiefer merged commit f9db147 into refactor-tokens-page Feb 11, 2026
3 checks passed
@mnkiefer mnkiefer deleted the copilot/sub-pr-14933-again branch February 11, 2026 12:11
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the token reference docs to remove contradictory statements about GH_AW_AGENT_TOKEN fallback behavior and align the documentation with the actual runtime token resolution logic used by gh-aw.

Changes:

  • Added an explicit “Token precedence and fallback” section under GH_AW_AGENT_TOKEN and removed the prior “no further fallback” claim.
  • Simplified the “Technical Implementation” note to reference the main precedence/fallback section instead of repeating details.
  • Updated the pinned commit for docker/build-push-action in the release workflow lockfile and added a corresponding entry to the actions lock JSON.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
docs/src/content/docs/reference/tokens.md Clarifies GH_AW_AGENT_TOKEN fallback behavior and removes contradictory wording.
.github/workflows/release.lock.yml Updates the pinned SHA for docker/build-push-action used by the release workflow.
.github/aw/actions-lock.json Adds a lock entry for docker/build-push-action@v6 to match the updated pin.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +462 to +463
- If `GH_AW_AGENT_TOKEN` is set, it is always used for agent assignment.
- If `GH_AW_AGENT_TOKEN` is _not_ set, `gh-aw` falls back to `GH_AW_GITHUB_TOKEN`, and then to `GITHUB_TOKEN`, matching the runtime resolution `GH_AW_AGENT_TOKEN || GH_AW_GITHUB_TOKEN || GITHUB_TOKEN`.
Copy link

Copilot AI Feb 11, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The new bullets describe GH_AW_AGENT_TOKEN as "always used" when set, but runtime precedence in getEffectiveAgentGitHubToken uses a custom/per-output token and top-level github-token before checking GH_AW_AGENT_TOKEN. This section should reflect the full precedence (custom/per-output → workflow-level → GH_AW_AGENT_TOKENGH_AW_GITHUB_TOKENGITHUB_TOKEN) or reword to avoid implying env var wins over explicitly configured tokens.

Suggested change
- If `GH_AW_AGENT_TOKEN` is set, it is always used for agent assignment.
- If `GH_AW_AGENT_TOKEN` is _not_ set, `gh-aw` falls back to `GH_AW_GITHUB_TOKEN`, and then to `GITHUB_TOKEN`, matching the runtime resolution `GH_AW_AGENT_TOKEN || GH_AW_GITHUB_TOKEN || GITHUB_TOKEN`.
- For agent assignment, `gh-aw` first uses any token explicitly configured for the safe output (for example, a custom/per-output token), then any workflow-level `github-token` input.
- If neither of those is provided and `GH_AW_AGENT_TOKEN` is set, it is used next for agent assignment.
- If `GH_AW_AGENT_TOKEN` is _not_ set, `gh-aw` falls back to `GH_AW_GITHUB_TOKEN`, and then to `GITHUB_TOKEN`, matching the runtime resolution: custom/per-output → workflow-level → `GH_AW_AGENT_TOKEN``GH_AW_GITHUB_TOKEN``GITHUB_TOKEN`.

Copilot uses AI. Check for mistakes.
Comment on lines 1197 to 1200
uses: docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f # v3
- name: Build Docker image (validation only)
uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 # v6
uses: docker/build-push-action@ee4ca427a2f43b6a16632044ca514c076267da23 # v6
with:
Copy link

Copilot AI Feb 11, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR is described as a documentation-only fix, but this change also updates the pinned docker/build-push-action commit in the release workflow lockfile. Please either mention this action bump in the PR description (so reviewers understand the extra change) or split it into a separate PR to keep the docs change focused.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments