modelcontextprotocol / modelcontextprotocol/typescript-sdk

`resetTimeoutOnProgress` on low-level `request()` only works when `onprogress` is explicitly provided

Open
#2,076 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug fix proposed P2 ready for work
Dominant language
TypeScript
Stars
13.4k
Forks
2.2k
Avg merge
3d 15h
Merged PRs (30d)
4

Description

I found a behavior in the TypeScript SDK that feels surprising when using the low-level request() API.

When I call request() with resetTimeoutOnProgress: true, I would expect incoming progress notifications to keep the request alive for timeout purposes. In practice, that only seems to happen when onprogress is explicitly provided in the request options.

The issue is not that I do not want to track progress. In my case, progress may already be consumed through lower-level transport features. The problem is that if onprogress is not explicitly set on request(), the timeout reset behavior does not seem to activate.

This makes resetTimeoutOnProgress behave more narrowly than its name suggests. It appears to be coupled to explicit callback registration rather than to the presence of valid progress activity for the request.

From my point of view, there are two reasonable outcomes.

One option would be to make resetTimeoutOnProgress work whenever the request is progress-capable and valid progress notifications are received, even if onprogress is not explicitly passed.

The other option would be to document clearly that resetTimeoutOnProgress only has an effect when onprogress is explicitly provided on the same request() call.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing the low-level request() handling for resetTimeoutOnProgress and its relationship to onprogress. Reproduce a progress-capable request without an explicit callback, then compare the behavior with the callback case; done means either the timeout behavior matches the intended progress semantics or the limitation is documented clearly.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
api
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.