Skip to content

Rename env var prefix GPTDIFF_ → PATCHLING_ - #41

Merged
mikkel merged 1 commit into
mainfrom
feat/patchling-env-prefix
Nov 28, 2026
Merged

mikkel merged 1 commit into
mainfrom
feat/patchling-env-prefix

Conversation

@mikkel

@mikkel mikkel commented Nov 28, 2026

Copy link
Copy Markdown
Member

What

Every configuration environment variable is renamed from the GPTDIFF_ prefix (a leftover from the project's gptdiff days) to PATCHLING_:

Before After
GPTDIFF_MODEL PATCHLING_MODEL
GPTDIFF_LLM_BASE_URL PATCHLING_LLM_BASE_URL
GPTDIFF_LLM_API_KEY PATCHLING_LLM_API_KEY
GPTDIFF_FILTER_MODEL PATCHLING_FILTER_MODEL
GPTDIFF_SMARTAPPLY_MODEL PATCHLING_SMARTAPPLY_MODEL
GPTDIFF_SMARTAPPLY_BASE_URL PATCHLING_SMARTAPPLY_BASE_URL
GPTDIFF_SMARTAPPLY_API_KEY PATCHLING_SMARTAPPLY_API_KEY

Call sites, examples, bench scripts and docs all use the new names.

Compatibility

  • patchling/env.py resolves the legacy GPTDIFF_* spelling whenever the PATCHLING_* name is unset; PATCHLING_ always wins when both are set. Existing environments keep working with no changes.
  • The gptdiff / gptpatch command aliases are unchanged — this PR is only about environment variable names.

Tests

  • New tests/test_env_prefix.py: new-name reads, legacy fallback, precedence when both are set, set_env overrides under either spelling, unprefixed names untouched.
  • Full suite: 269 passed, 1 skipped (live-LLM tests excluded).

Follow-up (not in this PR)

  • The JS package (255BITS/patchling) shares these env names and should get the same rename for parity.

All configuration variables are now PATCHLING_* across the library,
CLI, examples, bench and docs: PATCHLING_MODEL, PATCHLING_LLM_BASE_URL,
PATCHLING_LLM_API_KEY, PATCHLING_FILTER_MODEL, PATCHLING_SMARTAPPLY_MODEL,
PATCHLING_SMARTAPPLY_BASE_URL, PATCHLING_SMARTAPPLY_API_KEY.

patchling/env.py resolves the legacy GPTDIFF_* spelling whenever the
PATCHLING_ name is unset (PATCHLING_ wins when both are set), so existing
setups keep working. The gptdiff/gptpatch command aliases are unchanged.

Tests: 269 passed, 1 skipped, incl. new tests/test_env_prefix.py covering
precedence, fallback, overrides and unprefixed names.
@mikkel
mikkel merged commit 935b26b into main Nov 28, 2026
2 of 4 checks passed
mikkel added a commit that referenced this pull request Nov 28, 2026
…ak in (#42)

PR #41's legacy-alias fallback resurrects a GPTDIFF_LLM_API_KEY exported
by CI when a test deletes only the PATCHLING_ spelling, failing
test_missing_api_key_raises_only_when_a_call_is_required. An autouse
conftest fixture now removes every PATCHLING_*/GPTDIFF_* variable per
test; tests that need one set it explicitly. Verified locally with
legacy-named values in the ambient environment: 269 passed, 1 skipped.

Co-authored-by: Nova (Muse) <muse@255bits.com>
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