Repository navigation
Give Google ADK TypeScript model and MCP Activities a 10-second default heartbeat timeout - #506
Merged
Merged
Conversation
…lt heartbeat timeout TemporalModel and TemporalMCPToolset left heartbeatTimeout unset, and their Activities heartbeat on a timer only when it's set. So a cancel never reached a running model or MCP call, and a lost worker went unnoticed until the start-to-close timeout. Default it to 10 seconds. The Activities already heartbeat on a timer at half the timeout. Setting it to 0 turns the timer off. activityAsTool and activityNode run the user's own Activities, so they get no default. Part of #491.
campoy
marked this pull request as ready for review
November 13, 2026 00:55
JasonSteving99
approved these changes
Nov 13, 2026
This was referenced Nov 13, 2026
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What was changed
TemporalModelandTemporalMCPToolsetnow give their Activities a 10-secondheartbeatTimeoutwhen you don't set one. That's the model calls (adk-invokeModelandadk-invokeModelStreaming) and the MCP calls (<name>-listTools,-callTool,-listResourcesand-readResource).startAdaptiveHeartbeat), so they don't change.heartbeatTimeout: 0turns the timer off. The default goes in with??, so a0passes through, and the SDK schedules it as no heartbeat timeout.model: 'gemini-2.5-flash') runs throughTemporalModelwith its default options, so it gets the default too.activityAsToolandactivityNoderun your own Activities, which may never heartbeat, so they stay as they are. They share an options helper with the MCP calls, so the default lives in a second helper that only the model and MCP calls use.TemporalModelOptions.activitydoc said the model Activities heartbeat "not at all without" a heartbeat timeout. That was already wrong for streaming, which heartbeats after each chunk. It now says what the default does and how to turn it off, and so do theTemporalMCPToolsetOptions.activitydoc and the README.Why?
Without a heartbeat timeout, the MCP calls and the model calls that don't stream never heartbeat. So a cancel never reaches a running call: a cancelled Workflow, or a failing sibling node in a graph, leaves it running to the end. A lost worker also goes unnoticed until the one-minute start-to-close timeout. A streaming call does heartbeat after each chunk, but nothing goes out while the model is quiet.
Why 10 seconds? #491 has the measurements.
Does this break anything? Not replay: when core replays a scheduled Activity, it only compares its ID and type, and the replay tests over the recorded histories pass. But a call that didn't set
heartbeatTimeoutnow heartbeats, which in Temporal Cloud is at most one Action every 8 seconds of a running call. And a Worker whose event loop blocks for about 10 seconds now fails the call with a heartbeat timeout, and retries it.Checklist
Closes [Feature Request] Give Google ADK TypeScript model and MCP Activities a 10-second default heartbeat timeout #505
How was this tested:
getScheduledHeartbeatTimeouts, reads each scheduled Activity's heartbeat timeout from History. Four existing tests now use it:dispatchesModelToolCallToActivity: both model calls get 10 seconds, and theactivityAsToolActivity gets none.callToolRoutesToActivity:listToolsandcallToolget 10 seconds.listResources and readResource route through the resource Activities: both get 10 seconds.appliesActivityTimeout: its model call now setsheartbeatTimeout: 0, and gets no heartbeat timeout.make test(253 passed),make lintand the conventions check pass, on Node 24 with Temporal CLI 1.10.0.Any docs updates needed?
The docs and the README are updated here. Release notes should mention the new default, and how to turn it off.