Skip to content

feat(onboard): surface back-navigation hint on inference setup prompts - #7190

Closed
laitingsheng wants to merge 8 commits into
mainfrom
feat/onboard-prompt-back-navigation
Closed

feat(onboard): surface back-navigation hint on inference setup prompts#7190
laitingsheng wants to merge 8 commits into
mainfrom
feat/onboard-prompt-back-navigation

Conversation

@laitingsheng

@laitingsheng laitingsheng commented Jul 19, 2026

Copy link
Copy Markdown
Contributor

Summary

The inference provider setup prompts already accepted a back reply to return to provider selection, but the option was never shown, so users could not discover it and pressed Ctrl+C instead. This surfaces a visible navigation hint before the credential and Hermes auth prompts and accepts the short b token as a back alias. Behaviour is interactive-only, so non-interactive runs are unchanged.

Related Issue

Partial progress toward #6005

Changes

  • Add NAVIGATION_HINT and printNavigationHint() to src/lib/navigation.ts as the single source for the hint text.
  • Accept the short b token as a back alias in both getNavigationChoice parsers (prompt-helpers.ts, credential-navigation.ts).
  • Print the hint before the credential entry prompt and before the Hermes auth-method and Nous API key prompts.
  • No control-flow change: the prompts already routed back to provider selection; this only makes the existing affordance visible and keyboard-friendly.

Type of Change

  • Code change (feature, bug fix, or refactor)
  • Code change with doc updates
  • Doc only (prose changes, no code sample modifications)
  • Doc only (includes code sample changes)

Quality Gates

  • Tests added or updated for changed behavior
  • Existing tests cover changed behavior — justification:
  • Tests not applicable — justification:
  • Docs updated for user-facing behavior changes
  • Docs not applicable — justification: interactive prompt hint only; no documented onboarding flow, command, or option surface changes.
  • Sensitive paths changed (security, policy, credentials, preflight, onboarding, inference, runner, sandbox, or messaging)
  • Sensitive-path review completed or maintainer-approved waiver recorded — reviewer/approval link/justification: onboarding/credential prompt paths touched; requesting maintainer sensitive-path review.
  • Non-success, skipped, or missing CI check accepted by maintainer — check name, approval link, and follow-up issue:

Verification

  • PR description includes a Signed-off-by: line and every commit appears as Verified in GitHub
  • Normal pre-commit, commit-msg, and pre-push hooks passed, or npm run check:diff passed when hooks were skipped or unavailable
  • Targeted behavior tests pass for the current change set, or tests are marked not applicable above — command/result: npx vitest run src/lib/onboard/prompt-helpers.test.ts src/lib/onboard/credential-navigation.test.ts src/lib/onboard/hermes-auth.test.ts → 32 passed; npm run test:changed → 14 files / 211 passed.
  • Applicable broad gate passed — npm test for broad runtime/test-harness changes; npm run check for repo-wide validation/coverage changes — command/result:
  • Quality Gates section completed with required justifications or waivers
  • No secrets, API keys, or credentials committed
  • npm run docs builds without warnings (doc changes only)
  • Doc pages follow the style guide (doc changes only)
  • New doc pages include SPDX header and frontmatter (new pages only)

Signed-off-by: Tinson Lai tinsonl@nvidia.com

Summary by CodeRabbit

  • New Features
    • Added centralized navigation-hint messaging for interactive onboarding prompts.
    • Enabled b as a shortcut to return to provider selection across prompts.
  • Bug Fixes
    • Improved back-navigation parsing so b (whitespace/case variants) is treated as back.
    • Ensured the navigation hint is presented at the right time before credential entry.
  • Documentation
    • Updated Quickstart guides to mention the b shortcut when hints are shown.
  • Tests
    • Expanded coverage for navigation choice normalization and hint logging behavior in interactive vs non-interactive modes.

@github-code-quality

github-code-quality Bot commented Jul 19, 2026

Copy link
Copy Markdown
Contributor

Code Coverage Overview

Languages: TypeScript

TypeScript / code-coverage/plugin

The overall coverage remains at 96%, unchanged from the main branch.

TypeScript / code-coverage/cli

The overall coverage in the feat/onboard-prompt-... branch remains at 80%, unchanged from the main branch.

Show a code coverage summary of the most impacted files.
File main 78e0e4e feat/onboard-prompt-... ba733ea +/-
src/lib/domain/.../connect-env.ts 97% 89% -8%
src/lib/onboard...ompt-helpers.ts 59% 56% -3%
src/lib/credentials/store.ts 59% 59% 0%
src/lib/navigation.ts 100% 100% 0%
src/lib/sandbox...rce-identity.ts 91% 91% 0%
src/lib/state/m...-acquisition.ts 84% 84% 0%
src/lib/onboard/hermes-auth.ts 78% 83% +5%
src/lib/inferen...er-lifecycle.ts 65% 71% +6%
src/lib/onboard...l-navigation.ts 32% 41% +9%
src/lib/inferen...lama/process.ts 50% 100% +50%

