Skip to content

feat(inference): prepare Kimi K2.7 curated selection - #5603

Closed
ericksoa wants to merge 9 commits into
mainfrom
upgrade-kimi-k27-selection-signed
Closed

feat(inference): prepare Kimi K2.7 curated selection#5603
ericksoa wants to merge 9 commits into
mainfrom
upgrade-kimi-k27-selection-signed

Conversation

@ericksoa

@ericksoa ericksoa commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Prepare moonshotai/kimi-k2.7-code in the NVIDIA Endpoints model picker, but require authenticated /v1/models catalog validation before accepting that curated choice.
  • Keep DEFAULT_CLOUD_MODEL pinned to nvidia/nemotron-3-super-120b-a12b and keep the Hermes Provider default on moonshotai/kimi-k2.6 until the provider/catalog source confirms K2.7 availability.
  • Preserve legacy K2.6 OpenClaw compatibility, but keep K2.7 out of the K2.6 managed-inference compatibility shim until captured or source-confirmed K2.7 managed-route output proves it needs the same handling.
  • Split K2.7-specific health/probe and catalog-gate prompt coverage into focused test files instead of growing larger inference test hotspots.
  • Harden bearer-token curl config cleanup so exported helpers only remove validated NemoClaw temp directories under the system temp root.

Availability gate

  • Kimi K2.7 Code is not treated as an unconditional default. When selected from NVIDIA Endpoints, NemoClaw validates it against the authenticated NVIDIA /v1/models catalog first and returns to model selection if the catalog omits it.
  • If K2.7 appears in /v1/models but the chat-completions route fails validation, onboarding returns to provider/model selection instead of committing the sandbox inference config.
  • Hermes Provider remains defaulted to Kimi K2.6. K2.7 can become a default only after the provider source-of-truth confirms it.

Review notes

  • The K2.7 OpenClaw compatibility path intentionally stays out of the K2.6 compat shim until captured or source-confirmed K2.7 managed-route output proves the same OpenClaw-incompatible shape.
  • Runtime E2E recommendations are covered here with targeted unit/helper coverage around selection recovery, credential config isolation, generated OpenClaw config, and plugin exclusion. No linked issue acceptance clauses were available for a literal acceptance-clause check.

Validation

  • npm run build:cli
  • npm run typecheck
  • npm run typecheck:cli
  • npm 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.ts
  • npm 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.ts
  • npm 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.ts
  • npm test -- test/onboard-selection.test.ts -t "selects DeepSeek V4 Pro"
  • npm test -- src/lib/onboard/setup-nim-selection.test.ts
  • npm run test-conditionals:scan -- --top 25
  • npm run source-shape:check
  • npm run test-size:check
  • npm run validate:configs
  • npx 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-yaml

Summary by CodeRabbit

  • New Features

    • Added support for Kimi K2.7 Code model with catalog validation for NVIDIA Endpoints
    • Implemented catalog-gated model availability validation to ensure models are accessible before use
  • Documentation

    • Updated NVIDIA Endpoints provider documentation to reflect curated model changes (removed GPT-OSS 120B, added Kimi K2.7 Code)
    • Enhanced validation behavior documentation for catalog-gated model support

@copy-pr-bot

copy-pr-bot Bot commented Jun 22, 2026

Copy link
Copy Markdown

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.

@coderabbitai

coderabbitai Bot commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Wait, I used a non-existent range ID. Let me fix that — range_f2c9bba05e05 should cover kimi-onboard-probes test, and I accidentally invented a placeholder. Let me redo the artifact cleanly.

Walkthrough

Adds Kimi K2.7 Code as a catalog-gated NVIDIA managed inference model. Extracts curl Authorization header management into a new curl-auth-config shared utility used by both NVIDIA model fetching and Kimi health probing. Generalizes Kimi health probing to cover K2.6 and K2.7 Code. Introduces catalog-validation gating in cloud model prompt selection. Explicitly excludes K2.7 Code from the K2.6 inference-compat shim pending managed-route equivalence confirmation.

Changes

Kimi K2.7 Code: catalog-gated model + curl auth config refactor

Layer / File(s) Summary
Curl auth config utility
src/lib/adapters/http/curl-auth-config.ts, src/lib/adapters/http/curl-auth-config.test.ts
New createAuthCurlConfig/cleanupAuthCurlConfig module manages temporary secure directories with curl config files carrying quoted Authorization headers; includes prefix validation, 0o700/0o600 permissions, and cleanup boundary checks with full test coverage.
NVIDIA model fetch: auth via curl config file
src/lib/inference/provider-models.ts, src/lib/inference/provider-models.test.ts
fetchNvidiaEndpointModels replaces the inline Authorization curl header with the new auth config file, passes --config and trustedConfigFiles to runCurlProbeImpl, and cleans up in a finally block. ProviderModelOptions.runCurlProbeImpl gains an optional CurlProbeOptions argument.
Kimi K2.7 Code config entry and CloudModelOption type
src/lib/inference/config.ts, src/lib/inference/model-prompts.ts, src/lib/inference/config.test.ts
Adds moonshotai/kimi-k2.7-code with requiresCatalogValidation: true to HERMES_PROVIDER_MODEL_OPTIONS. Introduces the exported CloudModelOption type and updates ModelPromptOptions.cloudModelOptions to use it. Tests confirm DEFAULT_CLOUD_MODEL, K2.7 Code option shape, and sandbox routing with inferenceCompat: null.
Catalog-gated cloud model prompt selection
src/lib/inference/model-prompts.ts, src/lib/inference/model-prompts-catalog-gate.test.ts
promptCloudModel tracks rejected curated IDs, calls validateNvidiaEndpointModelFn for requiresCatalogValidation options, marks failures rejected and re-prompts, and adjusts the curated default to exclude rejected entries. Tests cover credential gating, validation failure fallback, and default-prevention logic.
Generalized Kimi health probing (K2.6 + K2.7 Code)
src/lib/inference/health.ts, src/lib/inference/kimi-health.test.ts
Replaces the hardcoded K2.6 probe with model-parameterized probeNvidiaKimiHealth using a KIMI_MODEL_IDS set and kimiHealthLabel derivation. Delegates curl auth config creation/cleanup to the shared utility. All detail and error messages use the derived label.
Kimi NVIDIA chat-completions onboarding probe routing
src/lib/inference/onboard-probes.ts, src/lib/inference/kimi-onboard-probes.test.ts
Introduces KIMI_NVIDIA_CHAT_COMPLETIONS_MODELS set and isKimiNvidiaChatCompletionsModel predicate; updates getChatCompletionsProbeTimingArgs to apply K2.6 validation timing for both Kimi models. Test verifies K2.7 Code probe payload shape and --max-time 60.
NIM selection: K2.7 catalog route validation test
src/lib/onboard/setup-nim-selection.test.ts
Adds requireValueForTest helper, replaces inline null-check stubs, and adds a test verifying that a catalog-present K2.7 model failing route validation returns "retry-selection" with the expected validateOpenAiLikeSelection call shape.
Kimi inference-compat plugin: set-based ID normalization and K2.7 exclusion
nemoclaw-blueprint/openclaw-plugins/kimi-inference-compat/index.js, nemoclaw-blueprint/model-specific-setup/..., test/generate-openclaw-config-inference-registry.test.ts, test/kimi-inference-compat-plugin.test.ts
isKimiModelId switches to a KIMI_MODEL_IDS set with inference/-prefix normalization. Blueprint JSON and README add guidance excluding K2.7 Code from the shim until managed-route equivalence is confirmed. Tests assert K2.7 Code receives no compat wrapper or plugin entry.
Docs updates and integration test assertions
docs/inference/inference-options.mdx, skills/nemoclaw-user-configure-inference/references/inference-options.md, test/onboard-selection.test.ts
Inference-options docs replace GPT-OSS 120B with Kimi K2.7 Code and expand validation descriptions to cover catalog-gated models. Integration test asserts "Kimi K2.7 Code" appears in onboard selection output.

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)
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related PRs

  • NVIDIA/NemoClaw#3046: Adds the managed Kimi K2.6 exec-splitting plugin in the same nemoclaw-blueprint/openclaw-plugins/kimi-inference-compat/index.js file that this PR modifies for set-based model ID normalization and K2.7 Code exclusion.

Suggested labels

enhancement: inference, Provider: NVIDIA, configuration, documentation

Suggested reviewers

  • cv
  • jyaunches

Poem

🐇 A new Kimi hops in, K2.7 Code is its name,
The catalog must list it before it can claim,
Auth headers hide safe in a temp file now,
K2.6's shim stands guard — K2.7, not yet, somehow.
The rabbit checks labels and cleans up with care,
Two Kimis detected, one shim, handled fair! 🌟

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 3.70% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: preparing Kimi K2.7 curated selection for the NVIDIA Endpoints model picker, which is the primary focus across documentation, inference configuration, health checks, and onboarding validation changes throughout the changeset.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ 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 upgrade-kimi-k27-selection-signed

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

@github-code-quality

github-code-quality Bot commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

Code Coverage Overview

Languages: TypeScript

TypeScript / code-coverage/plugin

The overall coverage in the upgrade-kimi-k27-sel... branch is 96%. Coverage data for the main branch is not yet available.

Show a code coverage summary of the most covered files.
File main upgrade-kimi-k27-sel... 04a35de +/-
nemoclaw/src/se...cret-scanner.ts 100%
nemoclaw/src/commands/slash.ts 100%
nemoclaw/src/li...bprocess-env.ts 100%
nemoclaw/src/bl...eprint/state.ts 98%
nemoclaw/src/onboard/config.ts 98%
nemoclaw/src/bl...int/snapshot.ts 97%
nemoclaw/src/bl...print/runner.ts 95%
nemoclaw/src/co...ration-state.ts 94%
nemoclaw/src/bl...ate-networks.ts 94%
nemoclaw/src/index.ts 94%

TypeScript / code-coverage/cli

The overall coverage in the upgrade-kimi-k27-sel... branch is 47%. Coverage data for the main branch is not yet available.

Show a code coverage summary of the most covered files.
File main upgrade-kimi-k27-sel... 04a35de +/-
src/lib/state/o...oard-session.ts 91%
src/lib/inference/local.ts 76%
src/lib/sandbox/config.ts 72%
src/lib/actions...dbox/rebuild.ts 67%
src/lib/onboard/preflight.ts 64%
src/lib/actions...licy-channel.ts 56%
src/lib/state/sandbox.ts 55%
src/lib/onboard...er-gpu-patch.ts 50%
src/lib/policy/index.ts 49%
src/lib/onboard.ts 18%

Updated June 23, 2026 04:02 UTC
Code Coverage is in Public Preview. Learn more and provide us with your feedback.

@github-actions

Copy link
Copy Markdown
Contributor

@github-actions

github-actions Bot commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

E2E Advisor Recommendation

Required E2E: inference-routing-vitest, cloud-onboard-vitest, cloud-inference-vitest, kimi-inference-compat-vitest
Optional E2E: openclaw-inference-switch-vitest, onboard-negative-paths-vitest

Dispatch hint: inference-routing-vitest,cloud-onboard-vitest,cloud-inference-vitest,kimi-inference-compat-vitest

Workflow run

Full advisor summary

E2E Recommendation Advisor

Base: origin/main
Head: HEAD
Confidence: high

Required E2E

  • inference-routing-vitest (medium): Runs the focused live/PR-safe inference routing coverage for provider validation, invalid-key and unreachable-endpoint handling, and cleanup. This is required because the PR changes provider model validation, curl auth handling, probe construction, and route health logic.
  • cloud-onboard-vitest (high): Exercises the real cloud onboarding path with NVIDIA credentials and OpenShell setup. This is required because cloud model selection and NVIDIA catalog validation behavior changed in onboarding-facing code.
  • cloud-inference-vitest (high): Verifies a real cloud onboarded sandbox can complete a live inference.local chat request. This is required because the PR changes NVIDIA endpoint probes, health checks, and managed inference routing configuration used before sandbox creation and at runtime.
  • kimi-inference-compat-vitest (high): Covers the real Kimi/OpenClaw compatibility boundary, including model-specific setup and plugin behavior. This is required because the PR changes Kimi model matching, the K2.6 manifest guidance, and Kimi-specific probe/health behavior while introducing Kimi K2.7 Code as a distinct NVIDIA model.

Optional E2E

  • openclaw-inference-switch-vitest (high): Useful adjacent coverage for changing inference provider/model state after an OpenClaw sandbox exists. It is not strictly required if the required cloud onboarding and inference-routing lanes pass, but it increases confidence in route reconciliation after these inference config changes.
  • onboard-negative-paths-vitest (low): Optional focused check for onboarding credential failure output. The PR changes credential-dependent NVIDIA model validation and curl auth config handling, so this can provide extra assurance around invalid-key behavior.

New E2E recommendations

  • catalog-gated curated NVIDIA models (medium): Existing live E2E appears to exercise default NVIDIA cloud onboarding but not interactive selection of a catalog-gated curated model such as moonshotai/kimi-k2.7-code, nor the fallback when /v1/models omits it.
    • Suggested test: Add a focused E2E scenario that drives the cloud model picker to select a catalog-gated curated NVIDIA model with a mocked or controlled /v1/models response, proving both accepted and rejected catalog paths without leaking NVIDIA_INFERENCE_API_KEY.

Dispatch hint

  • Workflow: .github/workflows/e2e-vitest-scenarios.yaml
  • jobs input: inference-routing-vitest,cloud-onboard-vitest,cloud-inference-vitest,kimi-inference-compat-vitest

@github-actions

github-actions Bot commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

Vitest E2E Scenario Recommendation

Required Vitest E2E scenarios: ubuntu-repo-cloud-openclaw, kimi-inference-compat-vitest, inference-routing-vitest
Optional Vitest E2E scenarios: cloud-inference-vitest

Dispatch required Vitest E2E scenarios:

  • gh workflow run e2e-vitest-scenarios.yaml --ref <pr-head-ref> --field scenarios=ubuntu-repo-cloud-openclaw
  • gh workflow run e2e-vitest-scenarios.yaml --ref <pr-head-ref> --field jobs=kimi-inference-compat-vitest
  • gh workflow run e2e-vitest-scenarios.yaml --ref <pr-head-ref> --field jobs=inference-routing-vitest

Workflow run

Full Vitest E2E advisor summary

Vitest E2E Scenario Advisor

Base: origin/main
Head: HEAD
Confidence: high

Required Vitest E2E scenarios

  • ubuntu-repo-cloud-openclaw: Core inference configuration, NVIDIA endpoint catalog validation, onboarding probe behavior, and managed inference.local routing changed. The live-supported Ubuntu cloud OpenClaw typed scenario exercises the standard NVIDIA cloud onboarding path plus inference and credential state validation.
    • Dispatch: gh workflow run e2e-vitest-scenarios.yaml --ref <pr-head-ref> --field scenarios=ubuntu-repo-cloud-openclaw
  • kimi-inference-compat-vitest: The PR changes the Kimi managed-inference manifest and OpenClaw compatibility plugin while deliberately keeping the K2.6 shim scoped away from K2.7. This free-standing live Vitest job directly verifies Kimi plugin wiring, the managed inference.local route, and agent/tool-call compatibility.
    • Dispatch: gh workflow run e2e-vitest-scenarios.yaml --ref <pr-head-ref> --field jobs=kimi-inference-compat-vitest
  • inference-routing-vitest: The PR changes inference routing helpers, provider model catalog probing, credential handling for curl auth config files, health probes, and onboarding validation. This free-standing live Vitest job covers PR-safe inference routing failure classification, cleanup, and NVIDIA credential isolation behavior.
    • Dispatch: gh workflow run e2e-vitest-scenarios.yaml --ref <pr-head-ref> --field jobs=inference-routing-vitest

Optional Vitest E2E scenarios

  • cloud-inference-vitest: Optional adjacent coverage for the install.sh/non-interactive cloud inference path. It overlaps the required cloud OpenClaw typed scenario but adds an end-to-end sandbox inference.local chat smoke through the installed CLI path.
    • Dispatch: gh workflow run e2e-vitest-scenarios.yaml --ref <pr-head-ref> --field jobs=cloud-inference-vitest

Relevant changed files

  • nemoclaw-blueprint/model-specific-setup/openclaw/kimi-k2.6-managed-inference.json
  • nemoclaw-blueprint/openclaw-plugins/kimi-inference-compat/index.js
  • src/lib/adapters/http/curl-auth-config.ts
  • src/lib/inference/config.ts
  • src/lib/inference/health.ts
  • src/lib/inference/model-prompts.ts
  • src/lib/inference/onboard-probes.ts
  • src/lib/inference/provider-models.ts

@github-actions

github-actions Bot commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

PR Review Advisor — No blocking findings

Merge posture: No blocking advisor findings
Primary next action: Add or justify PRA-T1 and any related test follow-ups.
Open items: 0 required · 0 warnings · 0 suggestions · 3 test follow-ups
Since last review: 0 prior items resolved · 0 still apply · 0 new items found

