@@ -19,6 +19,7 @@ test("resolveSettings reads top-level thinkingEnabled, notify, and webSearchTool
1919 BASE_URL : "https://example.com/v1" ,
2020 API_KEY : "sk-test" ,
2121 } ,
22+ temperature : 0.3 ,
2223 thinkingEnabled : true ,
2324 reasoningEffort : "high" ,
2425 debugLogEnabled : true ,
@@ -35,6 +36,7 @@ test("resolveSettings reads top-level thinkingEnabled, notify, and webSearchTool
3536 assert . equal ( resolved . model , "deepseek-v3.2" ) ;
3637 assert . equal ( resolved . baseURL , "https://example.com/v1" ) ;
3738 assert . equal ( resolved . apiKey , "sk-test" ) ;
39+ assert . equal ( resolved . temperature , 0.3 ) ;
3840 assert . equal ( resolved . thinkingEnabled , true ) ;
3941 assert . equal ( resolved . reasoningEffort , "high" ) ;
4042 assert . equal ( resolved . debugLogEnabled , true ) ;
@@ -60,10 +62,11 @@ test("resolveSettings gives top-level model priority over env MODEL", () => {
6062 assert . equal ( resolved . model , "deepseek-v4-flash" ) ;
6163} ) ;
6264
63- test ( "resolveSettings reads THINKING_ENABLED, REASONING_EFFORT, and DEBUG_LOG_ENABLED from env" , ( ) => {
65+ test ( "resolveSettings reads TEMPERATURE, THINKING_ENABLED, REASONING_EFFORT, and DEBUG_LOG_ENABLED from env" , ( ) => {
6466 const resolved = resolveSettings (
6567 {
6668 env : {
69+ TEMPERATURE : "0.7" ,
6770 THINKING_ENABLED : "true" ,
6871 REASONING_EFFORT : "high" ,
6972 DEBUG_LOG_ENABLED : "true" ,
@@ -77,6 +80,7 @@ test("resolveSettings reads THINKING_ENABLED, REASONING_EFFORT, and DEBUG_LOG_EN
7780 ) ;
7881
7982 assert . equal ( resolved . thinkingEnabled , true ) ;
83+ assert . equal ( resolved . temperature , 0.7 ) ;
8084 assert . equal ( resolved . reasoningEffort , "high" ) ;
8185 assert . equal ( resolved . debugLogEnabled , true ) ;
8286 assert . equal ( resolved . model , "default-model" ) ;
@@ -138,12 +142,14 @@ test("resolveSettingsSources applies user, project, and DEEPCODE environment pre
138142 MODEL : "user-env-model" ,
139143 THINKING_ENABLED : "false" ,
140144 REASONING_EFFORT : "high" ,
145+ TEMPERATURE : "0.2" ,
141146 DEBUG_LOG_ENABLED : "false" ,
142147 WEBHOOK : "user-webhook" ,
143148 } ,
144149 model : "user-top-model" ,
145150 thinkingEnabled : true ,
146151 reasoningEffort : "max" ,
152+ temperature : 0.4 ,
147153 debugLogEnabled : true ,
148154 telemetryEnabled : false ,
149155 } ,
@@ -153,9 +159,11 @@ test("resolveSettingsSources applies user, project, and DEEPCODE environment pre
153159 MODEL : "project-env-model" ,
154160 THINKING_ENABLED : "false" ,
155161 DEBUG_LOG_ENABLED : "false" ,
162+ TEMPERATURE : "0.6" ,
156163 } ,
157164 model : "project-top-model" ,
158165 thinkingEnabled : true ,
166+ temperature : 0.8 ,
159167 telemetryEnabled : true ,
160168 } ,
161169 {
@@ -166,6 +174,7 @@ test("resolveSettingsSources applies user, project, and DEEPCODE environment pre
166174 DEEPCODE_MODEL : "system-model" ,
167175 DEEPCODE_THINKING_ENABLED : "false" ,
168176 DEEPCODE_REASONING_EFFORT : "high" ,
177+ DEEPCODE_TEMPERATURE : "1.2" ,
169178 DEEPCODE_DEBUG_LOG_ENABLED : "true" ,
170179 DEEPCODE_TELEMETRY_ENABLED : "false" ,
171180 DEEPCODE_WEBHOOK : "system-webhook" ,
@@ -176,6 +185,7 @@ test("resolveSettingsSources applies user, project, and DEEPCODE environment pre
176185 assert . equal ( resolved . apiKey , "project-key" ) ;
177186 assert . equal ( resolved . thinkingEnabled , false ) ;
178187 assert . equal ( resolved . reasoningEffort , "high" ) ;
188+ assert . equal ( resolved . temperature , 1.2 ) ;
179189 assert . equal ( resolved . debugLogEnabled , true ) ;
180190 assert . equal ( resolved . telemetryEnabled , false ) ;
181191 assert . equal ( resolved . env . WEBHOOK , "system-webhook" ) ;
@@ -341,6 +351,24 @@ test("resolveSettings defaults invalid reasoning effort to max", () => {
341351 assert . equal ( resolved . reasoningEffort , "max" ) ;
342352} ) ;
343353
354+ test ( "resolveSettings ignores invalid temperature values" , ( ) => {
355+ const resolved = resolveSettings (
356+ {
357+ env : {
358+ TEMPERATURE : "hot" ,
359+ } ,
360+ temperature : 3 ,
361+ } ,
362+ {
363+ model : "default-model" ,
364+ baseURL : "https://default.example.com" ,
365+ } ,
366+ TEST_PROCESS_ENV
367+ ) ;
368+
369+ assert . equal ( resolved . temperature , undefined ) ;
370+ } ) ;
371+
344372test ( "applyModelConfigSelection writes model only when the effective model changes or already exists" , ( ) => {
345373 const result = applyModelConfigSelection (
346374 {
0 commit comments