feat(inference): prepare Kimi K2.7 curated selection - #5603
Conversation
|
Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually. Contributors can view more details about this message here. |
📝 WalkthroughWait, I used a non-existent range ID. Let me fix that — WalkthroughAdds Kimi K2.7 Code as a catalog-gated NVIDIA managed inference model. Extracts curl Authorization header management into a new ChangesKimi K2.7 Code: catalog-gated model + curl auth config refactor
Sequence Diagram(s)sequenceDiagram
participant User
participant promptCloudModel
participant NVIDIA_API as NVIDIA /v1/models Catalog
participant createAuthCurlConfig
participant runCurlProbeImpl
User->>promptCloudModel: select "Kimi K2.7 Code"
promptCloudModel->>promptCloudModel: requiresCatalogValidation? yes
promptCloudModel->>promptCloudModel: check NVIDIA_INFERENCE_API_KEY present
promptCloudModel->>NVIDIA_API: validateNvidiaEndpointModelFn(model)
NVIDIA_API-->>promptCloudModel: ok / not found
promptCloudModel-->>User: return model ID or mark rejected + reprompt
Note over createAuthCurlConfig,runCurlProbeImpl: NVIDIA model fetch / Kimi health probe
createAuthCurlConfig->>createAuthCurlConfig: write auth.conf (0o600) in tmpDir (0o700)
createAuthCurlConfig-->>runCurlProbeImpl: --config authConfigPath, trustedConfigFiles
runCurlProbeImpl-->>createAuthCurlConfig: result
createAuthCurlConfig->>createAuthCurlConfig: cleanupAuthCurlConfig (finally)
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
Code Coverage OverviewLanguages: TypeScript TypeScript / code-coverage/pluginThe overall coverage in the Show a code coverage summary of the most covered files.
TypeScript / code-coverage/cliThe overall coverage in the Show a code coverage summary of the most covered files.
Updated |
|
🌿 Preview your docs: https://nvidia-preview-pr-5603.docs.buildwithfern.com/nemoclaw |
E2E Advisor RecommendationRequired E2E: Dispatch hint: Full advisor summaryE2E Recommendation AdvisorBase: Required E2E
Optional E2E
New E2E recommendations
Dispatch hint
|
Vitest E2E Scenario RecommendationRequired Vitest E2E scenarios: Dispatch required Vitest E2E scenarios:
Full Vitest E2E advisor summaryVitest E2E Scenario AdvisorBase: Required Vitest E2E scenarios
Optional Vitest E2E scenarios
Relevant changed files
|
PR Review Advisor — No blocking findingsMerge posture: No blocking advisor findings Action checklist
Test follow-ups to resolve or justifyIf these cover changed behavior, prefer adding them in this PR; otherwise state why existing coverage is enough or link the follow-up.
This is an automated, non-binding review; it still expects maintainers and agents to respond to each required or warning item. Treat suggestions as current-PR improvements when they touch changed code; defer only with maintainer rationale or a linked follow-up. A human maintainer must make the final merge decision. |
There was a problem hiding this comment.
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/inference/model-prompts-catalog-gate.test.ts`:
- Around line 59-79: The error message in the test expectation for the
promptCloudModel function is referencing NVIDIA_INFERENCE_API_KEY, but the
onboarding documentation specifies NVIDIA_API_KEY, causing a mismatch. Update
the error message string passed to expect(errorLine).toHaveBeenCalledWith() to
reference NVIDIA_API_KEY instead of NVIDIA_INFERENCE_API_KEY to align with the
documented environment variable name. Additionally, locate and update the actual
implementation code where this error message is generated to use the same
corrected variable name.
🪄 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: b8ee0a0c-7083-41c2-9764-311fe89a6ae2
📒 Files selected for processing (21)
docs/inference/inference-options.mdxnemoclaw-blueprint/model-specific-setup/README.mdnemoclaw-blueprint/model-specific-setup/openclaw/kimi-k2.6-managed-inference.jsonnemoclaw-blueprint/openclaw-plugins/kimi-inference-compat/index.jsskills/nemoclaw-user-configure-inference/references/inference-options.mdsrc/lib/adapters/http/curl-auth-config.test.tssrc/lib/adapters/http/curl-auth-config.tssrc/lib/inference/config.test.tssrc/lib/inference/config.tssrc/lib/inference/health.tssrc/lib/inference/kimi-health.test.tssrc/lib/inference/kimi-onboard-probes.test.tssrc/lib/inference/model-prompts-catalog-gate.test.tssrc/lib/inference/model-prompts.tssrc/lib/inference/onboard-probes.tssrc/lib/inference/provider-models.test.tssrc/lib/inference/provider-models.tssrc/lib/onboard/setup-nim-selection.test.tstest/generate-openclaw-config-inference-registry.test.tstest/kimi-inference-compat-plugin.test.tstest/onboard-selection.test.ts
| it("requires a local NVIDIA key before accepting catalog-gated curated models", async () => { | ||
| const errorLine = vi.fn(); | ||
| const result = await promptCloudModel({ | ||
| promptFn: promptSequence(["1"]), | ||
| errorLine, | ||
| writeLine: vi.fn(), | ||
| getCredentialFn: () => null, | ||
| cloudModelOptions: [ | ||
| { | ||
| id: "moonshotai/kimi-k2.7-code", | ||
| label: "Kimi K2.7 Code", | ||
| requiresCatalogValidation: true, | ||
| }, | ||
| ], | ||
| }); | ||
|
|
||
| expect(result).toBe(BACK_TO_SELECTION); | ||
| expect(errorLine).toHaveBeenCalledWith( | ||
| " NVIDIA_INFERENCE_API_KEY is required before selecting Kimi K2.7 Code; NemoClaw must first confirm it appears in the NVIDIA Endpoints catalog.", | ||
| ); | ||
| }); |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟠 Major
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
set -euo pipefail
rg -n "NVIDIA_INFERENCE_API_KEY|NVIDIA_API_KEY" \
src/lib/inference \
test \
skills/nemoclaw-user-configure-inference/references/inference-options.mdRepository: NVIDIA/NemoClaw
Length of output: 50371
Align catalog-gated model error message with documentation.
The error message on line 77 specifies NVIDIA_INFERENCE_API_KEY, but the onboarding docs (inference-options.md:56) direct users to NVIDIA_API_KEY. This mismatch creates user confusion when they follow the documented variable name but encounter an error message asking for a different one.
Suggested correction
- " NVIDIA_INFERENCE_API_KEY is required before selecting Kimi K2.7 Code; NemoClaw must first confirm it appears in the NVIDIA Endpoints catalog.",
+ " NVIDIA_API_KEY is required before selecting Kimi K2.7 Code; NemoClaw must first confirm it appears in the NVIDIA Endpoints catalog.",📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| it("requires a local NVIDIA key before accepting catalog-gated curated models", async () => { | |
| const errorLine = vi.fn(); | |
| const result = await promptCloudModel({ | |
| promptFn: promptSequence(["1"]), | |
| errorLine, | |
| writeLine: vi.fn(), | |
| getCredentialFn: () => null, | |
| cloudModelOptions: [ | |
| { | |
| id: "moonshotai/kimi-k2.7-code", | |
| label: "Kimi K2.7 Code", | |
| requiresCatalogValidation: true, | |
| }, | |
| ], | |
| }); | |
| expect(result).toBe(BACK_TO_SELECTION); | |
| expect(errorLine).toHaveBeenCalledWith( | |
| " NVIDIA_INFERENCE_API_KEY is required before selecting Kimi K2.7 Code; NemoClaw must first confirm it appears in the NVIDIA Endpoints catalog.", | |
| ); | |
| }); | |
| it("requires a local NVIDIA key before accepting catalog-gated curated models", async () => { | |
| const errorLine = vi.fn(); | |
| const result = await promptCloudModel({ | |
| promptFn: promptSequence(["1"]), | |
| errorLine, | |
| writeLine: vi.fn(), | |
| getCredentialFn: () => null, | |
| cloudModelOptions: [ | |
| { | |
| id: "moonshotai/kimi-k2.7-code", | |
| label: "Kimi K2.7 Code", | |
| requiresCatalogValidation: true, | |
| }, | |
| ], | |
| }); | |
| expect(result).toBe(BACK_TO_SELECTION); | |
| expect(errorLine).toHaveBeenCalledWith( | |
| " NVIDIA_API_KEY is required before selecting Kimi K2.7 Code; NemoClaw must first confirm it appears in the NVIDIA Endpoints catalog.", | |
| ); | |
| }); |
🤖 Prompt for 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.
In `@src/lib/inference/model-prompts-catalog-gate.test.ts` around lines 59 - 79,
The error message in the test expectation for the promptCloudModel function is
referencing NVIDIA_INFERENCE_API_KEY, but the onboarding documentation specifies
NVIDIA_API_KEY, causing a mismatch. Update the error message string passed to
expect(errorLine).toHaveBeenCalledWith() to reference NVIDIA_API_KEY instead of
NVIDIA_INFERENCE_API_KEY to align with the documented environment variable name.
Additionally, locate and update the actual implementation code where this error
message is generated to use the same corrected variable name.
|
Superseded for now by #6475, which removes the unavailable Kimi K2.6 NVIDIA Endpoints onboarding choice until a replacement model is live. |
Summary
moonshotai/kimi-k2.7-codein the NVIDIA Endpoints model picker, but require authenticated/v1/modelscatalog validation before accepting that curated choice.DEFAULT_CLOUD_MODELpinned tonvidia/nemotron-3-super-120b-a12band keep the Hermes Provider default onmoonshotai/kimi-k2.6until the provider/catalog source confirms K2.7 availability.Availability gate
/v1/modelscatalog first and returns to model selection if the catalog omits it./v1/modelsbut the chat-completions route fails validation, onboarding returns to provider/model selection instead of committing the sandbox inference config.Review notes
Validation
npm run build:clinpm run typechecknpm run typecheck:clinpm test -- src/lib/adapters/http/curl-auth-config.test.ts src/lib/inference/provider-models.test.ts src/lib/inference/health.test.ts src/lib/inference/kimi-health.test.tsnpm test -- src/lib/inference/model-prompts.test.ts src/lib/inference/model-prompts-catalog-gate.test.ts src/lib/inference/provider-models.test.ts src/lib/inference/health.test.ts src/lib/inference/kimi-health.test.ts src/lib/onboard/setup-nim-selection.test.ts test/kimi-inference-compat-plugin.test.ts test/generate-openclaw-config-inference-registry.test.ts src/lib/inference/config.test.tsnpm test -- src/lib/inference/model-prompts.test.ts src/lib/inference/config.test.ts src/lib/inference/kimi-health.test.ts src/lib/inference/kimi-onboard-probes.test.ts test/kimi-inference-compat-plugin.test.ts test/generate-openclaw-config-inference-registry.test.tsnpm test -- test/onboard-selection.test.ts -t "selects DeepSeek V4 Pro"npm test -- src/lib/onboard/setup-nim-selection.test.tsnpm run test-conditionals:scan -- --top 25npm run source-shape:checknpm run test-size:checknpm run validate:configsnpx prek run --all-files --stage pre-push --skip tsc-plugin --skip tsc-js --skip tsc-cli --skip version-tag-sync --skip test-cli --skip test-plugin --skip source-shape-test-budget --skip test-file-size-budget --skip test-skills-yamlSummary by CodeRabbit
New Features
Documentation