Updated July 19, 2026 09:50 UTC
Code Coverage is in Public Preview. Learn more and provide us with your feedback.

@coderabbitai

coderabbitai Bot commented Jul 19, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

Adds a shared navigation hint, supports b as a back token, and displays the hint in credential and Hermes authentication prompts. Tests cover token parsing, interactive hint output, non-interactive behavior, and back navigation.

Changes

Onboarding navigation

Layer / File(s) Summary
Navigation hint and token handling
src/lib/navigation.ts, src/lib/onboard/prompt-helpers.ts, src/lib/credentials/store.ts, src/lib/onboard/prompt-helpers.test.ts, docs/get-started/*.mdx
Adds the exported navigation hint printer, recognizes normalized b input as back, maps it to credential back intent, tests token parsing, and documents the shortcut in quickstarts.
Credential prompt integration
src/lib/onboard/credential-navigation.ts, src/lib/onboard/credential-navigation.test.ts
Adds the short back token to credential navigation and prints guidance before named credential entry, with coverage for back routing and skipped credential persistence.
Hermes authentication prompts
src/lib/onboard/hermes-auth.ts, src/lib/onboard/hermes-auth.test.ts
Prints navigation guidance before interactive authentication and API key prompts, with tests for interactive-only output and back selection.

Estimated code review effort: 2 (Simple) | ~10 minutes

Sequence Diagram(s)

sequenceDiagram
  participant User
  participant HermesAuthPrompt
  participant getNavigationChoice
  participant PreviousSelection
  HermesAuthPrompt->>User: print navigation hint
  User->>HermesAuthPrompt: enter b
  HermesAuthPrompt->>getNavigationChoice: parse input
  getNavigationChoice-->>HermesAuthPrompt: back
  HermesAuthPrompt->>PreviousSelection: return to provider selection
Loading
🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Linked Issues check ⚠️ Warning The PR only adds hints and a b alias for some inference prompts; it does not implement back-navigation for every onboard step or Backspace support. Extend back-navigation to all onboard wizard prompts, support Backspace, and return users to the prior step with their answers preserved.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Out of Scope Changes check ✅ Passed All changes appear related to the onboarding back-navigation work and its supporting tests and docs.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the main change: surfacing back-navigation hints on onboarding/inference setup prompts.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/onboard-prompt-back-navigation

Comment @coderabbitai help to get the list of available commands.

@laitingsheng laitingsheng added area: onboarding Onboarding FSM, provider setup, sandbox launch, or first-run flow bug-fix PR fixes a bug or regression labels Jul 19, 2026
@github-actions

github-actions Bot commented Jul 19, 2026

Copy link
Copy Markdown
Contributor

PR Review Advisor — Informational

Advisor assessment: Informational / high confidence
Next action: No advisor follow-up needed.
Findings: 0 blockers · 0 warnings · 0 suggestions
Status: No actionable findings remain in the canonical review ledger.

Model lanes

  • GPT-5.6 Terra (primary): Completed · high confidence · 0 blockers · 0 warnings · 0 suggestions
  • Nemotron 3 Ultra (second opinion): Completed · high confidence · 1 blocker · 4 warnings · 0 suggestions
  • Model comparison: normalized findings differ; normalized E2E selections differ; Nemotron reported 1 more blocker, 4 more warnings, the same number of suggestions.

Nemotron output stays in workflow artifacts and does not change the assessment above.

E2E guidance

Advisory only. E2E / PR Gate selects and runs jobs independently.

Recommended E2E: credential-sanitization, security-posture, onboard-repair, onboard-resume, cloud-onboard

2 optional E2E recommendations
  • onboard-negative-paths
  • docs-validation

Workflow run details

This automated review informs maintainers. Warnings and suggestions do not require a response. A maintainer decides whether to merge.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 4

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/lib/onboard/hermes-auth.test.ts`:
- Around line 51-62: Update the test for promptHermesAuthMethod to record both
console logging and the interactive prompt as ordered events, then assert that
NAVIGATION_HINT appears before the prompt event. Replace the current
presence-only logSpy.mock.calls check while preserving the existing interactive
setup.
- Around line 64-71: Update the test around the back-flow case in the
auth-method prompt to use the production navigation parser or wiring for
getNavigationChoice instead of a mock that always returns "back". Preserve the
prompt response "b" and assert the flow reaches provider selection through the
real parsing behavior.
- Around line 52-53: Add an afterEach cleanup hook in the test suite containing
the console.log spy and vi.stubEnv calls, using the repository-standard
equivalents of vi.restoreAllMocks() and vi.unstubAllEnvs(). Ensure cleanup runs
after every test so mock spies and environment overrides do not leak into
subsequent cases.

In `@src/lib/onboard/prompt-helpers.test.ts`:
- Around line 20-40: Append the required "(`#6005`)" suffix to the enclosing
describe titles for getNavigationChoice back token in
src/lib/onboard/prompt-helpers.test.ts:20-40, credential prompt navigation
helpers in src/lib/onboard/credential-navigation.test.ts:13-20, and Hermes auth
back-navigation affordance in src/lib/onboard/hermes-auth.test.ts:50-87.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: a1551dc5-70c2-4dba-a282-a1964b075424

📥 Commits

Reviewing files that changed from the base of the PR and between 78e0e4e and 848b890.

📒 Files selected for processing (7)
  • src/lib/navigation.ts
  • src/lib/onboard/credential-navigation.test.ts
  • src/lib/onboard/credential-navigation.ts
  • src/lib/onboard/hermes-auth.test.ts
  • src/lib/onboard/hermes-auth.ts
  • src/lib/onboard/prompt-helpers.test.ts
  • src/lib/onboard/prompt-helpers.ts

Comment thread src/lib/onboard/hermes-auth.test.ts
Comment thread src/lib/onboard/hermes-auth.test.ts Outdated
Comment thread src/lib/onboard/hermes-auth.test.ts
Comment thread src/lib/onboard/prompt-helpers.test.ts Outdated
@laitingsheng laitingsheng added feature PR adds or expands user-visible functionality and removed bug-fix PR fixes a bug or regression labels Jul 19, 2026
@apurvvkumaria apurvvkumaria self-assigned this Jul 19, 2026
apurvvkumaria and others added 3 commits July 19, 2026 00:56
Co-authored-by: Tinson Lai <tinsonl@nvidia.com>
Signed-off-by: Apurv Kumaria <akumaria@nvidia.com>
Co-authored-by: Tinson Lai <tilai@nvidia.com>
Signed-off-by: Apurv Kumaria <akumaria@nvidia.com>
Co-authored-by: Tinson Lai <tilai@nvidia.com>
Signed-off-by: Apurv Kumaria <akumaria@nvidia.com>
@github-actions

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@docs/get-started/quickstart-langchain-deepagents-code.mdx`:
- Line 100: Update the navigation hint in the quickstart documentation so the
`b` destination matches the preceding `back` behavior, or explicitly limit the
provider-selection wording to prompts where that destination applies.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 6e494889-3efd-4f4f-b669-57befbb45355

📥 Commits

Reviewing files that changed from the base of the PR and between d3bacdc and 1387686.

📒 Files selected for processing (3)
  • docs/get-started/quickstart-hermes.mdx
  • docs/get-started/quickstart-langchain-deepagents-code.mdx
  • docs/get-started/quickstart.mdx

Comment thread docs/get-started/quickstart-langchain-deepagents-code.mdx Outdated
Co-authored-by: Tinson Lai <tilai@nvidia.com>
Signed-off-by: Apurv Kumaria <akumaria@nvidia.com>

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/lib/onboard/credential-navigation.test.ts`:
- Around line 16-19: Update the test lifecycle hooks around
NEMOCLAW_TEST_NAVIGATION_KEY to capture its pre-test value in beforeEach and
restore that exact value in afterEach, deleting it only when it was originally
unset. Keep the existing vi.restoreAllMocks() cleanup intact.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 0678bfbb-124e-4382-8bf5-776ff2ae523c

📥 Commits

Reviewing files that changed from the base of the PR and between 1387686 and dfed102.

📒 Files selected for processing (2)
  • src/lib/credentials/store.ts
  • src/lib/onboard/credential-navigation.test.ts

Comment thread src/lib/onboard/credential-navigation.test.ts
apurvvkumaria and others added 2 commits July 19, 2026 02:35
Co-authored-by: Tinson Lai <tinsonl@nvidia.com>
Signed-off-by: Apurv Kumaria <akumaria@nvidia.com>
Co-authored-by: Tinson Lai <tinsonl@nvidia.com>
Signed-off-by: Apurv Kumaria <akumaria@nvidia.com>

@apurvvkumaria apurvvkumaria left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed exact head ba733ea against current base 78e0e4e. The change is narrowly scoped to the inference-setup back-navigation hint, preserves the existing prompt/backspace behavior, and no longer claims to close the broader all-prompts issue. Focused tests pass 33/33, the docs build passes, all commits are Verified with DCO green, protected E2E and ordinary CI/advisors are green, and there are no unresolved threads. No blocking issue found.

@laitingsheng
laitingsheng deleted the feat/onboard-prompt-back-navigation branch July 19, 2026 12:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: onboarding Onboarding FSM, provider setup, sandbox launch, or first-run flow feature PR adds or expands user-visible functionality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants