From 28d104eaddd195a27e9c7d60b6a840215b700fb8 Mon Sep 17 00:00:00 2001 From: codingbo Date: Sat, 26 Sep 2026 09:41:13 +0800 Subject: [PATCH] fix(clients): include access.type in ZCode provider_config.json export (#5861) --- src/clients/config-export/zcode-store.ts | 4 ++-- tests/clients/integrations-current-store.test.ts | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/clients/config-export/zcode-store.ts b/src/clients/config-export/zcode-store.ts index 5ba585e0193..cf824b02e24 100644 --- a/src/clients/config-export/zcode-store.ts +++ b/src/clients/config-export/zcode-store.ts @@ -42,7 +42,7 @@ export interface ZcodeStoreProviderRule { providerName: string; config: { group: string; - access: { apiKey: string }; + access: { type: "api-key"; apiKey: string }; api: { type: string; baseUrl: string }; personalModelIds: string[]; modelOrder: string[]; @@ -113,7 +113,7 @@ export function buildZcodeStoreProviderRule(ctx: ExportContext): ZcodeStoreProvi providerName: ZCODE_STORE_PROVIDER_NAME, config: { group: ZCODE_STORE_PROVIDER_GROUP, - access: { apiKey: LOOPBACK_API_KEY_PLACEHOLDER }, + access: { type: "api-key", apiKey: LOOPBACK_API_KEY_PLACEHOLDER }, api: { type: ZCODE_STORE_API_TYPE, baseUrl: `${ctx.baseUrl.replace(/\/v1\/?$/, "")}/v1` }, personalModelIds: ids, /* diff --git a/tests/clients/integrations-current-store.test.ts b/tests/clients/integrations-current-store.test.ts index 089c8e1de93..8d862bde92d 100644 --- a/tests/clients/integrations-current-store.test.ts +++ b/tests/clients/integrations-current-store.test.ts @@ -8,6 +8,7 @@ import { ZCODE_STORE_PROVIDER_RULES_PATH, ZCODE_STORE_SCHEMA_VERSION, buildZcodeStoreProviderRule, + type ZcodeStoreProviderRule, type ExportModel, } from "../../src/clients/config-export"; import { formatSelectorConjunction } from "../../src/integrations/merge"; @@ -136,6 +137,8 @@ describe("writing the provider store the client reads", () => { // so the base URL is the one `ocx export` composes rather than a literal. expect(readPath(readStore(), OUR_PROVIDER_RULE)) .toEqual(buildZcodeStoreProviderRule(exportContextOf(input()))); + const writtenRule = readPath(readStore(), OUR_PROVIDER_RULE) as ZcodeStoreProviderRule; + expect(writtenRule.config.access.type).toBe("api-key"); expect(readPath(readStore(), ourModelRule("anthropic/claude-opus-4-8"))) .toMatchObject({ config: { properties: { contextWindow: 200_000 } } }); // And nothing was written to the file it stopped reading.