@@ -321,8 +321,8 @@ export type ChatTaskWirePayload<TMessage extends UIMessage = UIMessage, TMetadat
321321 continuation ?: boolean ;
322322 /** The run ID of the previous run (only set when `continuation` is true). */
323323 previousRunId ?: string ;
324- /** Override warm timeout for this run (seconds). Set by transport.preload(). */
325- warmTimeoutInSeconds ?: number ;
324+ /** Override idle timeout for this run (seconds). Set by transport.preload(). */
325+ idleTimeoutInSeconds ?: number ;
326326} ;
327327
328328/**
@@ -896,16 +896,16 @@ export type ChatTaskOptions<
896896 turnTimeout ?: string ;
897897
898898 /**
899- * How long (in seconds) to keep the run warm after each turn before suspending.
900- * During this window the run stays active and can respond instantly to the
901- * next message. After this timeout, the run suspends (frees compute) and waits
902- * via `inputStream.wait()`.
899+ * How long (in seconds) the run stays idle (active, using compute) after each
900+ * turn, waiting for the next message. During this window responses are instant.
901+ * After this timeout the run suspends (frees compute) and waits via
902+ * `inputStream.wait()`.
903903 *
904904 * Set to `0` to suspend immediately after each turn.
905905 *
906906 * @default 30
907907 */
908- warmTimeoutInSeconds ?: number ;
908+ idleTimeoutInSeconds ?: number ;
909909
910910 /**
911911 * How long the `chatAccessToken` (scoped to this run) remains valid.
@@ -919,14 +919,14 @@ export type ChatTaskOptions<
919919 chatAccessTokenTTL ?: string ;
920920
921921 /**
922- * How long (in seconds) to keep the run warm after `onPreload` fires,
922+ * How long (in seconds) the run stays idle after `onPreload` fires,
923923 * waiting for the first message before suspending.
924924 *
925925 * Only applies to preloaded runs (triggered via `transport.preload()`).
926926 *
927- * @default Same as `warmTimeoutInSeconds `
927+ * @default Same as `idleTimeoutInSeconds `
928928 */
929- preloadWarmTimeoutInSeconds ?: number ;
929+ preloadIdleTimeoutInSeconds ?: number ;
930930
931931 /**
932932 * How long to wait (suspended) for the first message after a preloaded run starts.
@@ -1010,9 +1010,9 @@ function chatTask<
10101010 onTurnComplete,
10111011 maxTurns = 100 ,
10121012 turnTimeout = "1h" ,
1013- warmTimeoutInSeconds = 30 ,
1013+ idleTimeoutInSeconds = 30 ,
10141014 chatAccessTokenTTL = "1h" ,
1015- preloadWarmTimeoutInSeconds ,
1015+ preloadIdleTimeoutInSeconds ,
10161016 preloadTimeout,
10171017 uiMessageStreamOptions,
10181018 ...restOptions
@@ -1111,18 +1111,18 @@ function chatTask<
11111111 }
11121112
11131113 // Wait for the first real message — use preload-specific timeouts if configured
1114- const effectivePreloadWarmTimeout =
1115- payload . warmTimeoutInSeconds
1116- ?? preloadWarmTimeoutInSeconds
1117- ?? warmTimeoutInSeconds ;
1114+ const effectivePreloadIdleTimeout =
1115+ payload . idleTimeoutInSeconds
1116+ ?? preloadIdleTimeoutInSeconds
1117+ ?? idleTimeoutInSeconds ;
11181118
11191119 const effectivePreloadTimeout =
11201120 ( metadata . get ( TURN_TIMEOUT_METADATA_KEY ) as string | undefined )
11211121 ?? preloadTimeout
11221122 ?? turnTimeout ;
11231123
1124- const preloadResult = await messagesInput . waitWithWarmup ( {
1125- warmTimeoutInSeconds : effectivePreloadWarmTimeout ,
1124+ const preloadResult = await messagesInput . waitWithIdleTimeout ( {
1125+ idleTimeoutInSeconds : effectivePreloadIdleTimeout ,
11261126 timeout : effectivePreloadTimeout ,
11271127 spanName : "waiting for first message" ,
11281128 } ) ;
@@ -1493,14 +1493,14 @@ function chatTask<
14931493 return "continue" ;
14941494 }
14951495
1496- // Wait for the next message — stay warm briefly, then suspend
1497- const effectiveWarmTimeout =
1498- ( metadata . get ( WARM_TIMEOUT_METADATA_KEY ) as number | undefined ) ?? warmTimeoutInSeconds ;
1496+ // Wait for the next message — stay idle briefly, then suspend
1497+ const effectiveIdleTimeout =
1498+ ( metadata . get ( IDLE_TIMEOUT_METADATA_KEY ) as number | undefined ) ?? idleTimeoutInSeconds ;
14991499 const effectiveTurnTimeout =
15001500 ( metadata . get ( TURN_TIMEOUT_METADATA_KEY ) as string | undefined ) ?? turnTimeout ;
15011501
1502- const next = await messagesInput . waitWithWarmup ( {
1503- warmTimeoutInSeconds : effectiveWarmTimeout ,
1502+ const next = await messagesInput . waitWithIdleTimeout ( {
1503+ idleTimeoutInSeconds : effectiveIdleTimeout ,
15041504 timeout : effectiveTurnTimeout ,
15051505 spanName : "waiting for next message" ,
15061506 } ) ;
@@ -1554,7 +1554,7 @@ function chatTask<
15541554// ---------------------------------------------------------------------------
15551555
15561556const TURN_TIMEOUT_METADATA_KEY = "chat.turnTimeout" ;
1557- const WARM_TIMEOUT_METADATA_KEY = "chat.warmTimeout " ;
1557+ const IDLE_TIMEOUT_METADATA_KEY = "chat.idleTimeout " ;
15581558
15591559/**
15601560 * Override the turn timeout for subsequent turns in the current run.
@@ -1597,24 +1597,24 @@ function setTurnTimeoutInSeconds(seconds: number): void {
15971597}
15981598
15991599/**
1600- * Override the warm timeout for subsequent turns in the current run.
1600+ * Override the idle timeout for subsequent turns in the current run.
16011601 *
1602- * The warm timeout controls how long the run stays active (using compute)
1602+ * The idle timeout controls how long the run stays active (using compute)
16031603 * after each turn, waiting for the next message. During this window,
16041604 * responses are instant. After it expires, the run suspends.
16051605 *
1606- * @param seconds - Number of seconds to stay warm (0 to suspend immediately)
1606+ * @param seconds - Number of seconds to stay idle (0 to suspend immediately)
16071607 *
16081608 * @example
16091609 * ```ts
16101610 * run: async ({ messages, signal }) => {
1611- * chat.setWarmTimeoutInSeconds (60);
1611+ * chat.setIdleTimeoutInSeconds (60);
16121612 * return streamText({ model, messages, abortSignal: signal });
16131613 * }
16141614 * ```
16151615 */
1616- function setWarmTimeoutInSeconds ( seconds : number ) : void {
1617- metadata . set ( WARM_TIMEOUT_METADATA_KEY , seconds ) ;
1616+ function setIdleTimeoutInSeconds ( seconds : number ) : void {
1617+ metadata . set ( IDLE_TIMEOUT_METADATA_KEY , seconds ) ;
16181618}
16191619
16201620/**
@@ -1937,8 +1937,8 @@ class ChatMessageAccumulator {
19371937export type ChatSessionOptions = {
19381938 /** Run-level cancel signal (from task context). */
19391939 signal : AbortSignal ;
1940- /** Seconds to stay warm between turns before suspending. @default 30 */
1941- warmTimeoutInSeconds ?: number ;
1940+ /** Seconds to stay idle between turns before suspending. @default 30 */
1941+ idleTimeoutInSeconds ?: number ;
19421942 /** Duration string for suspend timeout. @default "1h" */
19431943 timeout ?: string ;
19441944 /** Max turns before ending. @default 100 */
@@ -1988,7 +1988,7 @@ export type ChatTurn = {
19881988 * Create a chat session that yields turns as an async iterator.
19891989 *
19901990 * Handles: preload wait, stop signals, message accumulation, turn-complete
1991- * signaling, and warm /suspend between turns. You control: initialization,
1991+ * signaling, and idle /suspend between turns. You control: initialization,
19921992 * model/tool selection, persistence, and any custom per-turn logic.
19931993 *
19941994 * @example
@@ -2021,7 +2021,7 @@ function createChatSession(
20212021) : AsyncIterable < ChatTurn > {
20222022 const {
20232023 signal : runSignal ,
2024- warmTimeoutInSeconds = 30 ,
2024+ idleTimeoutInSeconds = 30 ,
20252025 timeout = "1h" ,
20262026 maxTurns = 100 ,
20272027 } = options ;
@@ -2039,8 +2039,8 @@ function createChatSession(
20392039
20402040 // First turn: handle preload — wait for the first real message
20412041 if ( turn === 0 && currentPayload . trigger === "preload" ) {
2042- const result = await messagesInput . waitWithWarmup ( {
2043- warmTimeoutInSeconds : currentPayload . warmTimeoutInSeconds ?? warmTimeoutInSeconds ,
2042+ const result = await messagesInput . waitWithIdleTimeout ( {
2043+ idleTimeoutInSeconds : currentPayload . idleTimeoutInSeconds ?? idleTimeoutInSeconds ,
20442044 timeout,
20452045 spanName : "waiting for first message" ,
20462046 } ) ;
@@ -2053,8 +2053,8 @@ function createChatSession(
20532053
20542054 // Subsequent turns: wait for the next message
20552055 if ( turn > 0 ) {
2056- const next = await messagesInput . waitWithWarmup ( {
2057- warmTimeoutInSeconds ,
2056+ const next = await messagesInput . waitWithIdleTimeout ( {
2057+ idleTimeoutInSeconds ,
20582058 timeout,
20592059 spanName : "waiting for next message" ,
20602060 } ) ;
@@ -2391,8 +2391,8 @@ export const chat = {
23912391 setTurnTimeout,
23922392 /** Override the turn timeout at runtime (seconds). See {@link setTurnTimeoutInSeconds}. */
23932393 setTurnTimeoutInSeconds,
2394- /** Override the warm timeout at runtime. See {@link setWarmTimeoutInSeconds }. */
2395- setWarmTimeoutInSeconds ,
2394+ /** Override the idle timeout at runtime. See {@link setIdleTimeoutInSeconds }. */
2395+ setIdleTimeoutInSeconds ,
23962396 /** Override toUIMessageStream() options for the current turn. See {@link setUIMessageStreamOptions}. */
23972397 setUIMessageStreamOptions,
23982398 /** Check if the current turn was stopped by the user. See {@link isStopped}. */
0 commit comments