Skip to content

fix(core): honor int client_session_timeout_seconds default - #92

Open
syf2211 wants to merge 1 commit into
grll:mainfrom
syf2211:fix/client-session-timeout-int
Open

syf2211 wants to merge 1 commit into
grll:mainfrom
syf2211:fix/client-session-timeout-int

Conversation

@syf2211

@syf2211 syf2211 commented Sep 24, 2026

Copy link
Copy Markdown

Summary

Treat integer second counts (including the default 5) as valid client_session_timeout_seconds values when constructing MCP ClientSession timeouts.

Motivation

Fixes #91. The default timeout is the integer 5, but mcptools only converted float and timedelta values. With the default argument, timeout stayed None, so the documented 5-second session timeout was never applied.

Changes

  • Accept int and float second counts (excluding bool) when building the timedelta passed to ClientSession.
  • Extend type hints on mcptools and MCPAdapt.__init__.
  • Add a mocked regression test covering explicit 5 and the default path.

Tests

  • python3 -m pytest tests/test_core.py::test_mcptools_converts_int_client_session_timeout tests/test_core.py::test_client_session_timeout_parameter_propagation -q → 2 passed

Notes

Minimal behavior change; existing float, timedelta, and None handling is unchanged.

Fixes grll#91. Treat integer second counts like the default 5 when building
ClientSession timeouts, and add regression coverage.

This branch has not been deployed

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

client_session_timeout_seconds defaults to int, but only float and timedelta are handled

1 participant