Skip to content

fix(mcp): enable progress timeout resets#32477

Open
Nomadcxx wants to merge 1 commit into
anomalyco:devfrom
Nomadcxx:rama/mcp-progress-keepalive
Open

fix(mcp): enable progress timeout resets#32477
Nomadcxx wants to merge 1 commit into
anomalyco:devfrom
Nomadcxx:rama/mcp-progress-keepalive

Conversation

@Nomadcxx

Copy link
Copy Markdown
Contributor

Issue for this PR

Fixes #28186
Refs #28567, #24965, #21701, #14499, #24964, #28246

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

opencode already passes resetTimeoutOnProgress: true when calling MCP tools, but the MCP TS SDK only adds _meta.progressToken when an onprogress callback is present.

Without that callback, long-running MCP tools can still hit the client timeout even if the server supports progress notifications. This adds a no-op progress handler so the SDK sends the progress token and can reset the request timeout when progress arrives.

I kept this intentionally small. Surfacing progress in the UI/logs should be a separate follow-up since that starts touching product shape.

How did you verify your code works?

Added a focused MCP lifecycle test that executes a converted MCP tool and verifies the SDK call options include:

  • resetTimeoutOnProgress: true
  • the abort signal
  • the configured timeout
  • an onprogress handler

Ran:

bun test --timeout 30000 test/mcp/lifecycle.test.ts --only-failures
bun run typecheck
bun test --timeout 30000 test/mcp --only-failures

Notes

This is the same small compatibility shape as the earlier progress PRs, but rebased onto current dev with a focused test.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

@github-actions

Copy link
Copy Markdown
Contributor

The following comment was made by an LLM, it may be inaccurate:

Potential Related PR Found:

Why it's related: This PR appears to be directly addressing the same issue—adding an onprogress handler to MCP tool calls so that progressToken is set by the SDK. The current PR (#32477) is a rebased version of this earlier progress PR with a focused test, as noted in the PR description. This is likely a successor to or replacement of PR #28246.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

MCP client doesn't pass onprogress to callTool, so progress notifications can't extend the request timeout

1 participant