Repository navigation
Conversation
Pyright reported two reportOptionalMemberAccess errors in atomic_agents/observability/__init__.py: uninstrument() and is_instrumented_by_opentelemetry called _load_tracing_module(), whose return type includes None, after guards that already exclude that case. Split the import out of the version-guarded loader so the guarded call sites use the import that cannot return None. Runtime behavior is unchanged: pyright on the package reports 0 errors, the 57 observability tests and the full core suite (659 passed, 3 skipped) are green. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Owner
Author
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.
What
Pyright reported two
reportOptionalMemberAccesserrors inatomic_agents/observability/__init__.py.uninstrument()andis_instrumented_by_opentelemetrycalled_load_tracing_module(), whose return type includesNone, right after guards that already rule that case out.The fix splits the plain import out of the version-guarded loader. The guarded call sites now use
_import_tracing_module(), which can't returnNone. Both functions carry explicit return types.Why
Shipping a package that fails pyright in its own public module is a bad look for a framework that sells type safety, and Contractify is about to wire this exact class into a pyright-strict codebase. Runtime behavior is unchanged.
Verification
uv run pyright atomic-agents/atomic_agents/observability: 0 errors (was 2)uv run pytest atomic-agents/tests/observability: 57 passeduv run pytest --cov=atomic_agents atomic-agents: 659 passed, 3 skipped🤖 Generated with Claude Code