Skip to content

Pin pydantic-monty<0.0.8 to fix code mode#3497

Merged
jlowin merged 1 commit intorelease/3.1.1from
pin-monty-0.0.7
Mar 14, 2026
Merged

Pin pydantic-monty<0.0.8 to fix code mode#3497
jlowin merged 1 commit intorelease/3.1.1from
pin-monty-0.0.7

Conversation

@jlowin
Copy link
Copy Markdown
Member

@jlowin jlowin commented Mar 14, 2026

Monty 0.0.8 removed the external_functions parameter from the Monty constructor, which breaks code mode. This pins the dependency to <0.0.8 for the patch release so existing users aren't broken on install.

The forward-looking fix (adapting to 0.0.8's new API) is already on main via #3468.

See also #3463

@jlowin jlowin merged commit 53dab03 into release/3.1.1 Mar 14, 2026
6 of 8 checks passed
@jlowin jlowin deleted the pin-monty-0.0.7 branch March 14, 2026 19:09
@marvin-context-protocol marvin-context-protocol Bot added bug Something isn't working. Reports of errors, unexpected behavior, or broken functionality. dependencies Updates to project dependencies. Automatically applied to dependabot PRs. labels Mar 14, 2026
@marvin-context-protocol
Copy link
Copy Markdown
Contributor

Test Failure Analysis

Summary: Two unrelated pre-existing test failures were triggered in CI — a JWT expiration race condition on Windows and subprocess-spawning tests timing out with lowest-direct dependencies. Neither failure is caused by this PR's changes (which only pin pydantic-monty<0.0.8).


Failure 1: Windows — test_verify_token_validates_expiration

Root Cause: The test creates a JWT with expires_in=1 second, then immediately calls verify_token expecting it to be valid. On slow Windows CI runners, the token expires before the "immediate" verification runs — the token is issued at exp=1773515519 and the Token expired debug log fires at the same second, indicating the 1-second window is too tight for Windows CI.

Suggested Solution: Increase expires_in from 1 to something like 3 in the test, and adjust the time.sleep to match (e.g. time.sleep(3.1)). This gives more room on slow runners while still testing expiration.

  • File: tests/server/auth/test_jwt_issuer.py:167-179

Failure 2: Lowest-direct dependencies — test_multi_client_lifespan + test_multi_client_force_close

Root Cause: Both tests are decorated with @pytest.mark.timeout(5) on this branch, but they spawn two subprocess MCP servers which takes longer than 5s on slow CI with minimum dependency versions. These tests are already fixed on main — the timeout has been bumped to @pytest.mark.timeout(15) there.

Suggested Solution: Since this is a patch branch that diverged before the timeout fix, this failure is moot as the PR has merged.

  • File: tests/test_mcp_config.py (lines ~358, ~418)
Detailed Analysis

Windows failure log excerpt:

DEBUG    Issued access token for client=client-abc jti=token-id exp=1773515519
[03/14/26 19:11:59] DEBUG    Token expired
E               authlib.jose.errors.JoseError: Token has expired:
src\fastmcp\server\auth\jwt_issuer.py:227: JoseError

The token expires at the exact second it is being verified — the expires_in=1 window is too short for the Windows CI runner.

Lowest-direct dependencies failure log excerpt:

@pytest.mark.timeout(5)
async def test_multi_client_lifespan(tmp_path: Path):
    ...
E       Failed: Timeout (>5.0s) from pytest-timeout.
tests/test_mcp_config.py:58: Failed

And similarly for test_multi_client_force_close (line 447). Both tests spawn two subprocesses. On the current main, the marker has been updated to @pytest.mark.timeout(15), which resolves this.

Related Files
  • tests/server/auth/test_jwt_issuer.py — JWT issuer test with flaky 1-second expiry window
  • tests/test_mcp_config.py — Multi-client lifecycle tests with subprocess-based MCP servers; timeout was 5s on this branch, 15s on main
  • src/fastmcp/server/auth/jwt_issuer.pyverify_token raises JoseError when exp < time.time()

🤖 Generated with Claude Code

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

Labels

bug Something isn't working. Reports of errors, unexpected behavior, or broken functionality. dependencies Updates to project dependencies. Automatically applied to dependabot PRs.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant