Skip to content

refactor(provider): rename subscription-provider symbols, files and directories - #2018

Merged
code-yeongyu merged 1 commit into
mainfrom
refactor/1989-internal-rename
Sep 22, 2026
Merged

code-yeongyu merged 1 commit into
mainfrom
refactor/1989-internal-rename

Conversation

@code-yeongyu

@code-yeongyu code-yeongyu commented Sep 22, 2026 •

Copy link
Copy Markdown
Owner

Behaviour-free internal rename completing the senpi side of #1989 (todo 10). 280 files, 130 git mv moves, one atomic commit.

What renamed

Symbols (CLAUDE_SDK_OAUTH_* -> ANTHROPIC_SUBSCRIPTION_*, ClaudeSdkOauth* -> AnthropicSubscription*, OpenAICodex*/openaiCodex* -> ChatGptSubscription*/chatgptSubscription*, incl. the SCREAMING constants), the builtin extension directory claude-sdk-oauth/ -> anthropic-subscription/ (56 files), the provider/oauth/util modules, the catalog shard, the matching test + senpi-qa script names, and the bundle script's oauth module map.

What did NOT rename, and why

Kept Reason
OPENAI_CODEX_RESPONSES_API, OpenAICodexResponsesOptions, CLAUDE_SDK_OAUTH_API_ID, api/openai-codex-responses/, legacy-api-aliases.ts family the symbol names the frozen wire api, not the provider
claudeSdkOauthProvider (the settings property) settings.ts reads anthropicSubscriptionProvider ?? claudeSdkOauthProvider — that name IS the two-release compatibility window. Renaming it logs out every user whose settings predate the migration. Only the wrapping type SettingsWithClaudeSdkOauthProvider moved.

Frozen VALUES are byte-identical

All 8 present verbatim in packages/*/src: openai-codex-responses ×100, claude-sdk-oauth-managed ×10, claude-sdk-oauth-compact ×4, senpi.claude-sdk-oauth.compact-boundary.v1 ×4, .claude-sdk-oauth-binding.json ×3, CLAUDE_CODE_OAUTH_TOKEN ×25, claude_sdk_oauth_ ×20, claude-sdk-oauth-tool-watch ×3. LEGACY_PROVIDER_IDS keys intact. Symbols holding a frozen value were renamed; their string contents were not.

Numeric before/after (the acceptance criterion)

Suite BEFORE AFTER
packages/ai 311 passed / 27 skipped (338); 2965 passed / 886 skipped identical
packages/coding-agent 4 failed / 1524 passed (1535); 6 failed / 12338 passed 1524 passed; 12338 passed — same pass count

The coding-agent baseline is not clean: 4 known local-env failures (agent-session-compaction 4010>4000, terminal-bash-session-env $HOME/$TMPDIR, process-teardown race, mcp/reconnect timing) that pass on CI. Comparing names, not counts, caught two real regressions this pass:

  1. settings-provider-key-migration-offdisk.test.ts — the sweep rewrote the string "openaiCodexProvider", but there it is a legacy settings KEY, not a symbol; the assertion then contradicted the line above it. Restored.
  2. gpt-6-astra-context-window.test.ts — the shard filename was replaced in place, leaving the sorted list out of order. chatgpt-subscription.json re-sorted after bai.json.

A count-only check would have read "4 failed before, 4 failed after" and shipped both.

Gates (scoped)

  • Root bunx tsc --noEmit -p tsconfig.json — exit 0. That config's include is packages/*/src/**/* and packages/*/test/**/*, so it covers both packages and the ~83 renamed test files.
  • bunx biome check --error-on-warnings — 0 errors (6 pre-existing infos in untouched files)
  • bun run check:model-data — PASS; manifest regenerated, 42/42 sha256 entries match, 0 orphans
  • Changelog gate (real script) — PASS, 12 production paths covered, both package CHANGELOGs; extension changes.md moved with its directory, no orphan at the old path

Part of #1989


Summary by cubic

Behaviour-free internal rename that switches subscription-provider symbols, files, and directories to the canonical names from #1989. ClaudeSdkOauth*/CLAUDE_SDK_OAUTH_* becomes AnthropicSubscription*/ANTHROPIC_SUBSCRIPTION_* and OpenAICodex*/openaiCodex* becomes ChatGptSubscription*/chatgptSubscription* across 280 files — the builtin extension directory, provider/oauth/util modules, the model-data catalog shard, tests, and senpi-qa scripts. Test pass counts are identical before and after.

Refactors

  • Renames the builtin extension directory claude-sdk-oauth/ -> anthropic-subscription/, the provider and OAuth modules, the catalog shard, and the matching test and script names in both packages.
  • Symbols that name the frozen wire api stay: OPENAI_CODEX_RESPONSES_API, OpenAICodexResponsesOptions, CLAUDE_SDK_OAUTH_API_ID, and api/openai-codex-responses/.
  • Comparing names instead of pass counts caught two sweep regressions, both restored: a legacy settings key string rewritten in settings-provider-key-migration-offdisk.test.ts and an out-of-order catalog list in gpt-6-astra-context-window.test.ts.

Migration

  • Persisted values are byte-identical: openai-codex-responses, claude-sdk-oauth-managed, claude-sdk-oauth-compact, CLAUDE_CODE_OAUTH_TOKEN, and LEGACY_PROVIDER_IDS — only the symbols holding them were renamed.
  • The settings property claudeSdkOauthProvider keeps its name because settings.ts reads anthropicSubscriptionProvider ?? claudeSdkOauthProvider; renaming it closes the two-release compatibility window and logs out users whose settings predate the migration.

Written for commit 3c816ea. Summary will update on new commits.

Review in cubic

…irectories

Behaviour-free internal rename completing senpi#1989: TypeScript symbols,
file names, the builtin extension directory and the matching test/QA script
names now speak the canonical provider ids.

- `CLAUDE_SDK_OAUTH_*` -> `ANTHROPIC_SUBSCRIPTION_*`, `ClaudeSdkOauth*` ->
  `AnthropicSubscription*`, `OpenAICodex*`/`openaiCodex*` ->
  `ChatGptSubscription*`/`chatgptSubscription*`, including the SCREAMING
  variants (`OPENAI_CODEX_MODELS`, `OPENAI_CODEX_PROVIDER_ID`,
  `OPENAI_CODEX_PROVIDER_LABEL`, the login-method and auth-claim constants).
- `builtin/claude-sdk-oauth/` -> `builtin/anthropic-subscription/` (56 files),
  the provider/oauth/util modules and the catalog shard, plus the matching
  test and senpi-qa script names; the bundle script's oauth module map and
  every import follow.

NOT renamed, because the symbol names the frozen WIRE API rather than the
provider: `OPENAI_CODEX_RESPONSES_API`, `OpenAICodexResponsesOptions`,
`CLAUDE_SDK_OAUTH_API_ID`, the `legacy-api-aliases.ts` export family, and the
`api/openai-codex-responses/` directory itself.

NOT renamed, because the NAME IS the compatibility window: the settings
property `claudeSdkOauthProvider`, which `settings.ts` reads as
`anthropicSubscriptionProvider ?? claudeSdkOauthProvider`. Renaming it would
close the two-release legacy-read window early. Only the wrapping type symbol
`SettingsWithClaudeSdkOauthProvider` was renamed.

Every persisted VALUE is byte-identical: the seven frozen tokens, the
`LEGACY_PROVIDER_IDS` map keys, and `claude-sdk-oauth-tool-watch`. Symbols
holding those values were renamed; their string contents were not.

Part of #1989
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