Action checklist

  • PRA-T1 Add or justify test follow-up: Runtime validation
  • PRA-T2 Add or justify test follow-up: Runtime validation
  • PRA-T3 Add or justify test follow-up: Runtime validation
Test follow-ups to resolve or justify

If these cover changed behavior, prefer adding them in this PR; otherwise state why existing coverage is enough or link the follow-up.

  • PRA-T1 Runtime validation — NVIDIA Endpoints onboarding where /models contains moonshotai/kimi-k2.7-code but /chat/completions returns 404 returns to provider/model selection before sandbox config is applied.. Unit/helper coverage is strong for prompt gating, credential config isolation, health probes, route-validation recovery, generated OpenClaw config, and plugin exclusion. Runtime validation is still advisable because the change crosses real curl spawning, temporary credential files, live NVIDIA catalog availability, and generated sandbox/OpenClaw configuration.
  • PRA-T2 Runtime validation — A real runCurlProbe path for NVIDIA /models sends bearer auth only through the trusted temp curl config file and removes the temp directory after both success and failure.. Unit/helper coverage is strong for prompt gating, credential config isolation, health probes, route-validation recovery, generated OpenClaw config, and plugin exclusion. Runtime validation is still advisable because the change crosses real curl spawning, temporary credential files, live NVIDIA catalog availability, and generated sandbox/OpenClaw configuration.
  • PRA-T3 Runtime validation — Generated OpenClaw config for managed inference moonshotai/kimi-k2.7-code contains no nemoclaw-kimi-inference-compat plugin entry and no K2.6 compat fields.. Unit/helper coverage is strong for prompt gating, credential config isolation, health probes, route-validation recovery, generated OpenClaw config, and plugin exclusion. Runtime validation is still advisable because the change crosses real curl spawning, temporary credential files, live NVIDIA catalog availability, and generated sandbox/OpenClaw configuration.

Workflow run details

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.

@ericksoa
ericksoa marked this pull request as ready for review June 23, 2026 04:03
@ericksoa
ericksoa marked this pull request as draft June 23, 2026 04:07

@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/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

📥 Commits

Reviewing files that changed from the base of the PR and between 60a92d1 and 04a35de.

📒 Files selected for processing (21)
  • docs/inference/inference-options.mdx
  • nemoclaw-blueprint/model-specific-setup/README.md
  • nemoclaw-blueprint/model-specific-setup/openclaw/kimi-k2.6-managed-inference.json
  • nemoclaw-blueprint/openclaw-plugins/kimi-inference-compat/index.js
  • skills/nemoclaw-user-configure-inference/references/inference-options.md
  • src/lib/adapters/http/curl-auth-config.test.ts
  • src/lib/adapters/http/curl-auth-config.ts
  • src/lib/inference/config.test.ts
  • src/lib/inference/config.ts
  • src/lib/inference/health.ts
  • src/lib/inference/kimi-health.test.ts
  • src/lib/inference/kimi-onboard-probes.test.ts
  • src/lib/inference/model-prompts-catalog-gate.test.ts
  • src/lib/inference/model-prompts.ts
  • src/lib/inference/onboard-probes.ts
  • src/lib/inference/provider-models.test.ts
  • src/lib/inference/provider-models.ts
  • src/lib/onboard/setup-nim-selection.test.ts
  • test/generate-openclaw-config-inference-registry.test.ts
  • test/kimi-inference-compat-plugin.test.ts
  • test/onboard-selection.test.ts

Comment on lines +59 to +79
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.",
);
});

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.

🎯 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.md

Repository: 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.

Suggested change
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.

@wscurran wscurran added area: inference Inference routing, serving, model selection, or outputs feature PR adds or expands user-visible functionality labels Jun 23, 2026
@github-actions github-actions Bot mentioned this pull request Jul 7, 2026
21 tasks
@ericksoa

ericksoa commented Jul 8, 2026

Copy link
Copy Markdown
Contributor Author

Superseded for now by #6475, which removes the unavailable Kimi K2.6 NVIDIA Endpoints onboarding choice until a replacement model is live.

@ericksoa ericksoa closed this Jul 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: inference Inference routing, serving, model selection, or outputs feature PR adds or expands user-visible functionality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants