feat: require GH_TOKEN at install (alongside the LLM key)#91
Merged
Conversation
SWE-AF's core loop clones a repo, pushes a branch, and opens a pull request — all of which need GitHub write access; `gh`/`git` authenticate from GH_TOKEN (prompts/github_pr.py assumes it's set). It was declared `optional`, so `af install`/`af run` never prompted for it and a build would only fail once it reached the push/PR step. Move GH_TOKEN into `required` so setup prompts for it up front and stores it encrypted, right next to the require_one_of LLM-provider key. Planning (`plan` and friends) still works without touching GitHub, but the node's purpose is delivering PRs, so a token is a genuine setup requirement. Co-Authored-By: Claude Opus 4.8 (1M context) <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
SWE-AF's whole point is the delivery loop: clone a repo → push a branch → open a pull request — all of which need GitHub write access. The agent shells out to
git push/gh pr create, which authenticate fromGH_TOKEN(seeprompts/github_pr.py: "TheGH_TOKENenvironment variable is already set for authentication").But
GH_TOKENwas declared optional, soaf install/af runnever prompted for it — a user could set up the node with just an LLM key and only discover the token was missing once abuildreached the push/PR step and failed.Change
Move
GH_TOKENfromoptionaltorequired, right next to therequire_one_ofLLM-provider key:Now setup prompts for the token up front and stores it encrypted, so the two things a SWE-AF node actually needs — an LLM key and a GitHub token — are both required at install time.
Planning-only reasoners (
planand friends) don't touch GitHub, but the node's reason for existing is delivering PRs, so a token is a genuine setup requirement rather than an optional extra.Verification
Parsed through the AgentField manifest loader (
packages.ParsePackageMetadata):required=[GH_TOKEN],require_one_of=1group,optional=4— GH_TOKEN loads as a required secret.🤖 Generated with Claude Code