fix(onboard): honor back and exit at the credential re-entry prompt - #9558
Closed
udsy19 wants to merge 1 commit into
Closed
fix(onboard): honor back and exit at the credential re-entry prompt#9558udsy19 wants to merge 1 commit into
udsy19 wants to merge 1 commit into
Conversation
The onboarding validation-recovery re-entry prompt read the answer through normalizeCredentialValue, which only trims whitespace. It performed no intent classification, so back, exit, quit, and ? were staged as the literal API key for every provider whose credential env is not NVIDIA_INFERENCE_API_KEY or NVIDIA_API_KEY, because validateNvidiaApiKeyValue only enforces the nvapi- prefix for those two. The recovery menu advertises "back (change provider)" one line earlier, so back is an expected answer at that prompt. An empty answer also looped on "is required" with no advertised escape. Route the answer through getCredentialPromptIntent, the same classifier the canonical credential-navigation helpers use: exit quits onboarding, back returns the shared BACK_TO_SELECTION sentinel that both call sites map to provider selection, and help or empty re-prompts with an escape hint. Signed-off-by: Udaya Tejas <udayatejas2004@gmail.com>
Contributor
|
This repository limits contributors to 5 open pull requests. Please close or merge existing PRs before opening new ones. |
Contributor
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThe credential recovery prompt now interprets navigation input as intent. Selecting ChangesCredential recovery navigation
Estimated code review effort: 3 (Moderate) | ~20 minutes Suggested labels: Suggested reviewers: ✨ Finishing Touches 💡 1🛠️ Fix failing CI checks 💡
🧪 Generate unit tests (beta)
Comment |
This was referenced Aug 19, 2026
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
The onboarding recovery menu advertises
back (change provider)andexit, then the credentialre-entry prompt it opens stages those words as the API key.
back,exit,quit, and?were eachsaved into the provider's credential environment variable and registered with the OpenShell gateway,
and an empty answer looped on
is requiredwith no offered escape. The re-entry prompt now classifiesanswers with
getCredentialPromptIntent, the same classifier the canonical credential-navigationhelpers use:
backreturns to provider selection,exitandquitquit onboarding, and?,help,or an empty line re-prompt with an escape hint.
Related Issue
Fixes #9557
Changes
src/lib/onboard/validation-recovery-prompt.ts: the privatereplaceNamedCredentialreads itsanswer through
getCredentialPromptIntentinstead ofnormalizeCredentialValue, which only trimswhitespace and classified nothing.
exitcallsdeps.exitOnboardFromPrompt();backreturns theshared
BACK_TO_SELECTIONsentinel fromsrc/lib/navigation.ts;helpand empty re-prompt with ahint naming the escapes. Both call sites map the sentinel to the existing
"selection"outcome, sopromptValidationRecovery's return type is unchanged.normalizeCredentialValuehad no other usein the file and was removed from the import.
src/lib/onboard/credential-navigation.test.ts: extenddescribe("credential prompt navigation helpers")with a case driving the realpromptValidationRecoverythrough menuretry→ empty →back, asserting the outcome isselection, that the credential env var is never staged, thatevery scripted answer was consumed (so the empty answer looped and was escapable), and that exit
was not called.
No new abstraction, configuration, fallback, or compatibility path.
getCredentialPromptIntentisalready exported from
../credentials/store, which this file already imported, so this adds nodependency edge there. The one new edge is to
src/lib/navigation.ts, which has noci/source-architecture-budget.jsonoverride and therefore the default fan-in cap of 20; it goesfrom 6 to 7.
Scope note: the outer recovery menu in the same file already handled
backandexitcorrectly andis unchanged. Only the inner re-entry prompt was affected.
Type of Change
Quality Gates
DGX Station Hardware Evidence
Verification
Signed-off-by:line and every commit appears asVerifiedin GitHubpre-commit,commit-msg, andpre-pushhooks passed, ornpm run validate:prpassed after refreshingorigin/mainwhen hooks were skipped or unavailablenpx vitest run --project cli src/lib/onboard/credential-navigation.test.ts→ 5 passed;npx vitest run --project integration test/onboard-selection.test.ts→ 67 passednpm testfor broad runtime/test-harness changes;npm run checkfor repo-wide validation/coverage changes — command/result:npm run docsbuilds without warnings (doc changes only)Behavior before and after
Driving the shipped helper with the menu answered
retryand the re-entry prompt answered with eachnavigation word.
Before:
After:
The added test fails on the parent commit with
AssertionError: expected 'credential' to be 'selection'and passes with this change.Prior art
The same class was fixed for the first-entry credential prompt in #3697 and again for the NVIDIA API
key prompt in #9404 / #9427. #9427 changed
src/lib/onboard.ts,src/lib/onboard/nvidia-featured-model-selection.ts,src/lib/onboard/nvidia-featured-model-selection.test.ts, andsrc/lib/onboard/setup-nim-selection.ts; it did not reachsrc/lib/onboard/validation-recovery-prompt.ts. This applies the same intent-classifier approach tothat remaining prompt.
Related but distinct: #6005 requests a general back-navigation key at every wizard step and is
labeled
needs: design. This change is narrower — a prompt that already advertisesbackandexitin its own menu text now honors them — and does not depend on that design decision.
Signed-off-by: Udaya Tejas udayatejas2004@gmail.com
Summary by CodeRabbit