oterm/.pre-commit-config.yaml
Yiorgis Gozadinos d077f671f1
Qualify MCP tool names by server
Tool identity was the bare tool name, so a name exported by two MCP
servers resolved to both toolsets and pydantic-ai rejected the agent.
MCP tools are now identified as `{server}_{tool}` and reach the model
through PrefixedToolset, making per-server selection independent.

Since the server name now reaches the provider, reject names outside
[a-zA-Z0-9_-] when the config loads and skip tools whose qualified name
is over 64 characters.

Tools load before the store so the 0.22.0 upgrade can qualify saved
selections from the connected servers' tool lists.

Point the ty pre-commit hook at the pinned version, matching CI and the
ruff hooks.

Closes #321
2026-07-31 15:46:30 +03:00

40 lines
1.1 KiB
YAML

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v6.0.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-merge-conflict
- id: check-toml
- id: debug-statements
- repo: local
hooks:
- id: ruff
name: ruff check
entry: uv run ruff check --fix
language: system
types: [python]
- id: ruff-format
name: ruff format
entry: uv run ruff format
language: system
types: [python]
- repo: local
hooks:
- id: ty
name: ty check
entry: uv run ty check
language: system
types: [python]
pass_filenames: false
# - repo: https://github.com/RodrigoGonzalez/check-mkdocs
# rev: v1.2.0
# hooks:
# - id: check-mkdocs
# name: check-mkdocs
# args: ["--config", "mkdocs.yml"] # Optional, mkdocs.yml is the default
# # If you have additional plugins or libraries that are not included in
# # check-mkdocs, add them here
# additional_dependencies: ["mkdocs-material"]