Skip to content

Conversation

rm-openai
Copy link
Collaborator

Summary

  • allow configuring retries with exponential backoff when listing tools or calling a tool on an MCP server via max_retry_attempts (supporting -1 for unlimited retries) and retry_backoff_seconds_base
  • propagate the retry parameters through the stdio, SSE, and streamable HTTP server implementations so callers can tune retries when constructing these servers
  • test that call_tool and list_tools retry appropriately

Testing

  • make lint
  • make mypy
  • make test (fails: No rule to make target 'test')
  • make tests
  • make old_version_tests (fails: Request failed after 3 retries (tunnel error))

https://chatgpt.com/codex/tasks/task_i_68a73cab8b9c8321876f6f3dd1dfcd20

Copy link

@brandonbaker-openai brandonbaker-openai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two super nits, feel free to ignore - thanks!

if not self.session:
raise UserError("Server not initialized. Make sure you call `connect()` first.")
session = self.session
assert session is not None

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

super nit: Feels silly to assert is not None right below the early exception on if not self.session

if not self.session:
raise UserError("Server not initialized. Make sure you call `connect()` first.")
session = self.session
assert session is not None

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same super nit

@rm-openai rm-openai merged commit 2c5041d into main Aug 21, 2025
6 checks passed
@rm-openai rm-openai deleted the codex/add-retry-and-backoff-configuration-to-call_tool branch August 21, 2025 21:02
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.

3 participants