Skip to content

[python/mcp] say that timedelta(0) also turns heartbeats off - #521

Open
campoy wants to merge 2 commits into
mainfrom
docs/mcp-zero-heartbeat-timeout
Open

campoy wants to merge 2 commits into
mainfrom
docs/mcp-zero-heartbeat-timeout

Conversation

@campoy

@campoy campoy commented Nov 13, 2026

Copy link
Copy Markdown
Contributor

What was changed

The python/mcp README and TemporalMCPClient's docstring now say that heartbeat_timeout=timedelta(0) turns heartbeats off too, not only None.

Why?

In #494's review, David asked what 0 does here, since other plugins use 0 or a negative value to turn heartbeats off. Well, the same as None: the SDK only sends a heartbeat timeout when it's truthy, and the heartbeat timer doesn't start without one. Now the docs say so.

Checklist

  1. No issue: a docs follow-up to mcp: heartbeat while an MCP operation runs, with a 10-second default heartbeat timeout #494.

  2. How was this tested:
    Docs only. make lint and the conventions check pass.

  3. Any docs updates needed?
    No, this is the docs update.

The Python SDK treats a zero heartbeat timeout as no timeout, and the
heartbeat timer doesn't start without one, so timedelta(0) turns
heartbeats off just like None. The README and TemporalMCPClient's
docstring only mentioned None.
The last change left a short line before an overlong one. Wrap the
sentences to the same width as the rest of the docstring.
@campoy
campoy marked this pull request as ready for review November 13, 2026 05:44
@campoy
campoy requested a review from a team as a code owner November 13, 2026 05:44
@campoy campoy changed the title mcp: say that timedelta(0) also turns heartbeats off [mcp-python] say that timedelta(0) also turns heartbeats off Nov 16, 2026
@campoy campoy changed the title [mcp-python] say that timedelta(0) also turns heartbeats off [python/mcp] say that timedelta(0) also turns heartbeats off Nov 16, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant