Skip to content

[Feature Request] Give Strands TypeScript model calls a 10-second default heartbeat timeout #507

Closed

Description

@campoy

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.

This is the TypeScript Strands part of #491.

Describe the solution you'd like

  • 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

  1. added
    enhancement
    on Nov 13, 2026
  2. added a commit that references this issue on Nov 13, 2026
    14ec941
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions