You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Feature Request] Give Strands TypeScript model calls a 10-second default heartbeat timeout #507
Is your feature request related to a problem? Please describe.
TemporalAgent and TemporalModel schedule the model activities without a heartbeat timeout unless you set activityOptions.heartbeatTimeout, and those activities only heartbeat when it's set. So by default:
A cancel never reaches a running model call. Since fix(strands): give the model the activity's cancellation signal #297 the model gets the activity's cancellation signal, but the worker only hears about the cancel through a heartbeat, so the signal never aborts and the call runs to the end.
A lost worker goes unnoticed until the start-to-close timeout, 10 minutes by default.
Default heartbeatTimeout to 10 seconds for the four model activities (invokeModel, invokeModelStreaming, strandsInvokeStatefulModel and strandsInvokeStatefulModelStreaming). They already heartbeat on a timer at half the timeout, so they don't need to change. A timeout you set wins, and heartbeatTimeout: 0 turns heartbeats off.
Schedule strandsGetModelConfig without a heartbeat timeout. It builds the model and reads its config synchronously, so a heartbeat timer can't fire until it returns, and a model factory slower than the timeout would fail it.
Additional context
#491 lists the config read as needing a timer first. Why not add one? Well, the timer would never get a chance to run: nothing in the read waits, so Node runs it start to finish in one go.
TemporalMCPClient's activities never heartbeat, so a default there would fail every MCP call longer than 10 seconds. They need a timer first, in a separate change. activityAsTool and activityAsHook run your own activities, so they stay as they are.
Activity
Give Strands TypeScript model calls a 10-second default heartbeat tim…