Skip to content

armgit / cindy

Public Imported from GitHub
0

Consider it done. The open-source AI agent that works out of the box · 想到,就能做到。开源、开箱即用的 AI Agent。

fix(models): declare GLM Coding preset endpoints

Chrisa83ee1f1434a
diff --git a/packages/model-providers/catalog/model-registry.json b/packages/model-providers/catalog/model-registry.json
index 740cd806da..7520c546d6 100644
--- a/packages/model-providers/catalog/model-registry.json
+++ b/packages/model-providers/catalog/model-registry.json
@@ -1,6 +1,6 @@
{
"schemaVersion": 6,
- "updatedAt": "2026-10-23T19:45:53.486Z",
+ "updatedAt": "2026-10-24T02:52:43.075Z",
"models": [
{
"id": "openai/gpt-6.1-sol",
@@ -9249,6 +9249,19 @@
"pi"
]
},
+ {
+ "id": "zhipu-glm-cn-coding-openai-completions",
+ "providerId": "zhipu-glm-cn",
+ "api": "openai-completions",
+ "baseUrl": "https://open.bigmodel.cn/api/coding/paas/v4",
+ "inputBaseUrls": [
+ "https://open.bigmodel.cn/api/coding/paas/v4"
+ ],
+ "defaultFor": [
+ "codex",
+ "pi"
+ ]
+ },
{
"id": "zhipu-glm-global-anthropic-messages",
"providerId": "zhipu-glm-global",
@@ -9279,6 +9292,19 @@
"pi"
]
},
+ {
+ "id": "zhipu-glm-global-coding-openai-completions",
+ "providerId": "zhipu-glm-global",
+ "api": "openai-completions",
+ "baseUrl": "https://api.z.ai/api/coding/paas/v4",
+ "inputBaseUrls": [
+ "https://api.z.ai/api/coding/paas/v4"
+ ],
+ "defaultFor": [
+ "codex",
+ "pi"
+ ]
+ },
{
"id": "moonshot-kimi-cn-anthropic-messages",
"providerId": "moonshot-kimi-cn",
diff --git a/packages/model-providers/src/__tests__/providerInterfaceRoutes.test.ts b/packages/model-providers/src/__tests__/providerInterfaceRoutes.test.ts
index 49337980e0..a3e4971d72 100644
--- a/packages/model-providers/src/__tests__/providerInterfaceRoutes.test.ts
+++ b/packages/model-providers/src/__tests__/providerInterfaceRoutes.test.ts
@@ -4,6 +4,25 @@ import { alignModelApiRoute, providerInterfaceModelRoute } from '../providerInte
import { BUNDLED_CATALOG } from '../catalog.js';
describe('documented supplier interfaces', () => {
+ it.each([
+ ['zhipu-glm-cn', 'https://open.bigmodel.cn/api/coding/paas/v4'],
+ ['zhipu-glm-global', 'https://api.z.ai/api/coding/paas/v4'],
+ ])('declares the server %s Coding endpoint without redirecting public API connections', (presetId, codingBase) => {
+ const preset = BUNDLED_CATALOG.presets!.find(p => p.id === presetId)!;
+ for (const [baseUrl, profileId] of [
+ [codingBase, `${presetId}-coding-openai-completions`],
+ [codingBase.replace('/coding/', '/'), `${presetId}-openai-completions`],
+ ]) {
+ const provider = buildUserProvider({ id: 'glm', name: 'GLM', runtimes: { codex: {
+ ...preset.runtimes.codex!, baseUrl, catalogPresetId: presetId,
+ models: [{ id: 'glm-5.3-flash', name: 'GLM', contextWindow: 64000, defaultEnabled: false }],
+ } } }, { presets: BUNDLED_CATALOG.presets });
+ expect(provider.models.codex![0]).toMatchObject({
+ api: 'openai-completions', contextWindow: 64000, defaultEnabled: false,
+ selectedInterface: { profileId, route: { baseUrl, wireProtocol: 'openai-chat' } },
+ });
+ }
+ });
it('imports OpenCode Go DeepSeek 4.1 Flash capabilities for every engine', () => {
const preset = BUNDLED_CATALOG.presets!.find(p => p.id === 'opencode-go')!;
const provider = buildUserProvider({ id: 'go', name: 'Go', runtimes: