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

Open
opened 2026-05-26 05:23:08 +00:00 by coilysiren · 0 comments
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._
coilysiren added
P3
and removed
P2
labels 2026-05-31 07:01:06 +00:00
Sign in to join this conversation.
No labels
P0
P1
P2
P3
P4
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
coilyco-flight-deck/otel-a2a-relay#10
No description provided.