Repository navigation
feat(onboard): label CLI candidates with subscription vs API-key auth - #122140
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
d6a3feb to
d30238a
Compare
|
Codex review: found issues before merge. Reviewed August 11, 2026, 11:54 PM ET / August 12, 2026, 03:54 UTC. ClawSweeper reviewWhat this changesThe PR adds display-only onboarding labels for detected Codex and Claude CLIs to distinguish subscription-backed logins from usage-billed API-key authentication. Merge readinessKeep this maintainer-authored PR open: it still presents generic Claude OAuth/token credentials as a paid subscription without the plan metadata that the existing parser preserves for that purpose. Priority: P2 Review scores
Verification
How this fits togetherThe Gateway-owned onboarding detector probes local CLIs and credentials, then returns inference candidates to the setup flow. Candidate details are passed unchanged to the CLI wizard and macOS onboarding UI before a selected route is live-tested and saved. flowchart LR
A[Local CLI status and credentials] --> B[Inference backend detector]
B --> C[Authentication label decision]
C --> D[Gateway setup detection]
D --> E[CLI setup wizard]
D --> F[macOS onboarding]
Before merge
Findings
Agent review detailsSecurityNone. PR surfaceSource +51, Tests +48. Total +99 across 2 files. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Show the Claude subscription label only when the parsed credential includes valid plan metadata; otherwise retain the neutral logged-in detail and test both paths. Do we have a high-confidence way to reproduce the issue? Yes, source-reproducible: a Claude credential with only Is this the best way to solve the issue? No: the branch has the right owner boundary but ignores existing plan metadata, so it is not yet the safest way to present billing information. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 4401ff2a923c. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (9 earlier review cycles; latest 8 shown)
|
d30238a to
5c63007
Compare
5c63007 to
9213b13
Compare
cbaa05d to
8e7facc
Compare
2adfe0a to
049c2fb
Compare
049c2fb to
1958067
Compare
Detected Codex/Claude Code CLI candidates now say whether they ride a flat-rate subscription login (ChatGPT, Claude) or a metered API key, so picking one is an informed billing decision for an always-on assistant. Codex classification parses `codex login status` output per codex-rs/cli/src/login.rs; Claude uses prompt-free credential-file and env/apiKeyHelper signals only (never the keychain). Unknown states keep the plain 'logged in'. Display-only: ranking and defaults unchanged.
1958067 to
3d3d172
Compare
|
Merged via squash.
|
…openclaw#122140) Detected Codex/Claude Code CLI candidates now say whether they ride a flat-rate subscription login (ChatGPT, Claude) or a metered API key, so picking one is an informed billing decision for an always-on assistant. Codex classification parses `codex login status` output per codex-rs/cli/src/login.rs; Claude uses prompt-free credential-file and env/apiKeyHelper signals only (never the keychain). Unknown states keep the plain 'logged in'. Display-only: ranking and defaults unchanged.
What Problem This Solves
Onboarding's pitch is "reuses what you already have — nothing new to sign up for." But a detected Codex or Claude Code CLI candidate can be backed by a flat-rate subscription login (ChatGPT Plus/Pro, Claude Pro/Max) or by a metered API key — and OpenClaw is an always-on workload (heartbeats, cron, channels) where a metered key compounds silently. The candidate row just said "logged in", hiding a real billing difference at the exact moment the user picks their inference route.
Why This Change Was Made
Record the fact where it is detected and show it. The candidate
detailstring now carries the auth kind:logged in · ChatGPT subscriptionlogged in · Claude subscriptionlogged in · API key (usage-billed)logged in; indeterminate login state staysinstalled. Honest unknowns are never guessed.Codex classification parses
codex login statusoutput exactly per the Codex source (openai/codex @ 3b67b03a3f6):codex-rs/cli/src/main.rs:1394-1407dispatcheslogin status;codex-rs/cli/src/login.rs:439-484printsLogged in using ChatGPT(subscription) orLogged in using an API key - <masked>(metered), both exit 0; access-token/PAT/Bedrock states intentionally stay unlabeled. Claude Code classification uses only prompt-free signals (credentials file type,apiKeyHelper,ANTHROPIC_API_KEY) — never the macOS keychain, preserving the existing no-prompt invariant.Display-only by design: ranking, defaults, auto-selection, and gating are unchanged — the billing/quota tradeoff belongs to the operator.
API-surface note: the injectable
deps.detectCodexLoginStateseam deliberately keeps its boolean signature. That signature is reachable from the exporteddetectInferenceBackendsoptions type and is therefore part of the plugin-sdkagent-harnessAPI contract; the rich classification lives in a module-local helper so this PR does not bump the contract hash (a code comment records the constraint).User Impact
Picking an AI candidate during onboarding is now an informed billing decision. The
detailstrings flow unchanged throughopenclaw.setup.detectto the macOS onboarding rows and the CLI wizard — no protocol, Swift, or config changes.Evidence
codex login status→Logged in using ChatGPT(exit 0); realdetectInferenceBackendspath →{"kind":"codex-cli","detail":"logged in · ChatGPT subscription","credentials":true}.src/commands/onboard-inference.test.ts: 34/34 locally and on Blacksmith Testbox (run 31511545507), including table-driven Codex classification (ChatGPT / API key / unrecognized), Claude credential-type and env-key labeling, and unchanged logged-out flows.pnpm plugin-sdk:api:checkclean on this head (no contract drift by construction).