@@ -38,7 +38,7 @@ import {
3838 SESSIONS_SEND_TOOL_DISPLAY_SUMMARY ,
3939} from "../tool-description-presets.js" ;
4040import type { AnyAgentTool } from "./common.js" ;
41- import { jsonResult , readStringParam } from "./common.js" ;
41+ import { jsonResult , readNonNegativeIntegerParam , readStringParam } from "./common.js" ;
4242import {
4343 createSessionVisibilityGuard ,
4444 createAgentToAgentPolicy ,
@@ -55,7 +55,7 @@ const SessionsSendToolSchema = Type.Object({
5555 label : Type . Optional ( Type . String ( { minLength : 1 , maxLength : SESSION_LABEL_MAX_LENGTH } ) ) ,
5656 agentId : Type . Optional ( Type . String ( { minLength : 1 , maxLength : 64 } ) ) ,
5757 message : Type . String ( ) ,
58- timeoutSeconds : Type . Optional ( Type . Number ( { minimum : 0 } ) ) ,
58+ timeoutSeconds : Type . Optional ( Type . Integer ( { minimum : 0 } ) ) ,
5959} ) ;
6060
6161type GatewayCaller = typeof callGateway ;
@@ -283,6 +283,7 @@ export function createSessionsSendTool(opts?: {
283283 const params = args as Record < string , unknown > ;
284284 const gatewayCall = opts ?. callGateway ?? callGateway ;
285285 const message = readStringParam ( params , "message" , { required : true } ) ;
286+ const timeoutSeconds = readNonNegativeIntegerParam ( params , "timeoutSeconds" ) ?? 30 ;
286287 const { cfg, mainKey, alias, effectiveRequesterKey, restrictToSpawned } =
287288 resolveSessionToolContext ( opts ) ;
288289
@@ -435,10 +436,6 @@ export function createSessionsSendTool(opts?: {
435436 // Normalize sessionKey/sessionId input into a canonical session key.
436437 const resolvedKey = visibleSession . key ;
437438 const displayKey = visibleSession . displayKey ;
438- const timeoutSeconds =
439- typeof params . timeoutSeconds === "number" && Number . isFinite ( params . timeoutSeconds )
440- ? Math . max ( 0 , Math . floor ( params . timeoutSeconds ) )
441- : 30 ;
442439 const timeoutMs = timeoutSeconds * 1000 ;
443440 const announceTimeoutMs = timeoutSeconds === 0 ? 30_000 : timeoutMs ;
444441 const idempotencyKey = crypto . randomUUID ( ) ;
0 commit comments