From b4a636cf1e794ae92ceb06ea68135d5c39c93066 Mon Sep 17 00:00:00 2001 From: diegosouzapw <8016841+diegosouzapw@users.noreply.github.com> Date: Tue, 25 Aug 2026 08:06:25 +0000 Subject: [PATCH] test(providers): use a non-reserved prefix in the CC-compatible node create cases MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 93da24cd7 ("fix(providers): reject reserved provider prefixes on compatible-node create/update") made createProviderNodeSchema reject any prefix that is a built-in REGISTRY id or alias. "cc" is the alias of the built-in `claude` provider, so the two provider-nodes create cases in cc-compatible-provider.test.ts started getting a 400 schema rejection before the route ever reached its feature-flag gate (403) or the create path (201) — the guard PR updated its own tests but missed this sibling file, leaving a base-red on release/v3.8.50. The operator-chosen prefix is incidental to what these cases assert (the ENABLE_CC_COMPATIBLE_PROVIDER gate, the dedicated anthropic-compatible-cc- id prefix, baseUrl sanitization and the nulled modelsPath), so switch it to a non-reserved "cc-proxy". No assertion was removed or loosened. --- tests/unit/cc-compatible-provider.test.ts | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/tests/unit/cc-compatible-provider.test.ts b/tests/unit/cc-compatible-provider.test.ts index def57d8c39..751e21e9f9 100644 --- a/tests/unit/cc-compatible-provider.test.ts +++ b/tests/unit/cc-compatible-provider.test.ts @@ -808,7 +808,12 @@ test("provider-nodes create route rejects CC mode when feature flag is disabled" headers: { "Content-Type": "application/json" }, body: JSON.stringify({ name: "Hidden CC", - prefix: "cc", + // #93da24cd7 reserved-prefix guard: "cc" is the built-in `claude` + // registry alias, so a compatible node created with it would never be + // reachable at runtime and is now rejected (400) at the write path. + // These cases are about the CC feature flag / dedicated id prefix, not + // about the operator-chosen prefix, so use a non-reserved one. + prefix: "cc-proxy", baseUrl: "https://proxy.example.com/v1", type: "anthropic-compatible", compatMode: "cc", @@ -828,7 +833,12 @@ test("provider-nodes create route creates CC node with dedicated prefix when ena headers: { "Content-Type": "application/json" }, body: JSON.stringify({ name: "Hidden CC", - prefix: "cc", + // #93da24cd7 reserved-prefix guard: "cc" is the built-in `claude` + // registry alias, so a compatible node created with it would never be + // reachable at runtime and is now rejected (400) at the write path. + // These cases are about the CC feature flag / dedicated id prefix, not + // about the operator-chosen prefix, so use a non-reserved one. + prefix: "cc-proxy", baseUrl: "https://proxy.example.com/v1/messages?beta=true", type: "anthropic-compatible", compatMode: "cc",