fix(onboard): prune 20 dead provider auth flags, wire --codex-api-key (#2341)#2347
Merged
alexey-pelykh merged 1 commit intomainfrom Apr 13, 2026
Merged
Conversation
…#2341) The onboard provider auth flag list declared 23 CLI options, but only three (`--anthropic-api-key`, `--openai-api-key`, `--gemini-api-key`) had a live consumer in the wizard. The non-interactive handler the other 20 were pointing at (`applyNonInteractiveAuthChoice`) has been a gutted no-op since the fork split, so every other flag was parsed, forwarded through `OnboardOptions`, and silently dropped. At the same time `src/wizard/onboarding.ts` reads `opts.codexApiKey` for the Codex runtime credential flow — but no `--codex-api-key` flag was ever registered, breaking non-interactive Codex onboarding entirely. This change: - Reduces `ONBOARD_PROVIDER_AUTH_FLAGS` to the four runtimes RemoteClaw actually consumes: anthropic, openai, gemini, codex. - Drops the 20 matching dead fields from `OnboardOptions` and their forwarders in `register.onboard.ts`. - Adds `"codex-api-key"` to the `AuthChoice` union so the new flag entry type-checks consistently with the existing `*-api-key` conventions. - Swaps the mistral-based flag-forwarding test in `register.onboard.test.ts` for a `--codex-api-key` test — the wizard side already reads `opts.codexApiKey`, so the end-to-end wiring is complete once the flag reaches `OnboardOptions`. Scope note: the onboard-auth cluster gut (covered by #2338) still owns `onboard-non-interactive.provider-auth.test.ts` — this PR leaves that file untouched. Its existing Record<string, unknown> test helpers shield it from the `OnboardOptions` field removals here. Co-Authored-By: Claude Opus 4.6 (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
ONBOARD_PROVIDER_AUTH_FLAGSfrom 23 entries to the 4 runtimes RemoteClaw actually consumes: anthropic, openai, gemini, codex (newly wired).*ApiKeyfields fromOnboardOptionsand their forwarders inregister.onboard.ts. The non-interactive inference path (applyNonInteractiveAuthChoice/inferAuthChoiceFromFlags) has been a gutted no-op since the fork split, so every dropped flag was already silently discarded.src/wizard/onboarding.ts:181has always readopts.codexApiKey, but no--codex-api-keyflag was ever registered — so scripted Codex setup hitunknown optionerrors. The wizard side needed no change; the fix is purely plumbing.Changes
src/commands/onboard-provider-auth-flags.tssrc/commands/onboard-types.tsOnboardOptions: drop 20 dead*ApiKeyfields; add"codex-api-key"toAuthChoiceunionsrc/cli/program/register.onboard.tscodexApiKeyforwardersrc/cli/program/register.onboard.test.tsNet: 17 insertions, 208 deletions.
Acceptance Criteria
Scope Coordination
This PR is independent of #2338 (onboard-auth cluster gut) running in parallel. Per the issue body and CALLER CONTEXT, I explicitly left these alone:
Test plan
Closes #2341
🤖 Generated with Claude Code