Skip to content

Conversation

@jlowin
Copy link
Owner

@jlowin jlowin commented Jan 13, 2026

Adds file size enforcement via loq to help keep files manageable. Currently runs in pre-commit but doesn't block - just shows violations with a friendly reminder.

Also removes ~100 unused # type: ignore comments that were left over after mcp library type improvements.

loq config highlights:

  • 1000 line default (was 500)
  • tests/** pattern for test files
  • Explicit rules only for files exceeding 1000 lines
  • Non-blocking in CI (shows violations but passes)
loq (file size limits)...................................................Passed
  ✖  1_070 > 1_066  tests/server/middleware/test_middleware.py
  1 violation (68ms)
  
  loq violations not enforced... yet!

Reduces function_tool.py from 595 to 413 lines, bringing it under the 500-line limit.
Adds loq to pre-commit hooks to track file sizes. Currently
informational only - violations are shown but don't block commits.
ty and mcp library updates resolved the underlying type issues,
making these suppression comments unnecessary.
@marvin-context-protocol marvin-context-protocol bot added enhancement Improvement to existing functionality. For issues and smaller PR improvements. tests labels Jan 13, 2026
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 13, 2026

Warning

Rate limit exceeded

@jlowin has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 27 minutes and 12 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between 84a43da and 94219c6.

⛔ Files ignored due to path filters (22)
  • .pre-commit-config.yaml is excluded by none and included by none
  • loq.toml is excluded by none and included by none
  • tests/cli/test_mcp_server_config_integration.py is excluded by none and included by none
  • tests/client/test_notifications.py is excluded by none and included by none
  • tests/prompts/test_standalone_decorator.py is excluded by none and included by none
  • tests/resources/test_resources.py is excluded by none and included by none
  • tests/server/auth/test_jwt_provider.py is excluded by none and included by none
  • tests/server/http/test_bearer_auth_backend.py is excluded by none and included by none
  • tests/server/middleware/test_middleware.py is excluded by none and included by none
  • tests/server/providers/proxy/test_proxy_client.py is excluded by none and included by none
  • tests/server/providers/proxy/test_proxy_server.py is excluded by none and included by none
  • tests/server/providers/test_local_provider_prompts.py is excluded by none and included by none
  • tests/server/providers/test_local_provider_resources.py is excluded by none and included by none
  • tests/server/tasks/test_task_dependencies.py is excluded by none and included by none
  • tests/server/tasks/test_task_meta_parameter.py is excluded by none and included by none
  • tests/server/test_context.py is excluded by none and included by none
  • tests/tools/test_standalone_decorator.py is excluded by none and included by none
  • tests/tools/test_tool.py is excluded by none and included by none
  • tests/utilities/openapi/test_models.py is excluded by none and included by none
  • tests/utilities/openapi/test_nullable_fields.py is excluded by none and included by none
  • tests/utilities/test_types.py is excluded by none and included by none
  • uv.lock is excluded by !**/*.lock and included by none
📒 Files selected for processing (27)
  • src/fastmcp/client/client.py
  • src/fastmcp/client/sampling/handlers/anthropic.py
  • src/fastmcp/client/sampling/handlers/openai.py
  • src/fastmcp/client/tasks.py
  • src/fastmcp/client/transports.py
  • src/fastmcp/prompts/function_prompt.py
  • src/fastmcp/resources/function_resource.py
  • src/fastmcp/resources/template.py
  • src/fastmcp/server/auth/oauth_proxy.py
  • src/fastmcp/server/auth/providers/jwt.py
  • src/fastmcp/server/context.py
  • src/fastmcp/server/dependencies.py
  • src/fastmcp/server/elicitation.py
  • src/fastmcp/server/http.py
  • src/fastmcp/server/lifespan.py
  • src/fastmcp/server/providers/proxy.py
  • src/fastmcp/server/sampling/sampling_tool.py
  • src/fastmcp/server/server.py
  • src/fastmcp/server/tasks/handlers.py
  • src/fastmcp/server/tasks/subscriptions.py
  • src/fastmcp/tools/function_parsing.py
  • src/fastmcp/tools/function_tool.py
  • src/fastmcp/tools/tool_transform.py
  • src/fastmcp/utilities/json_schema_type.py
  • src/fastmcp/utilities/mcp_server_config/v1/mcp_server_config.py
  • src/fastmcp/utilities/openapi/parser.py
  • src/fastmcp/utilities/types.py

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 54c1f3adc0

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

- id: loq
name: loq (file size limits)
entry: uv run loq
entry: bash -c 'uv run loq || printf "\nloq violations not enforced... yet!\n"'

Choose a reason for hiding this comment

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

P2 Badge Avoid bash-only pre-commit hook

The loq hook now runs bash -c ..., which requires a bash executable to be present. On Windows environments without Git Bash/WSL in PATH (a common default), pre-commit will fail with “executable bash not found” and block commits, whereas the previous uv run loq entry was cross‑platform. If you want a non‑blocking loq check, it needs a portable entry point (e.g., a small Python shim) rather than a bash shell dependency.

Useful? React with 👍 / 👎.

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

Labels

enhancement Improvement to existing functionality. For issues and smaller PR improvements. tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants