chore: repo-root mirrors-mypy pre-commit is broken on main #10

Closed
opened 2026-05-26 05:23:08 +00:00 by coilysiren · 1 comment
Owner

Problem

The repo-root pre-commit run mypy hook (mirrors-mypy v1.20.0 in .pre-commit-config.yaml) fails with 64 type errors on main (3a5ec43). The hook's additional_dependencies only ship opentelemetry + types-pyyaml. It cannot resolve fastapi/starlette/pytest decorator types or per-package src layouts, so [untyped-decorator] and similar errors fire across the channels router, luca peer, and tests.

By contrast, make lint (per-package uv run mypy invocations) is green - that uses each member-package's own resolved env.

Symptoms (on bare HEAD)

$ pre-commit run mypy --all-files
core/tests/test_agent.py:15: error: Untyped decorator makes function "agent_b" untyped  [untyped-decorator]
... 63 more

Fix options

  1. Remove mirrors-mypy from .pre-commit-config.yaml entirely - rely on make lint / coily exec lint to gate types. The pre-commit hook is misleading because it can't see per-package deps anyway.
  2. Convert the hook to language: system and invoke per-package mypy (similar to how the audit-precommit-coverage rollout is moving local python hooks).
  3. Add every transitive dep to additional_dependencies (fragile, drifts).

Caught while landing coilysiren/otel-a2a-relay#135 - SKIPped mypy for that commit. Tracking here so the gate isn't silently broken forever.


Ported from coilysiren/otel-a2a-relay#138.

**Problem** The repo-root `pre-commit run mypy` hook (mirrors-mypy v1.20.0 in `.pre-commit-config.yaml`) fails with 64 type errors on `main` (3a5ec43). The hook's `additional_dependencies` only ship opentelemetry + types-pyyaml. It cannot resolve fastapi/starlette/pytest decorator types or per-package src layouts, so `[untyped-decorator]` and similar errors fire across the channels router, luca peer, and tests. By contrast, `make lint` (per-package `uv run mypy` invocations) is green - that uses each member-package's own resolved env. **Symptoms (on bare HEAD)** ``` $ pre-commit run mypy --all-files core/tests/test_agent.py:15: error: Untyped decorator makes function "agent_b" untyped [untyped-decorator] ... 63 more ``` **Fix options** 1. Remove `mirrors-mypy` from `.pre-commit-config.yaml` entirely - rely on `make lint` / `coily exec lint` to gate types. The pre-commit hook is misleading because it can't see per-package deps anyway. 2. Convert the hook to `language: system` and invoke per-package mypy (similar to how the audit-precommit-coverage rollout is moving local python hooks). 3. Add every transitive dep to `additional_dependencies` (fragile, drifts). Caught while landing coilysiren/otel-a2a-relay#135 - SKIPped mypy for that commit. Tracking here so the gate isn't silently broken forever. --- _Ported from coilysiren/otel-a2a-relay#138._
Author
Owner

Backlog burndown 2026-06-17: closing low-priority (P3/P4) to bring the open count to a manageable level. Nothing lost — reopen if this resurfaces. Batch tag: burndown-2026-06.

Backlog burndown 2026-06-17: closing low-priority (P3/P4) to bring the open count to a manageable level. Nothing lost — reopen if this resurfaces. Batch tag: `burndown-2026-06`.
coilysiren 2026-06-17 08:23:57 +00:00
Commenting is not possible because the repository is archived.
No description provided.