From 283c05d3d082b7c6b669709a006efa4d0170fe52 Mon Sep 17 00:00:00 2001 From: Diego Rodrigues de Sa e Souza <8016841+diegosouzapw@users.noreply.github.com> Date: Fri, 29 May 2026 00:59:54 -0300 Subject: [PATCH] fix(nous-research): correct baseUrl to include /chat/completions (#2826) (#2835) Integrated into release/v3.8.6. --- CHANGELOG.md | 1 + open-sse/config/providerRegistry.ts | 2 +- tests/unit/executor-nous-research.test.ts | 36 +++++++++++++++++++++++ 3 files changed, 38 insertions(+), 1 deletion(-) create mode 100644 tests/unit/executor-nous-research.test.ts diff --git a/CHANGELOG.md b/CHANGELOG.md index 40c9612d9b..3c365fdbb4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,7 @@ ### 🔧 Bug Fixes +- **nous-research:** append /chat/completions to provider baseUrl so DefaultExecutor's default URL builder hits the correct endpoint instead of returning 404 ([#2826]) - **fix(quota):** honor explicit per-connection `quotaPreflightEnabled: false` even when the provider has global window defaults — adds early-return guard before the AND-of-negations gate in auth.ts ([#2831]) - **api:** include noAuth providers (opencode, etc.) in `/v1/models` active aliases so their models surface without a DB connection row (#2798) - **opencode-go:** route Qwen3.x via Claude messages format and repair `fixMissingToolResponses` helper for Claude-shape upstreams (#2791 — thanks @jeferssonlemes) diff --git a/open-sse/config/providerRegistry.ts b/open-sse/config/providerRegistry.ts index 8841a21266..591a92829c 100644 --- a/open-sse/config/providerRegistry.ts +++ b/open-sse/config/providerRegistry.ts @@ -3955,7 +3955,7 @@ export const REGISTRY: Record = { alias: "nous", format: "openai", executor: "default", - baseUrl: "https://inference-api.nousresearch.com/v1", + baseUrl: "https://inference-api.nousresearch.com/v1/chat/completions", authType: "apikey", authHeader: "bearer", models: [ diff --git a/tests/unit/executor-nous-research.test.ts b/tests/unit/executor-nous-research.test.ts new file mode 100644 index 0000000000..a20e9735c0 --- /dev/null +++ b/tests/unit/executor-nous-research.test.ts @@ -0,0 +1,36 @@ +/** + * Regression test for #2826 — NOUS-RESEARCH provider always returns 404 Not Found + * + * `nous-research` uses `executor: "default"`. `DefaultExecutor.buildUrl()`'s default + * switch case returns `config.baseUrl` verbatim. Without `/chat/completions` appended + * every outbound request hits `/v1` and gets a 404. + * + * Fix: set `baseUrl` in providerRegistry.ts to include `/chat/completions`. + */ +import test from "node:test"; +import assert from "node:assert/strict"; + +import { DefaultExecutor } from "../../open-sse/executors/default.ts"; + +test("nous-research DefaultExecutor.buildUrl() returns a URL ending with /chat/completions", () => { + const executor = new DefaultExecutor("nous-research"); + + const url = executor.buildUrl("Hermes-4-405B", true, 0, null); + + assert.match( + url, + /\/chat\/completions$/, + `Expected URL to end with /chat/completions, got: ${url}` + ); +}); + +test("nous-research DefaultExecutor.buildUrl() targets the correct inference endpoint", () => { + const executor = new DefaultExecutor("nous-research"); + + const url = executor.buildUrl("Hermes-4-70B", false, 0, null); + + assert.equal( + url, + "https://inference-api.nousresearch.com/v1/chat/completions" + ); +});