Pr0Beginner opened a new pull request, #1474:
URL: https://github.com/apache/flink-agents/pull/1474

   ### Purpose of change
   
   **Problem:**
   Remote calls in the Python `MCPServer` (`call_tool_async`, `list_tools`, 
`list_prompts`, `get_prompt`) do not retry on transient failures (network 
timeouts, connection resets, HTTP 429/503), whereas the Java `MCPServer` 
already supports exponential backoff retries.
   
   **Solution:**
   - Added `max_retries` (default `3`), `initial_backoff` (default `100 ms`), 
and `max_backoff` (default `10 s`) to Python `MCPServer` with duration parsing 
and validation matching Java.
   - Added async binary exponential backoff with full jitter 
(`_execute_with_retry`) and transient-error classification (including `httpx` 
network/timeout errors, HTTP 429/503, timeout `McpError`, and `anyio` 
`ExceptionGroup`), while failing fast on non-retryable and protocol tool errors 
(`isError=True`).
   - Added unit tests in `test_mcp.py` (52 passed), aligned 
`test_mcp_resource_discovery.py`, and updated 
`docs/content/docs/development/calling-llms/mcp.md`.
   
   ### Documentation
   
   - [ ] `doc-needed`
   - [ ] `doc-not-needed`
   - [x] `doc-included`
   
   ### Was this patch authored or co-authored using generative AI tooling?
   
   - [x] Yes
   - [ ] No
   
   Generated-by: Antigravity (Gemini)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to