Skip to content

Part of #1133: clear 8 side-finding mypy errors#1210

Merged
axisrow merged 2 commits into
mainfrom
chore/1133-mypy-sidefindings
Jun 30, 2026
Merged

Part of #1133: clear 8 side-finding mypy errors#1210
axisrow merged 2 commits into
mainfrom
chore/1133-mypy-sidefindings

Conversation

@axisrow

@axisrow axisrow commented Jun 30, 2026

Copy link
Copy Markdown
Owner

Part of #1133

What changed

Cleans 8 mypy errors surfaced by Codex as side-findings during review of #1208/#1209. Each fixed by its own pattern (assert / explicit guard / TYPE_CHECKING self-typing / type narrowing). No runtime behavior change.

  • production_limits_service.py:244 — assert self._db (union-attr)
  • cli/commands/test.py:1195 — explicit RuntimeError guard for state.copy_db (union-attr, CLI path)
  • web/settings/handlers.py:906 — assert service after guard contract (union-attr)
  • web/photo_loader/handlers.py:293 — explicit None-guard redirect for target (union-attr)
  • provider_model_compatibility.py:63 + provider_model_cache.py:76 — TYPE_CHECKING self: ProviderConfigService (attr-defined mixin pattern, same as Part of #1133: annotate collector mixin self types #1209)
  • pool_lifecycle.py:185 — narrowed clients dict value type for raw_client access (attr-defined)
  • bootstrap.py:272 — explicit Collector | SnapshotCollector union annotation (attr-defined, not a bug — SnapshotCollector.refresh exists)

Mypy delta

Metric Before After Delta
mypy src/ total 384 365 -19
arg-type 108 107 -1
attr-defined 86 82 -4
union-attr 57 44 -13
assignment 25 21 -4

No error type increased.

Validation

  • python -m mypy src/
  • ruff check src/ — clean
  • python -c "import src.services.agent_provider_service; import src.telegram.pool_lifecycle; import src.web.bootstrap" — no ImportError

Note: opened by orchestrator — worker session 21 crashed with turn/start failed in TUI after completing the edits but before committing; work was committed/pushed from its worktree.

Part of #1133. Does NOT touch #1207 (arg-type Protocol, separate).

axisrow and others added 2 commits June 30, 2026 16:52
Part of #1133. Cleans 8 mypy errors surfaced by Codex as side-findings
during review of #1208/#1209. No runtime behavior change.

Net mypy src/: 384 -> 365 (-19). No error type increased:
  arg-type 108->107, attr-defined 86->82, union-attr 57->44,
  assignment 25->21, return-value 25->25.

Files: production_limits_service, cli/test, web/settings+photo_loader
handlers, provider_model_compatibility+cache (TYPE_CHECKING self-typed),
pool_lifecycle (clients value type), bootstrap (collector union type).

Co-Authored-By: Claude <noreply@anthropic.com>
@axisrow axisrow merged commit 49cdaa3 into main Jun 30, 2026
4 checks passed
@axisrow axisrow deleted the chore/1133-mypy-sidefindings branch June 30, 2026 12:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant