eemario commented on code in PR #1422:
URL: https://github.com/apache/flink-agents/pull/1422#discussion_r4640181044
##########
python/flink_agents/integrations/mcp/mcp.py:
##########
@@ -164,13 +166,23 @@ class MCPServer(Resource, ABC):
# HTTP connection parameters
endpoint: str
headers: Dict[str, Any] | None = None
- timeout: int = 30
- sse_read_timeout: int = 60 * 5
+ timeout: timedelta = timedelta(seconds=30)
+ sse_read_timeout: timedelta = timedelta(minutes=5)
auth: httpx.Auth | None = None
session: ClientSession = Field(default=None, exclude=True)
connection_context: AsyncExitStack = Field(default=None, exclude=True)
+ @field_validator("timeout", "sse_read_timeout", mode="before")
+ @classmethod
+ def validate_timeout(cls, value: Any) -> timedelta:
+ """Parse a positive MCP timeout."""
+ duration = parse_duration(value)
Review Comment:
Thanks for catching this! Updated it to timedelta(seconds=1) to preserve the
original test intent.
--
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]