Skip to content

[Feature Request] Give google-genai calls a 10-second default heartbeat timeout #550

Closed

Description

@campoy

Is your feature request related to a problem? Please describe.

TemporalAsyncClient runs every Gemini call as one of 16 plugin activities: model calls, files, file search uploads, interactions and managed agents. None of them heartbeats, except the interaction streams, which heartbeat once per event. And the client sets no heartbeat_timeout. So by default:

  • A cancel never reaches a running call. A generate_content call runs to the end, and we pay for it.
  • A lost worker goes unnoticed until the 60-second start-to-close timeout.

Can't you set heartbeat_timeout yourself? Not today: the calls don't heartbeat, so every call longer than the timeout fails and retries. Interaction streams only survive while events keep coming.

This is the Python google-genai part of #491.

Describe the solution you'd like

  • Every one of the 16 activities heartbeats on a timer at half the heartbeat timeout, for as long as the call runs. The first heartbeat goes out half the timeout into the call, so a call shorter than that sends none.
  • The interaction streams stop heartbeating per event.
  • heartbeat_timeout defaults to 10 seconds, also when activity_config leaves it out. A timeout you set wins, and None or timedelta(0) turns heartbeats off.

Additional context

activity_as_tool runs your own activities, so it stays as it is. The MCP activities are out of scope for now.

It doesn't affect replay: core only compares an activity's ID and type, and heartbeats aren't in History. In Temporal Cloud each heartbeat that reaches the server is an Action: at most one every 8 seconds of a running call, and none for a call shorter than 5 seconds.

Activity

  1. added
    enhancement
    on Nov 14, 2026
  2. added a commit that references this issue on Nov 16, 2026
    3d3bb7e
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