@@ -14,10 +14,10 @@ import {
1414 loadConfigSync ,
1515 saveConfig ,
1616 chat ,
17- type LLMConfig ,
1817 type ChatMessage ,
1918 type ToolDef ,
2019} from '../llmClient' ;
20+ import type { LLMConfig } from '../llmModels' ;
2121
2222// ─── Constants ────────────────────────────────────────────────────────────────
2323
@@ -98,37 +98,50 @@ describe('getDefaultConfig()', () => {
9898 it ( 'returns correct defaults for openai' , ( ) => {
9999 const cfg = getDefaultConfig ( 'openai' ) ;
100100 expect ( cfg . provider ) . toBe ( 'openai' ) ;
101- expect ( cfg . baseUrl ) . toBe ( 'https://api.openai.com' ) ;
102- expect ( cfg . model ) . toBe ( 'gpt-5.3-chat-latest ' ) ;
101+ expect ( cfg . baseUrl ) . toBe ( 'https://api.openai.com/v1 ' ) ;
102+ expect ( cfg . model ) . toBe ( 'gpt-5.4 ' ) ;
103103 expect ( 'apiKey' in cfg ) . toBe ( false ) ;
104104 } ) ;
105105
106106 it ( 'returns correct defaults for anthropic' , ( ) => {
107107 const cfg = getDefaultConfig ( 'anthropic' ) ;
108108 expect ( cfg . provider ) . toBe ( 'anthropic' ) ;
109- expect ( cfg . baseUrl ) . toBe ( 'https://api.anthropic.com' ) ;
110- expect ( cfg . model ) . toBe ( 'claude-opus -4-6' ) ;
109+ expect ( cfg . baseUrl ) . toBe ( 'https://api.anthropic.com/v1 ' ) ;
110+ expect ( cfg . model ) . toBe ( 'claude-sonnet -4-6' ) ;
111111 } ) ;
112112
113113 it ( 'returns correct defaults for deepseek' , ( ) => {
114114 const cfg = getDefaultConfig ( 'deepseek' ) ;
115115 expect ( cfg . provider ) . toBe ( 'deepseek' ) ;
116- expect ( cfg . baseUrl ) . toBe ( 'https://api.deepseek.com' ) ;
116+ expect ( cfg . baseUrl ) . toBe ( 'https://api.deepseek.com/v1 ' ) ;
117117 expect ( cfg . model ) . toBe ( 'deepseek-chat' ) ;
118118 } ) ;
119119
120120 it ( 'returns correct defaults for minimax' , ( ) => {
121121 const cfg = getDefaultConfig ( 'minimax' ) ;
122122 expect ( cfg . provider ) . toBe ( 'minimax' ) ;
123- expect ( cfg . baseUrl ) . toBe ( 'https://api.minimax.io/anthropic' ) ;
123+ expect ( cfg . baseUrl ) . toBe ( 'https://api.minimax.io/anthropic/v1 ' ) ;
124124 expect ( cfg . model ) . toBe ( 'MiniMax-M2.5' ) ;
125125 } ) ;
126126
127- it ( 'returns the same stable reference for the same provider' , ( ) => {
128- // getDefaultConfig returns a direct reference to the internal constant (by design)
127+ it ( 'returns correct defaults for z.ai' , ( ) => {
128+ const cfg = getDefaultConfig ( 'z.ai' ) ;
129+ expect ( cfg . provider ) . toBe ( 'z.ai' ) ;
130+ expect ( cfg . baseUrl ) . toBe ( 'https://api.z.ai/api/coding/paas/v4' ) ;
131+ expect ( cfg . model ) . toBe ( 'glm-5' ) ;
132+ } ) ;
133+
134+ it ( 'returns correct defaults for kimi' , ( ) => {
135+ const cfg = getDefaultConfig ( 'kimi' ) ;
136+ expect ( cfg . provider ) . toBe ( 'kimi' ) ;
137+ expect ( cfg . baseUrl ) . toBe ( 'https://api.moonshot.cn/v1' ) ;
138+ expect ( cfg . model ) . toBe ( 'kimi-k2-5' ) ;
139+ } ) ;
140+
141+ it ( 'returns consistent values for the same provider' , ( ) => {
129142 const a = getDefaultConfig ( 'openai' ) ;
130143 const b = getDefaultConfig ( 'openai' ) ;
131- expect ( a ) . toBe ( b ) ;
144+ expect ( a ) . toStrictEqual ( b ) ;
132145 } ) ;
133146} ) ;
134147
0 commit comments