fix(onboard): validate nvapi- key prefix in non-interactive mode#1407
Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughNon-interactive onboarding now performs value-level validation of Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
79b5fda to
097aba2
Compare
|
✨ |
|
The CodeRabbit pre-merge check warning is a false positive. |
…DIA#1380) Non-interactive onboard with an sk-* key from Inference Hub now fails early with a clear message instead of an opaque HTTP 401. Signed-off-by: Yimo Jiang <yimoj@nvidia.com> Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
ae55f78 to
70ad1f4
Compare
…DIA#1407) ## Summary - Non-interactive onboard with `NEMOCLAW_PROVIDER=cloud` now validates the `NVIDIA_API_KEY` prefix before hitting the endpoint, using the existing `validateNvidiaApiKeyValue()` helper - An `sk-*` key (or any non-`nvapi-*` key) now fails early with a clear message and the correct URL to obtain a key, instead of an opaque `HTTP 401: Authentication failed` Closes NVIDIA#1380 ## Test plan - [x] Tested manually: `NVIDIA_API_KEY="sk-fake" NEMOCLAW_NON_INTERACTIVE=1 ... nemoclaw onboard` now prints `Invalid key. Must start with nvapi-` and `Get a key from https://build.nvidia.com/settings/api-keys` - [x] All 713 existing tests pass (2 pre-existing failures in `install-preflight.test.js` unrelated to this change) Signed-off-by: Yimo Jiang <yimoj@nvidia.com> 🤖 Generated with [Claude Code](https://claude.com/claude-code) <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Bug Fixes** * Strengthened NVIDIA API key validation during non-interactive setup; now shows clearer error text and a help link when the key is invalid and stops the setup. * **Tests** * Added an automated test that simulates the non-interactive onboarding flow with an invalid NVIDIA key, asserting no interactive prompts occur and the proper error and exit behavior. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Signed-off-by: Yimo Jiang <yimoj@nvidia.com> Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Co-authored-by: Carlos Villela <cvillela@nvidia.com>
Summary
NEMOCLAW_PROVIDER=cloudnow validates theNVIDIA_API_KEYprefix before hitting the endpoint, using the existingvalidateNvidiaApiKeyValue()helpersk-*key (or any non-nvapi-*key) now fails early with a clear message and the correct URL to obtain a key, instead of an opaqueHTTP 401: Authentication failedCloses #1380
Test plan
NVIDIA_API_KEY="sk-fake" NEMOCLAW_NON_INTERACTIVE=1 ... nemoclaw onboardnow printsInvalid key. Must start with nvapi-andGet a key from https://build.nvidia.com/settings/api-keysinstall-preflight.test.jsunrelated to this change)Signed-off-by: Yimo Jiang yimoj@nvidia.com
🤖 Generated with Claude Code
Summary by CodeRabbit
Bug Fixes
Tests