Skip to content

fix(onboard): prune 20 dead provider auth flags, wire --codex-api-key (#2341)#2347

Merged
alexey-pelykh merged 1 commit intomainfrom
fix/2341-onboard-provider-auth-flags
Apr 13, 2026
Merged

fix(onboard): prune 20 dead provider auth flags, wire --codex-api-key (#2341)#2347
alexey-pelykh merged 1 commit intomainfrom
fix/2341-onboard-provider-auth-flags

Conversation

@alexey-pelykh
Copy link
Copy Markdown

Summary

  • Reduces ONBOARD_PROVIDER_AUTH_FLAGS from 23 entries to the 4 runtimes RemoteClaw actually consumes: anthropic, openai, gemini, codex (newly wired).
  • Drops the matching 20 dead *ApiKey fields from OnboardOptions and their forwarders in register.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.
  • Fixes non-interactive Codex onboarding. src/wizard/onboarding.ts:181 has always read opts.codexApiKey, but no --codex-api-key flag was ever registered — so scripted Codex setup hit unknown option errors. The wizard side needed no change; the fix is purely plumbing.

Changes

File Change
src/commands/onboard-provider-auth-flags.ts Flag list: 23 entries → 4 (anthropic, openai, gemini, codex)
src/commands/onboard-types.ts OnboardOptions: drop 20 dead *ApiKey fields; add "codex-api-key" to AuthChoice union
src/cli/program/register.onboard.ts Forwarders: drop 20 dead entries, add codexApiKey forwarder
src/cli/program/register.onboard.test.ts Swap mistral flag-forwarding test → codex flag-forwarding test

Net: 17 insertions, 208 deletions.

Acceptance Criteria

  • `ONBOARD_PROVIDER_AUTH_FLAGS` contains exactly 4 entries: `anthropic`, `openai`, `gemini`, `codex`
  • `OnboardOptions` contains exactly 4 `*ApiKey` fields matching the above
  • `register.onboard.ts` forwards exactly 4 provider-auth flags
  • `remoteclaw onboard --help` shows only the 4 live flags (probed via commander `options` inspection)
  • New test: `--codex-api-key ` forwards as `opts.codexApiKey` — wizard already consumes it at `src/wizard/onboarding.ts:181`
  • `pnpm check` passes (format + tsgo + lint)
  • Targeted `pnpm vitest run` green: `register.onboard.test.ts` 7/7, `wizard/onboarding.test.ts` 7/7

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

  • `pnpm check` passes locally
  • `pnpm vitest run src/cli/program/register.onboard.test.ts src/wizard/onboarding.test.ts` — 14/14 pass
  • Commander probe: `onboard` command registers exactly 4 provider-auth flags (`--anthropic-api-key`, `--openai-api-key`, `--gemini-api-key`, `--codex-api-key`). The unrelated `--custom-api-key` (custom provider config) remains as expected.
  • CI build + test (GitHub Actions)
  • Manual smoke test deferred to post-merge (requires gateway + TTY setup not available in this environment)

Closes #2341

🤖 Generated with Claude Code

…#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>
@alexey-pelykh alexey-pelykh merged commit 8f788ae into main Apr 13, 2026
10 checks passed
@alexey-pelykh alexey-pelykh deleted the fix/2341-onboard-provider-auth-flags branch April 13, 2026 12:18
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.

fix(onboard): remove 21 dead provider auth flags and add missing --codex-api-key

1 participant