@@ -325,15 +325,28 @@ 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 other = {
332345 type : "object" ,
333346 properties : { yield_time_ms : { type : "number" } , priority : { type : "number" } } ,
334347 } ;
335348 const raw = '{"yield_time_ms":60000.0,"priority":2.0}' ;
336- expect ( coerceIntegerToolArguments ( raw , others , "wait " ) ) . toBe ( raw ) ;
349+ expect ( coerceIntegerToolArguments ( raw , other , "other_tool " ) ) . toBe ( raw ) ;
337350 } ) ;
338351
339352 test ( "the namespaced wait_agent call is repaired through the real bridge" , async ( ) => {
@@ -367,7 +380,7 @@ describe("native u64 fields advertised as number (#2316)", () => {
367380const CODEX_DESKTOP_WAIT_SCHEMA = {
368381 type : "object" ,
369382 properties : {
370- "yield-time_ms " : { type : "number" } ,
383+ "yield_time_ms " : { type : "number" } ,
371384 max_tokens : { type : "number" } ,
372385 } ,
373386} ;
@@ -384,26 +397,26 @@ const WAIT_SCOPE_NAMESPACE_MAP = new Map([
384397
385398const WAIT_SCOPE_EVENTS : AdapterEvent [ ] = [
386399 { type : "tool_call_start" , id : "call_wait" , name : "wait" } ,
387- { type : "tool_call_delta" , arguments : '{"yield-time_ms ":120000.0,"max_tokens":8000.0}' } ,
400+ { type : "tool_call_delta" , arguments : '{"yield_time_ms ":120000.0,"max_tokens":8000.0}' } ,
388401 { type : "tool_call_end" , id : "call_wait" } ,
389402 { type : "tool_call_start" , id : "call_fractional" , name : "wait" } ,
390- { type : "tool_call_delta" , arguments : '{"yield-time_ms ":1.5,"max_tokens":1.5}' } ,
403+ { type : "tool_call_delta" , arguments : '{"yield_time_ms ":1.5,"max_tokens":1.5}' } ,
391404 { type : "tool_call_end" , id : "call_fractional" } ,
392405 { 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}' } ,
406+ { type : "tool_call_delta" , arguments : '{"yield_time_ms ":120000.0,"max_tokens":8000.0}' } ,
394407 { type : "tool_call_end" , id : "call_other" } ,
395408 { 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}' } ,
409+ { type : "tool_call_delta" , arguments : '{"yield_time_ms ":120000.0,"max_tokens":8000.0}' } ,
397410 { type : "tool_call_end" , id : "call_namespaced" } ,
398411 { type : "done" } ,
399412] ;
400413
401- describe ( "Codex Desktop wait native integers (#2443)" , ( ) => {
414+ describe ( "Codex Desktop wait native integers (#2443 / #2451 )" , ( ) => {
402415 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}' } ,
416+ { name : "wait" , namespace : undefined , arguments : '{"yield_time_ms ":120000,"max_tokens":8000}' } ,
417+ { name : "wait" , namespace : undefined , arguments : '{"yield_time_ms ":1.5,"max_tokens":1.5}' } ,
418+ { name : "other_tool" , namespace : undefined , arguments : '{"yield_time_ms ":120000.0,"max_tokens":8000.0}' } ,
419+ { name : "wait" , namespace : "cursor" , arguments : '{"yield_time_ms ":120000.0,"max_tokens":8000.0}' } ,
407420 ] ;
408421
409422 test ( "streaming bridge scopes the repair to the bare wait tool" , async ( ) => {
0 commit comments