From 92079350d6bfbf7f5a919e568f51ccd1a54e6735 Mon Sep 17 00:00:00 2001 From: Aaron Erickson Date: Wed, 8 Jul 2026 08:40:06 -0700 Subject: [PATCH 1/2] fix(inference): retire unavailable Kimi K2.6 endpoint Signed-off-by: Aaron Erickson --- .github/workflows/e2e.yaml | 4 +--- docs/inference/inference-options.mdx | 6 ++--- docs/inference/model-capability-audit.mdx | 2 +- src/lib/inference/config.test.ts | 10 ++++---- src/lib/inference/config.ts | 1 - src/lib/inference/model-prompts.test.ts | 2 +- .../inference/nvidia-featured-models.test.ts | 23 ++++++++++++------- src/lib/inference/nvidia-featured-models.ts | 18 +++++++++------ test/e2e/live/kimi-inference-compat.test.ts | 5 +++- test/inference-options-docs.test.ts | 13 +++++++---- test/onboard-selection.test.ts | 12 +++++----- 11 files changed, 57 insertions(+), 39 deletions(-) diff --git a/.github/workflows/e2e.yaml b/.github/workflows/e2e.yaml index 3b179192075..c9735f19b2a 100644 --- a/.github/workflows/e2e.yaml +++ b/.github/workflows/e2e.yaml @@ -1144,7 +1144,7 @@ jobs: NEMOCLAW_NON_INTERACTIVE: "1" NEMOCLAW_ACCEPT_THIRD_PARTY_SOFTWARE: "1" NEMOCLAW_SANDBOX_NAME: "e2e-kimi-compat" - NEMOCLAW_E2E_INFERENCE_MODE: "public-nvidia" + NEMOCLAW_E2E_INFERENCE_MODE: "mock" OPENSHELL_GATEWAY: "nemoclaw" steps: - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 @@ -1157,8 +1157,6 @@ jobs: - name: Install OpenShell CLI run: bash scripts/install-openshell.sh - name: Run Kimi compatibility live Vitest test - env: - NVIDIA_API_KEY: ${{ secrets.NVIDIA_API_KEY }} run: | set -euo pipefail export PATH="$HOME/.local/bin:$HOME/.npm-global/bin:$PATH" diff --git a/docs/inference/inference-options.mdx b/docs/inference/inference-options.mdx index 50e6aef2d88..cdf5300d8e0 100644 --- a/docs/inference/inference-options.mdx +++ b/docs/inference/inference-options.mdx @@ -81,7 +81,7 @@ NemoClaw neither displays nor accepts an unsafe `NEMOCLAW_MODEL` value as the ma | Option | Description | Curated models | |--------|-------------|----------------| -| NVIDIA Endpoints | Routes to models hosted on [build.nvidia.com](https://build.nvidia.com). You can also enter any model ID from the catalog. Set `NVIDIA_INFERENCE_API_KEY`. | Nemotron 3 Ultra 550B, Nemotron 3 Super 120B, Kimi K2.6, Minimax M3 | +| NVIDIA Endpoints | Routes to models hosted on [build.nvidia.com](https://build.nvidia.com). You can also enter any model ID from the catalog. Set `NVIDIA_INFERENCE_API_KEY`. | Nemotron 3 Ultra 550B, Nemotron 3 Super 120B, Minimax M3 | | OpenAI | Routes to the OpenAI API. Set `OPENAI_API_KEY`. | `gpt-5.4`, `gpt-5.4-mini`, `gpt-5.4-nano`, `gpt-5.4-pro-2026-03-05` | | Other OpenAI-compatible endpoint | Routes to any server that implements `/v1/chat/completions`. NemoClaw uses `/v1/chat/completions` at runtime by default; set `NEMOCLAW_PREFERRED_API=openai-responses` to allow `/v1/responses` for proxies that implement it, such as some llama.cpp builds. The wizard prompts for a base URL and model name. The adapter is validated against OpenRouter (refer to the status table above); behavior on other OpenAI-compatible proxies, gateways, and self-hosted implementations such as LocalAI or llama.cpp may vary. When you enable Telegram messaging, onboarding also runs a bounded sandbox-side smoke check through `https://inference.local/v1/chat/completions`. Set `COMPATIBLE_API_KEY`. | You provide the model name. | | Anthropic | Routes to the Anthropic Messages API. Set `ANTHROPIC_API_KEY`. | `claude-sonnet-4-6`, `claude-haiku-4-5`, `claude-opus-4-6` | @@ -110,7 +110,8 @@ Use [Switch Inference Providers](switch-inference-providers) to move an existing ## Model Task-Fit Guide Use this table as starter guidance when selecting a curated cloud model during onboarding. -The provider catalog remains authoritative for exact context-window limits, availability, and current pricing. +The provider catalog remains authoritative for exact context-window limits and current pricing. +Successful runtime route validation determines current availability because catalog entries can outlive their backing endpoints. For NVIDIA Endpoints, the table covers the bundled fallback choices. The live featured model catalog can include additional models. The relative labels below are qualitative and compare models within the curated onboarding choices, not across every model a provider offers. @@ -119,7 +120,6 @@ The relative labels below are qualitative and compare models within the curated |---|---|---|---|---|---| | `nvidia/nemotron-3-ultra-550b-a55b` | Quality-sensitive reasoning, careful synthesis, and complex reviews | Higher | Strong for complex tool plans | Large agent context | Higher | | `nvidia/nemotron-3-super-120b-a12b` | Default hosted agent work, multi-step planning, and tool-heavy shell workflows | Medium | Strong default for OpenClaw tool loops | Large agent context | Medium | -| `moonshotai/kimi-k2.6` | Coding tasks and shell-heavy agent trajectories | Medium | Strong with NemoClaw's Kimi tool-call compatibility path | Large-context friendly | Medium | | `minimaxai/minimax-m3` | Long-form writing, multi-turn assistant work, and broad instruction following | Medium | Good for structured assistant turns | Large agent context | Medium | | `gpt-5.4` | Default OpenAI-backed agent work and general high-quality reasoning | Medium | Strong | Large agent context | Medium-to-high | | `gpt-5.4-mini` | Latency-sensitive routine automation and repeated helper calls | Low | Good | Medium-to-large context | Low | diff --git a/docs/inference/model-capability-audit.mdx b/docs/inference/model-capability-audit.mdx index 70e3347db80..66fcb44d2ae 100644 --- a/docs/inference/model-capability-audit.mdx +++ b/docs/inference/model-capability-audit.mdx @@ -81,7 +81,7 @@ When importing a completed row from an issue comment, preserve the exact commit | Agent surface | Provider class | Model or route | API path | State | Evidence | Required affordance | Follow-up | Source | |---|---|---|---|---|---|---|---|---| | OpenClaw primary agent | NVIDIA Endpoints | `nvidia/nemotron-3-super-120b-a12b` | Managed `inference.local` OpenAI-compatible completions | `not-yet-run` | Add trajectory and session evidence before changing state. | Existing setup keeps Tool Search disabled and preserves direct structured tool calls, overriding the generated `tools.toolSearch.mode: tools` default for this route. | Verify `tool_search`, `tool_describe`, `tool_call`, and final execution before replacing the safeguard. | `scripts/generate-openclaw-config.mts`, `nemoclaw-blueprint/model-specific-setup/openclaw/nemotron-3-super-120b-managed-inference.json`. | -| OpenClaw primary agent | NVIDIA Endpoints | `moonshotai/kimi-k2.6` | Managed `inference.local` OpenAI-compatible completions | `not-yet-run` | Add trajectory and session evidence before changing state. | Existing OpenClaw setup manifest applies Kimi compatibility and plugin loading. | Verify Kimi regression evidence before changing state. | `src/lib/inference/config.ts`, `nemoclaw-blueprint/model-specific-setup/openclaw/kimi-k2.6-managed-inference.json`. | +| OpenClaw existing configuration | NVIDIA Endpoints (retired route) | `moonshotai/kimi-k2.6` | Managed `inference.local` OpenAI-compatible completions | `unsupported` | NVIDIA's catalogs still advertised K2.6 while the [live Kimi compatibility job](https://github.com/NVIDIA/NemoClaw/actions/runs/28953873907/job/85907646487) failed route validation with HTTP 404. | The OpenClaw setup manifest remains for existing or custom compatible routes that still serve K2.6. | Select a supported NVIDIA Endpoints model; do not promote K2.7 until its production model ID and chat route are live. | `nemoclaw-blueprint/model-specific-setup/openclaw/kimi-k2.6-managed-inference.json`. | | OpenClaw primary agent | NVIDIA Endpoints | Any model from `CLOUD_MODEL_OPTIONS` | Managed `inference.local` OpenAI-compatible completions unless config selects another API. | `not-yet-run` | Add one evidence row per model before changing state. | Record `none`, model-specific setup, or provider-class transport behavior. | Expand into per-model rows as evidence lands. | `src/lib/inference/config.ts`. | | OpenClaw primary agent | OpenAI | Any model from `REMOTE_MODEL_OPTIONS.openai` | `openai` provider through `https://inference.local/v1`. | `not-yet-run` | Add one evidence row per model before changing state. | Record Responses or Chat Completions behavior explicitly. | Expand into per-model rows as evidence lands. | `src/lib/inference/model-prompts.ts`, `src/lib/inference/config.ts`. | | OpenClaw primary agent | Anthropic | Any model from `REMOTE_MODEL_OPTIONS.anthropic` | `anthropic` provider through `https://inference.local` with `anthropic-messages`. | `not-yet-run` | Add one evidence row per model before changing state. | Record native Anthropic Messages behavior explicitly. | Expand into per-model rows as evidence lands. | `src/lib/inference/model-prompts.ts`, `src/lib/inference/config.ts`. | diff --git a/src/lib/inference/config.test.ts b/src/lib/inference/config.test.ts index 66cae153001..e5e0c950c2b 100644 --- a/src/lib/inference/config.test.ts +++ b/src/lib/inference/config.test.ts @@ -98,7 +98,6 @@ describe("inference selection config", () => { expect(CLOUD_MODEL_OPTIONS).toEqual([ { id: "nvidia/nemotron-3-ultra-550b-a55b", label: "Nemotron 3 Ultra 550B" }, { id: "nvidia/nemotron-3-super-120b-a12b", label: "Nemotron 3 Super 120B" }, - { id: "moonshotai/kimi-k2.6", label: "Kimi K2.6" }, { id: "minimaxai/minimax-m3", label: "Minimax M3" }, ]); expect(CLOUD_MODEL_OPTIONS.map((option: { id: string }) => option.id)).not.toContain( @@ -136,9 +135,12 @@ describe("inference selection config", () => { expect(HERMES_PROVIDER_MODEL_OPTIONS.length).toBeGreaterThan(10); }); - it("retires GLM 5.1 only from the NVIDIA Endpoints picker", () => { - expect(CLOUD_MODEL_OPTIONS.map((option) => option.id)).not.toContain("z-ai/glm-5.1"); - expect(HERMES_PROVIDER_MODEL_OPTIONS).toContain("z-ai/glm-5.1"); + it.each([ + "z-ai/glm-5.1", + "moonshotai/kimi-k2.6", + ])("retires %s only from the NVIDIA Endpoints picker", (model) => { + expect(CLOUD_MODEL_OPTIONS.map((option) => option.id)).not.toContain(model); + expect(HERMES_PROVIDER_MODEL_OPTIONS).toContain(model); }); it("maps ollama-local to the sandbox inference route and default model", () => { diff --git a/src/lib/inference/config.ts b/src/lib/inference/config.ts index caf89f38935..dc4cb93d4dd 100644 --- a/src/lib/inference/config.ts +++ b/src/lib/inference/config.ts @@ -55,7 +55,6 @@ export const DEFAULT_HERMES_PROVIDER_MODEL = HERMES_PROVIDER_MODEL_OPTIONS[0]; export const CLOUD_MODEL_OPTIONS = [ { id: "nvidia/nemotron-3-ultra-550b-a55b", label: "Nemotron 3 Ultra 550B" }, { id: "nvidia/nemotron-3-super-120b-a12b", label: "Nemotron 3 Super 120B" }, - { id: "moonshotai/kimi-k2.6", label: "Kimi K2.6" }, { id: "minimaxai/minimax-m3", label: "Minimax M3" }, ]; export const DEFAULT_ROUTE_PROFILE = "inference-local"; diff --git a/src/lib/inference/model-prompts.test.ts b/src/lib/inference/model-prompts.test.ts index f3f4165f115..2684b65d392 100644 --- a/src/lib/inference/model-prompts.test.ts +++ b/src/lib/inference/model-prompts.test.ts @@ -34,7 +34,7 @@ describe("model prompt helpers", () => { }); it("returns Minimax M3 from the default cloud model menu", async () => { - const promptFn = promptSequence(["4"]); + const promptFn = promptSequence(["3"]); const result = await promptCloudModel({ promptFn, writeLine: vi.fn(), diff --git a/src/lib/inference/nvidia-featured-models.test.ts b/src/lib/inference/nvidia-featured-models.test.ts index cf21db5fd75..e3e9e683c3b 100644 --- a/src/lib/inference/nvidia-featured-models.test.ts +++ b/src/lib/inference/nvidia-featured-models.test.ts @@ -41,17 +41,21 @@ describe("NVIDIA featured model catalog", () => { ).toEqual([{ id: "minimaxai/minimax-m3", label: "Minimax M3" }]); }); - it("filters GLM 5.1 while it is retired from NVIDIA Endpoints (#6069)", () => { + it("filters models whose catalogs outlive their NVIDIA Endpoints routes", () => { expect( parseNvidiaFeaturedModels( JSON.stringify({ "featured-models": [ { model: "z-ai/glm-5.1", "model-name": "GLM 5.1" }, { model: "moonshotai/kimi-k2.6", "model-name": "Kimi K2.6" }, + { + model: "nvidia/nemotron-3-super-120b-a12b", + "model-name": "Nemotron 3 Super 120B", + }, ], }), ), - ).toEqual([{ id: "moonshotai/kimi-k2.6", label: "Kimi K2.6" }]); + ).toEqual([{ id: "nvidia/nemotron-3-super-120b-a12b", label: "Nemotron 3 Super 120B" }]); }); it("sanitizes untrusted catalog labels and bounds the rendered menu", () => { @@ -91,7 +95,7 @@ describe("NVIDIA featured model catalog", () => { httpStatus: 200, curlStatus: 0, body: JSON.stringify({ - "featured-models": [{ model: "moonshotai/kimi-k2.6", "model-name": "Kimi K2.6" }], + "featured-models": [{ model: "minimaxai/minimax-m3", "model-name": "Minimax M3" }], }), stderr: "", message: "", @@ -101,7 +105,7 @@ describe("NVIDIA featured model catalog", () => { expect(result).toEqual({ ok: true, - models: [{ id: "moonshotai/kimi-k2.6", label: "Kimi K2.6" }], + models: [{ id: "minimaxai/minimax-m3", label: "Minimax M3" }], }); }); @@ -122,7 +126,6 @@ describe("NVIDIA featured model catalog", () => { expect(models.map((model) => model.id)).toEqual([ "nvidia/nemotron-3-ultra-550b-a55b", "nvidia/nemotron-3-super-120b-a12b", - "moonshotai/kimi-k2.6", "minimaxai/minimax-m3", ]); expect(warnings).toEqual([ @@ -183,6 +186,7 @@ describe("NVIDIA featured model catalog", () => { "featured-models": [ { model: "unsafe model id", "model-name": "Unsafe" }, { model: "z-ai/glm-5.1", "model-name": "Retired" }, + { model: "moonshotai/kimi-k2.6", "model-name": "Also retired" }, ], }), stderr: "", @@ -257,6 +261,9 @@ describe("NVIDIA featured model catalog", () => { }); expect(options.defaultModelId).toBe("nvidia/nemotron-3-super-120b-a12b"); + expect(options.cloudModelOptions.map((option) => option.id)).not.toContain( + "moonshotai/kimi-k2.6", + ); }); it("reuses one featured catalog lookup but recomputes defaults across onboarding retries", () => { @@ -283,11 +290,11 @@ describe("NVIDIA featured model catalog", () => { }, }); - const kimiDefault = loadOptions("moonshotai/kimi-k2.6"); + const retiredDefault = loadOptions("moonshotai/kimi-k2.6"); const ultraDefault = loadOptions("nvidia/nemotron-3-ultra-550b-a55b"); - expect(kimiDefault.defaultModelId).toBe("moonshotai/kimi-k2.6"); + expect(retiredDefault.defaultModelId).toBe("nvidia/nemotron-3-ultra-550b-a55b"); expect(ultraDefault.defaultModelId).toBe("nvidia/nemotron-3-ultra-550b-a55b"); - expect(kimiDefault.cloudModelOptions).toBe(ultraDefault.cloudModelOptions); + expect(retiredDefault.cloudModelOptions).toBe(ultraDefault.cloudModelOptions); expect(probeCount).toBe(1); }); }); diff --git a/src/lib/inference/nvidia-featured-models.ts b/src/lib/inference/nvidia-featured-models.ts index be1c185b3bc..bbbfe424c99 100644 --- a/src/lib/inference/nvidia-featured-models.ts +++ b/src/lib/inference/nvidia-featured-models.ts @@ -8,13 +8,17 @@ import { CLOUD_MODEL_OPTIONS, DEFAULT_CLOUD_MODEL } from "./config"; export const NVIDIA_FEATURED_MODELS_URL = "https://assets.ngc.nvidia.com/products/api-catalog/featured-models.json"; -// GLM 5.1 retirement contract (#6069): the external featured feed may lag an -// NVIDIA Endpoints retirement. The repository authority is CLOUD_MODEL_OPTIONS -// plus the provider-boundary assertion in test/inference-options-docs.test.ts, -// which retain GLM 5.1 only for Hermes. Keep this policy deny-list until a -// deliberate product change reverses #6069; a transient feed omission alone is -// not a removal signal. -const RETIRED_NVIDIA_FEATURED_MODEL_IDS = new Set(["z-ai/glm-5.1"]); +// NVIDIA Endpoints retirement contract: the public featured feed and +// authenticated /models catalog can lag a runtime retirement. The repository +// authority is CLOUD_MODEL_OPTIONS plus the provider-boundary assertion in +// test/inference-options-docs.test.ts, which keeps independently available +// Hermes Provider models separate from NVIDIA Endpoints choices. Keep entries +// in this policy deny-list until a deliberate product change confirms that the +// NVIDIA chat-completions route is available again or names a live successor. +const RETIRED_NVIDIA_FEATURED_MODEL_IDS = new Set([ + "z-ai/glm-5.1", // Retired from NVIDIA Endpoints in #6069. + "moonshotai/kimi-k2.6", // Catalogs still list it after its backing route was removed. +]); const MAX_NVIDIA_FEATURED_CATALOG_BYTES = 1024 * 1024; const MAX_NVIDIA_FEATURED_MODELS = 100; const MAX_NVIDIA_FEATURED_MODEL_ID_LENGTH = 256; diff --git a/test/e2e/live/kimi-inference-compat.test.ts b/test/e2e/live/kimi-inference-compat.test.ts index 8e8b5f4717b..6fc58037335 100644 --- a/test/e2e/live/kimi-inference-compat.test.ts +++ b/test/e2e/live/kimi-inference-compat.test.ts @@ -41,7 +41,10 @@ test("Kimi-compatible endpoint config enables plugin wiring and managed inferenc await artifacts.target.declare({ id: "kimi-inference-compat", boundary: kimiBoundary(mode), - inferenceClassification: "public-nvidia required with mock/hermetic fallback", + inferenceClassification: + mode === "public-nvidia" + ? "public NVIDIA endpoint validation" + : "hermetic Kimi compatibility validation", inferenceMode: mode, sandboxName: SANDBOX_NAME, model: KIMI_MODEL, diff --git a/test/inference-options-docs.test.ts b/test/inference-options-docs.test.ts index ad85f448972..be7711f8ac9 100644 --- a/test/inference-options-docs.test.ts +++ b/test/inference-options-docs.test.ts @@ -117,7 +117,9 @@ describe("inference options model task-fit docs (#4755)", () => { expect(section).toContain( "| Model | Best-for task type | Relative latency | Tool-use quality | Context-window fit | Relative cost |", ); - expect(section).toContain("provider catalog remains authoritative"); + expect(section).toContain( + "Successful runtime route validation determines current availability", + ); expect(section).not.toMatch(/\bTBD\b|\bTODO\b/i); expect(section).not.toContain("Very large context"); @@ -128,7 +130,10 @@ describe("inference options model task-fit docs (#4755)", () => { expect(documentedModelIds).toEqual(readCuratedOnboardingModelIds()); }); - it("keeps GLM 5.1 scoped to the independent Hermes Provider catalog", () => { + it.each([ + ["GLM 5.1", /GLM-?5\.1|z-ai\/glm-5\.1/i, "`z-ai/glm-5.1`"], + ["Kimi K2.6", /Kimi K2\.6|moonshotai\/kimi-k2\.6/i, "`moonshotai/kimi-k2.6`"], + ])("keeps %s scoped to the independent Hermes Provider catalog", (_label, matcher, id) => { const markdown = fs.readFileSync(inferenceOptionsPath, "utf8"); const start = markdown.indexOf("## Provider Options"); const end = markdown.indexOf("## Model Task-Fit Guide", start); @@ -140,7 +145,7 @@ describe("inference options model task-fit docs (#4755)", () => { const hermesRow = lines.find((line) => line.startsWith("| Hermes Provider |")); expect(nvidiaRow).toBeDefined(); - expect(nvidiaRow).not.toMatch(/GLM-?5\.1|z-ai\/glm-5\.1/i); - expect(hermesRow).toContain("`z-ai/glm-5.1`"); + expect(nvidiaRow).not.toMatch(matcher as RegExp); + expect(hermesRow).toContain(id); }); }); diff --git a/test/onboard-selection.test.ts b/test/onboard-selection.test.ts index 34f55b451ff..7318ec2e99f 100644 --- a/test/onboard-selection.test.ts +++ b/test/onboard-selection.test.ts @@ -1012,7 +1012,7 @@ describe("onboard provider selection UX", { timeout: PROVIDER_SELECTION_TEST_TIM assert.doesNotMatch(buildOption?.label || "", /recommended/i); }); - it("selects Kimi K2.6 from the filtered NVIDIA Endpoints featured model list (#6245)", async () => { + it("filters retired Kimi K2.6 from the NVIDIA Endpoints featured model list", async () => { const answers = ["3"]; const messages: string[] = []; const lines: string[] = []; @@ -1061,24 +1061,24 @@ describe("onboard provider selection UX", { timeout: PROVIDER_SELECTION_TEST_TIM }), ); - assert.equal(model, "moonshotai/kimi-k2.6"); + assert.equal(model, "minimaxai/minimax-m3"); assert.equal(validated.result, "selected"); assert.equal(state.provider, "nvidia-prod"); assert.equal(state.preferredInferenceApi, "openai-completions"); assert.match(messages[0], /Choose model \[2\]/); - assert.ok(lines.some((line) => line.includes("Kimi K2.6"))); + assert.ok(!lines.some((line) => line.includes("Kimi K2.6"))); assert.ok(!lines.some((line) => line.includes("GLM 5.1"))); assert.ok(validated.lines.some((line) => line.includes("Chat Completions API available"))); expect(probeOpenAiLikeEndpoint).toHaveBeenCalledWith( "https://integrate.api.nvidia.com/v1", - "moonshotai/kimi-k2.6", + "minimaxai/minimax-m3", "nvapi-test", expect.any(Object), ); }); it("accepts a manually entered NVIDIA Endpoints model after validating it against /models (#6245)", async () => { - const answers = ["5", "custom/provider-model"]; + const answers = ["4", "custom/provider-model"]; const messages: string[] = []; const lines: string[] = []; const validateNvidiaEndpointModelFn = vi.fn((model: string) => ({ @@ -1136,7 +1136,7 @@ describe("onboard provider selection UX", { timeout: PROVIDER_SELECTION_TEST_TIM }); it("reprompts for a manual NVIDIA Endpoints model when /models validation rejects it (#6245)", async () => { - const answers = ["5", "bad/model", "custom/provider-model"]; + const answers = ["4", "bad/model", "custom/provider-model"]; const messages: string[] = []; const lines: string[] = []; const model = await promptCloudModel({ From 12833f44b442984a48c8456446452c0e9a2cdd27 Mon Sep 17 00:00:00 2001 From: Aaron Erickson Date: Wed, 8 Jul 2026 09:15:25 -0700 Subject: [PATCH 2/2] fix(ci): repair Kimi retirement coverage Signed-off-by: Aaron Erickson --- ci/platform-matrix.json | 2 +- docs/inference/inference-options.mdx | 2 +- docs/reference/platform-support.mdx | 2 +- .../e2e/live/kimi-inference-compat-helpers.ts | 19 ++++++--- .../kimi-inference-compat-helpers.test.ts | 41 +++++++++++++++++++ 5 files changed, 57 insertions(+), 9 deletions(-) diff --git a/ci/platform-matrix.json b/ci/platform-matrix.json index 3978ff8721b..5f8a476ba59 100644 --- a/ci/platform-matrix.json +++ b/ci/platform-matrix.json @@ -93,7 +93,7 @@ "name": "Other OpenAI-compatible endpoint", "status": "caveated", "endpoint_type": "Custom OpenAI-compatible", - "notes": "Adapter path validated against OpenRouter as the `compatible-endpoint` provider with `openrouter/auto` (see `src/lib/inference/config.test.ts:120`); the onboarding prompt that surfaces OpenRouter as the worked example is in `handleRemoteProviderSelection` in `src/lib/onboard.ts`. Behavior on other OpenAI-compatible proxies, gateways, and self-hosted implementations may vary; this row claims the adapter, not the universe of compatible endpoints." + "notes": "Adapter path validated against OpenRouter as the `compatible-endpoint` provider with `openrouter/auto` (see `src/lib/inference/config.test.ts:208`); the onboarding prompt that surfaces OpenRouter as the worked example is in `handleRemoteProviderSelection` in `src/lib/onboard.ts`. Behavior on other OpenAI-compatible proxies, gateways, and self-hosted implementations may vary; this row claims the adapter, not the universe of compatible endpoints." }, { "name": "Anthropic", diff --git a/docs/inference/inference-options.mdx b/docs/inference/inference-options.mdx index cdf5300d8e0..341e57cd29d 100644 --- a/docs/inference/inference-options.mdx +++ b/docs/inference/inference-options.mdx @@ -51,7 +51,7 @@ The managed `dcode` runtime uses Chat Completions through OpenShell even when a |----------|--------|---------------|-------| | NVIDIA Endpoints | Tested | OpenAI-compatible | Hosted models on integrate.api.nvidia.com | | OpenAI | Tested | Native OpenAI-compatible | Uses OpenAI model IDs | -| Other OpenAI-compatible endpoint | Tested with limitations | Custom OpenAI-compatible | Adapter path validated against OpenRouter as the `compatible-endpoint` provider with `openrouter/auto` (see `src/lib/inference/config.test.ts:120`); the onboarding prompt that surfaces OpenRouter as the worked example is in `handleRemoteProviderSelection` in `src/lib/onboard.ts`. Behavior on other OpenAI-compatible proxies, gateways, and self-hosted implementations may vary; this row claims the adapter, not the universe of compatible endpoints. | +| Other OpenAI-compatible endpoint | Tested with limitations | Custom OpenAI-compatible | Adapter path validated against OpenRouter as the `compatible-endpoint` provider with `openrouter/auto` (see `src/lib/inference/config.test.ts:208`); the onboarding prompt that surfaces OpenRouter as the worked example is in `handleRemoteProviderSelection` in `src/lib/onboard.ts`. Behavior on other OpenAI-compatible proxies, gateways, and self-hosted implementations may vary; this row claims the adapter, not the universe of compatible endpoints. | | Anthropic | Tested | Native Anthropic | Uses anthropic-messages | | Other Anthropic-compatible endpoint | Tested with limitations | Custom Anthropic-compatible | Adapter path validated with AWS Bedrock (`src/lib/onboard/bedrock-runtime.ts`). Behavior on other Anthropic-compatible proxies and gateways may vary; this row claims the adapter, not the universe of compatible endpoints. | | Google Gemini | Tested | OpenAI-compatible | Uses Google's OpenAI-compatible endpoint | diff --git a/docs/reference/platform-support.mdx b/docs/reference/platform-support.mdx index 2a11281ffb6..33270549c3c 100644 --- a/docs/reference/platform-support.mdx +++ b/docs/reference/platform-support.mdx @@ -95,7 +95,7 @@ NemoClaw routes inference through the OpenShell gateway. Each row below is a pro |----------|--------|---------------|-------| | NVIDIA Endpoints | Tested | OpenAI-compatible | Hosted models on integrate.api.nvidia.com | | OpenAI | Tested | Native OpenAI-compatible | Uses OpenAI model IDs | -| Other OpenAI-compatible endpoint | Tested with limitations | Custom OpenAI-compatible | Adapter path validated against OpenRouter as the `compatible-endpoint` provider with `openrouter/auto` (see `src/lib/inference/config.test.ts:120`); the onboarding prompt that surfaces OpenRouter as the worked example is in `handleRemoteProviderSelection` in `src/lib/onboard.ts`. Behavior on other OpenAI-compatible proxies, gateways, and self-hosted implementations may vary; this row claims the adapter, not the universe of compatible endpoints. | +| Other OpenAI-compatible endpoint | Tested with limitations | Custom OpenAI-compatible | Adapter path validated against OpenRouter as the `compatible-endpoint` provider with `openrouter/auto` (see `src/lib/inference/config.test.ts:208`); the onboarding prompt that surfaces OpenRouter as the worked example is in `handleRemoteProviderSelection` in `src/lib/onboard.ts`. Behavior on other OpenAI-compatible proxies, gateways, and self-hosted implementations may vary; this row claims the adapter, not the universe of compatible endpoints. | | Anthropic | Tested | Native Anthropic | Uses anthropic-messages | | Other Anthropic-compatible endpoint | Tested with limitations | Custom Anthropic-compatible | Adapter path validated with AWS Bedrock (`src/lib/onboard/bedrock-runtime.ts`). Behavior on other Anthropic-compatible proxies and gateways may vary; this row claims the adapter, not the universe of compatible endpoints. | | Google Gemini | Tested | OpenAI-compatible | Uses Google's OpenAI-compatible endpoint | diff --git a/test/e2e/live/kimi-inference-compat-helpers.ts b/test/e2e/live/kimi-inference-compat-helpers.ts index 9905b61ca87..448b7a4ed10 100644 --- a/test/e2e/live/kimi-inference-compat-helpers.ts +++ b/test/e2e/live/kimi-inference-compat-helpers.ts @@ -300,11 +300,11 @@ function completion(id: string, content: string): unknown { } function sendToolCall(res: http.ServerResponse, id: string, stream: boolean): void { - const toolCall = { - id: "call_kimi_exec", + const toolCalls = ["hostname", "date", "uptime"].map((command) => ({ + id: `call_kimi_exec_${command}`, type: "function", - function: { name: "exec", arguments: JSON.stringify({ command: "hostname; date; uptime" }) }, - }; + function: { name: "exec", arguments: JSON.stringify({ command }) }, + })); if (stream) { sendSse(res, [ { @@ -317,7 +317,14 @@ function sendToolCall(res: http.ServerResponse, id: string, stream: boolean): vo id, object: "chat.completion.chunk", model: KIMI_MODEL, - choices: [{ index: 0, delta: { tool_calls: [{ index: 0, ...toolCall }] } }], + choices: [ + { + index: 0, + delta: { + tool_calls: toolCalls.map((toolCall, index) => ({ index, ...toolCall })), + }, + }, + ], }, { id, @@ -335,7 +342,7 @@ function sendToolCall(res: http.ServerResponse, id: string, stream: boolean): vo choices: [ { index: 0, - message: { role: "assistant", content: null, tool_calls: [toolCall] }, + message: { role: "assistant", content: null, tool_calls: toolCalls }, finish_reason: "tool_calls", }, ], diff --git a/test/e2e/support/kimi-inference-compat-helpers.test.ts b/test/e2e/support/kimi-inference-compat-helpers.test.ts index bd44a380ebd..687217ab48e 100644 --- a/test/e2e/support/kimi-inference-compat-helpers.test.ts +++ b/test/e2e/support/kimi-inference-compat-helpers.test.ts @@ -11,6 +11,7 @@ import { kimiOnboardEnv, requirePublicNvidiaApiKey, resolveKimiInferenceMode, + startKimiMock, } from "../live/kimi-inference-compat-helpers.ts"; describe("Kimi inference compatibility mode selection", () => { @@ -97,6 +98,46 @@ describe("Kimi inference compatibility mode selection", () => { }); }); + it("emits separate safe exec calls from the streaming Kimi mock", async () => { + const mock = await startKimiMock(); + try { + const endpoint = new URL(`${mock.baseUrl}/chat/completions`); + endpoint.hostname = "127.0.0.1"; + const response = await fetch(endpoint, { + method: "POST", + headers: { + authorization: "Bearer test-kimi-key", + "content-type": "application/json", + }, + body: JSON.stringify({ + model: "moonshotai/kimi-k2.6", + stream: true, + messages: [{ role: "user", content: "Run the checks" }], + tools: [{ type: "function", function: { name: "exec" } }], + }), + }); + + expect(response.ok).toBe(true); + const events = (await response.text()) + .split("\n") + .filter((line) => line.startsWith("data: {")) + .map((line) => JSON.parse(line.slice("data: ".length))); + const toolCalls = events.flatMap((event) => event.choices?.[0]?.delta?.tool_calls ?? []); + expect(toolCalls.map((toolCall) => toolCall.index)).toEqual([0, 1, 2]); + expect(toolCalls.every((toolCall) => toolCall.type === "function")).toBe(true); + expect(toolCalls.every((toolCall) => toolCall.function.name === "exec")).toBe(true); + expect(toolCalls.map((toolCall) => JSON.parse(toolCall.function.arguments).command)).toEqual([ + "hostname", + "date", + "uptime", + ]); + expect(new Set(toolCalls.map((toolCall) => toolCall.id)).size).toBe(3); + expect(events.at(-1)?.choices?.[0]?.finish_reason).toBe("tool_calls"); + } finally { + await mock.close(); + } + }); + it("allows public Kimi trajectories with fewer safe exec calls but no combined shell", () => { const script = buildKimiTrajectoryCheckScript(false); expect(script).toContain("strict_mock = False");