Repository navigation
Type-check optional SDK code in CI and allow missing extras locally - #484
Merged
Merged
Conversation
donovanr
marked this pull request as ready for review
October 15, 2026 22:47
gregorybchris
approved these changes
Oct 16, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
CI ran
ty checkwithout theclients,litellm, andagentsextras, so ty saw their imports as unresolved and type errors in code that uses them never reached CI. Locally, with those extras installed, the pre-commit hook failed on two kinds of diagnostics:unused-type-ignore-commenton the inline# type: ignore[ty:unresolved-import]comments, which are only needed when the package is missinginvalid-method-overrideonLiteLLMProvider.get_openai_clientThis PR makes ty pass whether or not the extras are installed, and makes CI check against them.
Changes
agents.**andlitellm.**toallowed-unresolved-imports.openai.**andswerex.**were already listed. ty uses the real types when a package is installed and stays quiet when it isn't.type: ignore[ty:unresolved-import]comments onagents,litellm, andswereximports. The allowlist covers them.--extra clients --extra litellm --extra agentsin the CI type-check step, so CI is the strictest check. The pre-commit hook,make type-check, andscripts/verify.share unchanged.LiteLLMProvider.get_openai_clientraisesNotImplementedErrorwithout abase_urlinstead of returningNone, matching the base class contract. The test is updated to match.FileSpanExportersubclassesTracingExporter, whichBatchTraceProcessorrequires.suppress_debug_infoassignment and the vLLMConverter.tool_to_openaimonkeypatch go through anAny-typed local. Both write to third-party attributes that ty types too narrowly.No task specs, suites, or scores are affected.
Type of Change
Validation
All run on macOS.
uv run ruff check src/ tests/anduv run ruff format --check src/ tests/uv run ty check src/uv run pytest tests/ --ignore=tests/integration -v