@@ -325,15 +325,34 @@ describe("native u64 fields advertised as number (#2316)", () => {
325325 . toBe ( '{"timeout_ms":"120000"}' ) ;
326326 } ) ;
327327
328- test ( "Cursor's sibling field stays unchanged even with wait identity" , ( ) => {
329- // Cursor uses yield_time_ms (underscore), not wait's yield-time_ms (hyphen).
330- // Keep this explicit scope proof from #2316: field names are never broadened globally.
331- const others = {
328+ test ( "bare wait repairs yield_time_ms and leaves unrelated number fields alone" , ( ) => {
329+ // Live Codex Desktop wait uses the underscore form (#2451). Wait identity
330+ // repairs that field and max_tokens, but never a generic number field.
331+ const schema = {
332+ type : "object" ,
333+ properties : {
334+ yield_time_ms : { type : "number" } ,
335+ max_tokens : { type : "number" } ,
336+ priority : { type : "number" } ,
337+ } ,
338+ } ;
339+ expect ( coerceIntegerToolArguments (
340+ '{"yield_time_ms":20000.0,"max_tokens":5000.0,"priority":2.0}' ,
341+ schema ,
342+ "wait" ,
343+ ) ) . toBe ( '{"yield_time_ms":20000,"max_tokens":5000,"priority":2}' ) ;
344+ const priorityOnly = '{"priority":2.0}' ;
345+ expect ( coerceIntegerToolArguments (
346+ priorityOnly ,
347+ schema ,
348+ "wait" ,
349+ ) ) . toBe ( priorityOnly ) ;
350+ const other = {
332351 type : "object" ,
333352 properties : { yield_time_ms : { type : "number" } , priority : { type : "number" } } ,
334353 } ;
335354 const raw = '{"yield_time_ms":60000.0,"priority":2.0}' ;
336- expect ( coerceIntegerToolArguments ( raw , others , "wait " ) ) . toBe ( raw ) ;
355+ expect ( coerceIntegerToolArguments ( raw , other , "other_tool " ) ) . toBe ( raw ) ;
337356 } ) ;
338357
339358 test ( "the namespaced wait_agent call is repaired through the real bridge" , async ( ) => {
@@ -367,7 +386,7 @@ describe("native u64 fields advertised as number (#2316)", () => {
367386const CODEX_DESKTOP_WAIT_SCHEMA = {
368387 type : "object" ,
369388 properties : {
370- "yield-time_ms " : { type : "number" } ,
389+ "yield_time_ms " : { type : "number" } ,
371390 max_tokens : { type : "number" } ,
372391 } ,
373392} ;
@@ -384,26 +403,26 @@ const WAIT_SCOPE_NAMESPACE_MAP = new Map([
384403
385404const WAIT_SCOPE_EVENTS : AdapterEvent [ ] = [
386405 { type : "tool_call_start" , id : "call_wait" , name : "wait" } ,
387- { type : "tool_call_delta" , arguments : '{"yield-time_ms ":120000.0,"max_tokens":8000.0}' } ,
406+ { type : "tool_call_delta" , arguments : '{"yield_time_ms ":120000.0,"max_tokens":8000.0}' } ,
388407 { type : "tool_call_end" , id : "call_wait" } ,
389408 { type : "tool_call_start" , id : "call_fractional" , name : "wait" } ,
390- { type : "tool_call_delta" , arguments : '{"yield-time_ms ":1.5,"max_tokens":1.5}' } ,
409+ { type : "tool_call_delta" , arguments : '{"yield_time_ms ":1.5,"max_tokens":1.5}' } ,
391410 { type : "tool_call_end" , id : "call_fractional" } ,
392411 { type : "tool_call_start" , id : "call_other" , name : "other_tool" } ,
393- { type : "tool_call_delta" , arguments : '{"yield-time_ms ":120000.0,"max_tokens":8000.0}' } ,
412+ { type : "tool_call_delta" , arguments : '{"yield_time_ms ":120000.0,"max_tokens":8000.0}' } ,
394413 { type : "tool_call_end" , id : "call_other" } ,
395414 { type : "tool_call_start" , id : "call_namespaced" , name : "cursor_wait" } ,
396- { type : "tool_call_delta" , arguments : '{"yield-time_ms ":120000.0,"max_tokens":8000.0}' } ,
415+ { type : "tool_call_delta" , arguments : '{"yield_time_ms ":120000.0,"max_tokens":8000.0}' } ,
397416 { type : "tool_call_end" , id : "call_namespaced" } ,
398417 { type : "done" } ,
399418] ;
400419
401- describe ( "Codex Desktop wait native integers (#2443)" , ( ) => {
420+ describe ( "Codex Desktop wait native integers (#2443 / #2451 )" , ( ) => {
402421 const expectedCalls = [
403- { name : "wait" , namespace : undefined , arguments : '{"yield-time_ms ":120000,"max_tokens":8000}' } ,
404- { name : "wait" , namespace : undefined , arguments : '{"yield-time_ms ":1.5,"max_tokens":1.5}' } ,
405- { name : "other_tool" , namespace : undefined , arguments : '{"yield-time_ms ":120000.0,"max_tokens":8000.0}' } ,
406- { name : "wait" , namespace : "cursor" , arguments : '{"yield-time_ms ":120000.0,"max_tokens":8000.0}' } ,
422+ { name : "wait" , namespace : undefined , arguments : '{"yield_time_ms ":120000,"max_tokens":8000}' } ,
423+ { name : "wait" , namespace : undefined , arguments : '{"yield_time_ms ":1.5,"max_tokens":1.5}' } ,
424+ { name : "other_tool" , namespace : undefined , arguments : '{"yield_time_ms ":120000.0,"max_tokens":8000.0}' } ,
425+ { name : "wait" , namespace : "cursor" , arguments : '{"yield_time_ms ":120000.0,"max_tokens":8000.0}' } ,
407426 ] ;
408427
409428 test ( "streaming bridge scopes the repair to the bare wait tool" , async ( ) => {
0 commit comments