refactor: simplify env var surface; align on SWE-AF naming#35
Merged
Conversation
pr-af shared three legacy env-var aliases with its newer canonical
names. They've been side-by-side for a while; this drops the legacy
side now that nothing reads them.
**Removed (with the still-supported replacement):**
- `HARNESS_PROVIDER` → `PR_AF_PROVIDER`
- `HARNESS_MODEL` → `PR_AF_MODEL`
- `AI_MODEL` / `PR_AF_AI_MODEL` → `PR_AF_MODEL` (the .ai() / .harness()
splits both fall back to the same value; per-tier overrides via
`PR_AF_MODEL_BUDGET` / `_MID` / `_PREMIUM` are unchanged)
- `OPENCODE_SERVER` → `PR_AF_OPENCODE_SERVER`
- `GITHUB_TOKEN` → `GH_TOKEN` (matches SWE-AF, the public release with
the most users — github-buddy is being aligned in parallel)
**Also fixes a latent typo:** `NODE_ID` was being read as `PR_AF`
(`os.getenv("PR_AF", "pr-af")` at app.py:27). The `PR_AF` env var is
never set anywhere, so pr-af's registered node id always silently
defaulted to `"pr-af"` regardless of any deployer's intent. Now reads
`NODE_ID` like the other agents on the stack.
Dockerfile + docker-compose updated to match. README + docs/DX.md
references to `GITHUB_TOKEN` (as a description of pr-af's own env var)
updated to `GH_TOKEN`. References to GitHub Actions' built-in
`secrets.GITHUB_TOKEN` are unchanged — that's a GitHub-side convention
we don't control.
Co-Authored-By: Claude Opus 4.7 (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
Drops five legacy env-var aliases that were side-by-side with their canonical names, and fixes a latent NODE_ID typo. Pairs with the companion PR in github-buddy that aligns its env var names on the same canonical surface.
Aliases removed (canonical replacement in parens):
HARNESS_PROVIDER(→PR_AF_PROVIDER)HARNESS_MODEL(→PR_AF_MODEL)AI_MODELandPR_AF_AI_MODEL(→PR_AF_MODEL; per-tier overrides viaPR_AF_MODEL_BUDGET/_MID/_PREMIUMunchanged)OPENCODE_SERVER(→PR_AF_OPENCODE_SERVER)GITHUB_TOKEN(→GH_TOKEN)SWE-AF (our public release with the most users) only uses
GH_TOKENandNODE_ID, so the same naming is now consistent across all three agents (github-buddy, pr-af, SWE-AF).Latent bug fix:
src/pr_af/app.pywas readingos.getenv("PR_AF", "pr-af")instead ofos.getenv("NODE_ID", "pr-af"). ThePR_AFenv var is never set anywhere, so pr-af's registered node id silently always defaulted to"pr-af"regardless of deployer intent — fixed.Why this is safe:
These five aliases had
PR_AF_*canonical replacements that have been side-by-side for several releases. Internal deployments and the docker-compose / Dockerfile have been updated to the new names in this PR; nothing left in the repo references the removed aliases. The GitHub Actions integration in the README still referencessecrets.GITHUB_TOKEN(GitHub Actions' built-in secret name — that's a GitHub-side convention, not our env var, and is correctly mapped toGH_TOKEN).Companion PR
Agent-Field/github-buddy#55 — same naming alignment in github-buddy + a workspace-level docker-compose that brings all three agents up together.
Test plan
ruff check src/— cleanPR_AF_MODELpropagates to bothharness_modelandai_model,GH_TOKENflows throughGitHubClientandprovider_env,NODE_IDregisters correctly.docker compose config— syntactically validtests/onorigin/main, so I couldn't run the full pytest suite against this branch directly. Against the equivalent change on the internal pr-af tree (which has the full suite), 25/25 non-cost-tracker tests pass (the one cost-tracker failure is pre-existing and unrelated).PR_AF_MODEL/PR_AF_PROVIDER/GH_TOKENon the Railway service before merging — the deployed container will read the new names. Drop the now-unused legacy aliases (HARNESS_MODEL,HARNESS_PROVIDER,AI_MODEL,PR_AF_AI_MODEL,OPENCODE_SERVER,GITHUB_TOKEN) after the deploy succeeds.🤖 Generated with Claude Code