@@ -171,6 +171,9 @@ describe("Parallels smoke model selection", () => {
171171 let missingProviderKeyResult : ReturnType < typeof spawnNodeEvalSync > ;
172172 let invalidModelTimeoutResult : ReturnType < typeof spawnNodeEvalSync > ;
173173 let invalidHostPortResult : ReturnType < typeof spawnNodeEvalSync > ;
174+ let invalidLinuxAgentTimeoutResult : ReturnType < typeof spawnNodeEvalSync > ;
175+ let invalidWindowsAgentTimeoutResult : ReturnType < typeof spawnNodeEvalSync > ;
176+ let invalidWindowsUpdateTimeoutResult : ReturnType < typeof spawnNodeEvalSync > ;
174177
175178 beforeAll ( ( ) => {
176179 invalidProviderResult = spawnNodeEvalSync (
@@ -192,6 +195,18 @@ describe("Parallels smoke model selection", () => {
192195 `process.argv = ["node", "${ TS_PATHS . macos } ", "--host-port", "18425x"]; await import("./${ TS_PATHS . macos } ");` ,
193196 { env : process . env , imports : [ "tsx" ] } ,
194197 ) ;
198+ invalidLinuxAgentTimeoutResult = spawnNodeEvalSync (
199+ `process.env.OPENCLAW_PARALLELS_LINUX_AGENT_TIMEOUT_S = "1e3"; process.argv = ["node", "${ TS_PATHS . linux } "]; await import("./${ TS_PATHS . linux } ");` ,
200+ { env : process . env , imports : [ "tsx" ] } ,
201+ ) ;
202+ invalidWindowsAgentTimeoutResult = spawnNodeEvalSync (
203+ `process.env.OPENCLAW_PARALLELS_WINDOWS_AGENT_TIMEOUT_S = "2700s"; process.argv = ["node", "${ TS_PATHS . windows } "]; await import("./${ TS_PATHS . windows } ");` ,
204+ { env : process . env , imports : [ "tsx" ] } ,
205+ ) ;
206+ invalidWindowsUpdateTimeoutResult = spawnNodeEvalSync (
207+ `process.env.OPENCLAW_PARALLELS_WINDOWS_UPDATE_TIMEOUT_S = "12.5"; process.argv = ["node", "${ TS_PATHS . windows } "]; await import("./${ TS_PATHS . windows } ");` ,
208+ { env : process . env , imports : [ "tsx" ] } ,
209+ ) ;
195210 } ) ;
196211
197212 it ( "keeps the public shell entrypoints as thin TypeScript launchers" , ( ) => {
@@ -1067,7 +1082,9 @@ setInterval(() => {}, 1000);
10671082
10681083 expect ( script ) . toContain ( 'guestPowerShellBackground(\n "agent-turn"' ) ;
10691084 expect ( script ) . toContain ( "OPENCLAW_PARALLELS_WINDOWS_AGENT_TIMEOUT_S" ) ;
1070- expect ( script ) . toContain ( "OPENCLAW_PARALLELS_WINDOWS_AGENT_TIMEOUT_S || 2700" ) ;
1085+ expect ( script ) . toContain (
1086+ 'readPositiveIntEnv(\n "OPENCLAW_PARALLELS_WINDOWS_AGENT_TIMEOUT_S"' ,
1087+ ) ;
10711088 expect ( script ) . toContain ( "windowsAgentTurnConfigPatchScript(this.auth.modelId)" ) ;
10721089 expect ( script ) . toContain ( "--model" ) ;
10731090 expect ( script ) . toContain ( 'resolveParallelsModelTimeoutSeconds("windows")' ) ;
@@ -1118,9 +1135,30 @@ setInterval(() => {}, 1000);
11181135 expect ( invalidHostPortResult . status ) . toBe ( 1 ) ;
11191136 expect ( invalidHostPortResult . stderr ) . toContain ( "invalid --host-port: 18425x" ) ;
11201137
1138+ expect ( invalidLinuxAgentTimeoutResult . status ) . toBe ( 1 ) ;
1139+ expect ( invalidLinuxAgentTimeoutResult . stderr ) . toContain (
1140+ "invalid OPENCLAW_PARALLELS_LINUX_AGENT_TIMEOUT_S: 1e3" ,
1141+ ) ;
1142+
1143+ expect ( invalidWindowsAgentTimeoutResult . status ) . toBe ( 1 ) ;
1144+ expect ( invalidWindowsAgentTimeoutResult . stderr ) . toContain (
1145+ "invalid OPENCLAW_PARALLELS_WINDOWS_AGENT_TIMEOUT_S: 2700s" ,
1146+ ) ;
1147+
1148+ expect ( invalidWindowsUpdateTimeoutResult . status ) . toBe ( 1 ) ;
1149+ expect ( invalidWindowsUpdateTimeoutResult . stderr ) . toContain (
1150+ "invalid OPENCLAW_PARALLELS_WINDOWS_UPDATE_TIMEOUT_S: 12.5" ,
1151+ ) ;
1152+
11211153 expect ( readFileSync ( TS_PATHS . macos , "utf8" ) ) . toContain (
11221154 'this.updateDevTimeoutSeconds = readPositiveIntEnv(\n "OPENCLAW_PARALLELS_MACOS_UPDATE_DEV_TIMEOUT_S"' ,
11231155 ) ;
1156+ expect ( readFileSync ( TS_PATHS . linux , "utf8" ) ) . toContain (
1157+ 'readPositiveIntEnv(\n "OPENCLAW_PARALLELS_LINUX_AGENT_TIMEOUT_S"' ,
1158+ ) ;
1159+ expect ( readFileSync ( TS_PATHS . windows , "utf8" ) ) . toContain (
1160+ 'readPositiveIntEnv(\n "OPENCLAW_PARALLELS_WINDOWS_UPDATE_TIMEOUT_S"' ,
1161+ ) ;
11241162 expect ( readFileSync ( TS_PATHS . packageArtifact , "utf8" ) ) . toContain (
11251163 'readPositiveIntEnv("OPENCLAW_PARALLELS_PACKAGE_LOCK_TIMEOUT_MS", 30 * 60_000)' ,
11261164 ) ;
0 commit comments