Skip to content

fix: drop call-arg exclusion from internal modality/provider mypy overrides#258

Merged
Kamilbenkirane merged 1 commit intomainfrom
fix/audit-mypy-call-arg
Apr 10, 2026
Merged

fix: drop call-arg exclusion from internal modality/provider mypy overrides#258
Kamilbenkirane merged 1 commit intomainfrom
fix/audit-mypy-call-arg

Conversation

@Kamilbenkirane
Copy link
Copy Markdown
Member

Summary

Removes call-arg from the big internal [[tool.mypy.overrides]] block (the one covering modalities.*.client / streaming / providers, providers.*, namespaces.domains). After #256 fixed the missing total=False on modality Parameters TypedDicts, this exclusion was no longer needed for the Unpack[*Parameters] pattern that originally motivated it.

Closes #257.

What removing the exclusion exposed

Exactly one previously-hidden real bug, and zero noise:

src/celeste/modalities/images/providers/google/client.py:37: error: Missing named argument "base_url" for "GeminiImagesClient"  [call-arg]
src/celeste/modalities/images/providers/google/client.py:37: error: Missing named argument "base_url" for "ImagenImagesClient"  [call-arg]

GoogleImagesClient.model_post_init() constructs the strategy client (GeminiImagesClient or ImagenImagesClient) but did not forward self.base_url. The wrapper would honor a custom base_url from its caller, but the strategy would silently default to None — a real propagation bug. Fixed by passing base_url=self.base_url at the call site.

What is NOT in scope

  • tests.* override — keeping call-arg disabled. Removing it surfaces 39 errors in test files that construct provider clients (GoogleTextClient, etc.) without base_url=. Test ergonomics over strict construction kwargs is a deliberate choice; this PR leaves it alone.
  • Other disabled codesoverride, return-value, arg-type, assignment, no-any-return, attr-defined are kept on the internal block. They cover unrelated provider-mixin / multiple-inheritance typing patterns and predate fix: add total=False to modality Parameters TypedDicts #256.

Test plan

  • make lint — clean
  • make format — clean
  • make typecheckSuccess: no issues found in 331 source files + 63 source files
  • make security — bandit clean
  • make test586 passed, 82.29% coverage (≥80% threshold)
  • make ci — full pipeline green
  • pre-commit + pre-push hooks all passed

…rrides

After #256 fixed total=False on the modality Parameters TypedDicts, the
call-arg exclusion in the big internal [[tool.mypy.overrides]] block
(modalities.*.client / streaming / providers, providers.*, namespaces.domains)
is no longer needed for the Unpack[*Parameters] pattern that originally
required it.

Removing it surfaced one previously-hidden real bug:
GoogleImagesClient.model_post_init() forgot to forward self.base_url
to the strategy client constructor (Gemini/Imagen). The wrapper would
honor a custom base_url, but the strategy would silently default to None.
Pass base_url=self.base_url at the call site.

Also tightens the override surface: 6 disabled error codes instead of 7
on the same module list. The remaining codes (override, return-value,
arg-type, assignment, no-any-return, attr-defined) cover the
provider-mixin / multiple-inheritance typing patterns and are unrelated
to #256.

The tests.* override keeps call-arg disabled — 39 test files still
construct provider clients without explicit base_url= and this PR
intentionally leaves test ergonomics alone.

Closes #257
@Kamilbenkirane Kamilbenkirane merged commit 762ce50 into main Apr 10, 2026
11 checks passed
@claude
Copy link
Copy Markdown

claude bot commented Apr 10, 2026

Code review

No issues found. Checked for bugs and CLAUDE.md compliance.

@mbakkali
Copy link
Copy Markdown

well done kamil that was a use pain point for us

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.

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

2 participants