fix: resetTimeoutOnProgress does nothing without onprogress callback#2136
Open
malventano wants to merge 1 commit into
Open
fix: resetTimeoutOnProgress does nothing without onprogress callback#2136malventano wants to merge 1 commit into
malventano wants to merge 1 commit into
Conversation
|
commit: |
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.
Refs #2076.
There's a setting in the MCP client library that keeps long-running tasks from timing out. By default, requests die after 60 seconds. With this setting turned on, every time the server reports "I'm still working," that 60-second timer resets so the task can continue. But it only works if the client also provides an
onprogresscallback alongside it. If the client passesresetTimeoutOnProgress: truewithout also passingonprogress, the progress notifications arrive but are silently dropped and the timer never resets. The option claims to work on its own — it doesn't.Why it happens
_onprogress()looks up the handler in_progressHandlersfirst, and that map is only populated whenonprogressis provided (inrequest()). If no handler exists, the method errors and returns before reaching the timeout reset code.The fix
Move the timeout reset before the handler lookup. Guard only
handler(params).After
resetTimeoutOnProgress: trueworks standalone — noonprogressneeded