Skip to content

Make GH_TOKEN optional in the Go node manifest - #73

Merged
AbirAbbas merged 1 commit into
mainfrom
gh-token-optional
Aug 20, 2026
Merged

Make GH_TOKEN optional in the Go node manifest#73
AbirAbbas merged 1 commit into
mainfrom
gh-token-optional

Conversation

@AbirAbbas

Copy link
Copy Markdown
Contributor

Summary

Moves GH_TOKEN from user_environment.required to optional in the Go node's agentfield-package.yaml, and notes the optionality in the main.go env-var doc header.

The code already treats the token as optional at every use site — nothing gates at startup:

  • github.NewClient falls back to unauthenticated API calls when the token is empty (go/internal/github/client.go)
  • repo clones inject the token into the URL only when it is set (go/internal/orch/resolve.go)
  • ProviderEnv forwards it to the harness only if present (go/internal/config/ai.go)
  • the e2e and functional harnesses already run with GH_TOKEN unset

Public 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 ./... and go vet ./cmd/pr-af pass.

🤖 Generated with Claude Code

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>
@AbirAbbas
AbirAbbas merged commit 3f601a1 into main Aug 20, 2026
4 checks passed
@AbirAbbas
AbirAbbas deleted the gh-token-optional branch August 20, 2026 22:20
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.

1 participant