Skip to content

Audit [[tool.mypy.overrides]] blocks after #256 — tighten call-arg exclusions where possible #257

@Kamilbenkirane

Description

@Kamilbenkirane

Context

Follow-up to #256, which fixed the missing total=False on the five modality Parameters TypedDict subclasses.

Before #256, [[tool.mypy.overrides]] blocks in pyproject.toml (lines 167-185) disabled call-arg (among other error codes) on many internal modules. Many of those exclusions may have been added specifically to silence the Missing named argument noise produced by the TextParameters / ImageParameters / ... bug. Now that the root cause is fixed, some call-arg exclusions may be safe to remove.

Current override surface

All entries in [[tool.mypy.overrides]] currently disable the same set: override, return-value, arg-type, call-arg, assignment, no-any-return, attr-defined (some add unused-ignore).

Modules covered:

  • tests.*
  • celeste.modalities.text.client
  • celeste.modalities.text.streaming
  • celeste.modalities.text.providers.*
  • celeste.modalities.images.client
  • celeste.modalities.images.streaming
  • celeste.modalities.images.providers.*
  • celeste.modalities.videos.client
  • celeste.modalities.videos.providers.*
  • celeste.modalities.audio.client
  • celeste.modalities.audio.streaming
  • celeste.modalities.audio.providers.*
  • celeste.modalities.embeddings.client
  • celeste.modalities.embeddings.providers.*
  • celeste.providers.*.client
  • celeste.providers.*.*
  • celeste.namespaces.domains

Static audit from the #256 session

A static audit done during the #256 investigation concluded that most call-arg exclusions are likely still needed because **Unpack[*Parameters] propagates through multiple dispatch levels (namespace → client → provider), each of which mypy re-checks for call compatibility. The fix only removes the "required field" problem, not the unpacking verification.

However, this conclusion is unverified. It is based on reading code paths, not on running mypy with an override removed.

Task

Runtime-verify each call-arg exclusion. For each override entry:

  1. Remove call-arg from disable_error_code.
  2. Run make typecheck.
  3. If mypy still passes, keep the removal and move on. If it fails, restore call-arg and note the remaining failures for a possible follow-up.

Suggested starting point: tests.*. Tests only call the public API (celeste.text.generate, etc.), which after #256 should type-check cleanly under strict mypy without needing call-arg silenced. If tests.* can drop call-arg, that is the easiest win and validates the approach.

Acceptance

  • PR removing one or more call-arg exclusions that runtime-verify clean under make typecheck.
  • Any exclusions that cannot be removed are documented with the residual error(s) in a code comment next to the override block, so future audits know why.

Out of scope

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions