Skip to content

Conversation

@vamgan
Copy link
Contributor

@vamgan vamgan commented Sep 11, 2025

Description

  • Add multiple retry strategies (NoRetryStrategy, ExponentialBackoffRetry, LinearBackoffRetry, CustomRetryStrategy)
  • Add MCPRetryConfig for global and per-tool retry configuration
  • Integrate retry mechanism into MCPClient call_tool_sync and call_tool_async methods
  • Add retry metadata to tool results for visibility
  • Update async tests to handle retry mechanism in test mocks
  • Add comprehensive test coverage for retry strategies

Related Issues

#675

Documentation PR

Type of Change

New feature

Testing

How have you tested the change? Verify that the changes do not break functionality or introduce warnings in consuming repositories: agents-docs, agents-tools, agents-cli

  • I ran hatch run prepare

Checklist

  • I have read the CONTRIBUTING document
  • I have added any necessary tests that prove my fix is effective or my feature works
  • I have updated the documentation accordingly
  • I have added an appropriate example to the documentation to outline the feature, or no new docs are needed
  • My changes generate no new warnings
  • Any dependent changes have been merged and published

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@dbschmigelski dbschmigelski self-assigned this Sep 15, 2025
@vamgan
Copy link
Contributor Author

vamgan commented Sep 19, 2025

Hi @dbschmigelski / @Unshure, if this CR can be reviewed by next week. Thanks!

@mehtarac mehtarac requested a review from dbschmigelski October 2, 2025 20:53
@vamgan vamgan force-pushed the feat/mcp-client-retry-mechanism branch from 727aec3 to 96fe37d Compare November 22, 2025 00:13
@vamgan vamgan force-pushed the feat/mcp-client-retry-mechanism branch from 96fe37d to ea61f40 Compare November 22, 2025 00:27
@github-actions github-actions bot added size/l and removed size/l labels Nov 22, 2025
Add a configurable retry mechanism with multiple strategies to handle
transient failures in MCP tool calls. Implementation uses the tenacity
library for battle-tested retry functionality.

Features:
- Multiple retry strategies: NoRetry, ExponentialBackoff, LinearBackoff, Custom
- Global and per-tool retry configuration
- Retry metadata tracking for observability
- Built on tenacity library for reliability

Changes:
- Add tenacity as a dependency in pyproject.toml
- Implement MCPRetryStrategy classes wrapping tenacity's AsyncRetrying
- Add retry configuration support to MCPClient
- Comprehensive test coverage for all retry strategies
@vamgan vamgan force-pushed the feat/mcp-client-retry-mechanism branch from ea61f40 to 2b55adc Compare November 22, 2025 00:36
@github-actions github-actions bot added size/l and removed size/l labels Nov 22, 2025
@vamgan vamgan requested a review from afarntrog November 22, 2025 00:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants