Make GH_TOKEN optional in the Go node manifest - #73
Merged
Conversation
Every use of the token is lazy and degrades cleanly without it: github.NewClient falls back to unauthenticated API calls, clones only inject the token when set, and ProviderEnv forwards it only if present. Public repos review fine anonymously — the token is needed for private repos, posting reviews back to GitHub, and unthrottled rate limits. The e2e/functional harnesses already run with GH_TOKEN unset. Requiring it meant a fresh desktop install gated pr-af behind a "Needs keys" prompt for a credential many reviews never touch. Co-Authored-By: Claude Fable 5 <noreply@anthropic.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.
Summary
Moves
GH_TOKENfromuser_environment.requiredtooptionalin the Go node'sagentfield-package.yaml, and notes the optionality in themain.goenv-var doc header.The code already treats the token as optional at every use site — nothing gates at startup:
github.NewClientfalls back to unauthenticated API calls when the token is empty (go/internal/github/client.go)go/internal/orch/resolve.go)ProviderEnvforwards it to the harness only if present (go/internal/config/ai.go)GH_TOKENunsetPublic repos review fine anonymously; the token is needed only for private repos, posting reviews back to GitHub, and unthrottled API rate limits — the new description says so.
Requiring it meant a fresh AgentField desktop install (which now bundles pr-af) gated the node behind a "Needs keys" prompt for a credential many reviews never touch.
The legacy Python root manifest is deliberately untouched: its comment says the Python node genuinely needs GitHub write access mid-run.
Testing
go build ./...andgo vet ./cmd/pr-afpass.🤖 Generated with Claude Code