chore: add pyrightconfig.json and fix all pyright errors#448
Conversation
Add pyright configuration with standard mode and suppressed noise rules (unknown types from Pydantic/structlog/pytest). Fix all 17 actionable pyright findings: - middleware: pyright-specific ignore for ASGI send() type mismatch - loader: use getattr for YAMLError.problem_mark (no type stubs) - mem0 adapter: pyright ignore for _client attr assignment - org/store: initialize escaped variable before conditional use - presets: extract validation loop into function to avoid unbound vars - mcp/__init__: add TYPE_CHECKING imports for lazy-loaded symbols - docker_sandbox: explicit aiodocker.containers import + pyright ignores - test_factory: initialize side_effect with None + assert narrowing
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.Scanned FilesNone |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (3)
📜 Recent review details⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
🧰 Additional context used📓 Path-based instructions (3)**/*.py📄 CodeRabbit inference engine (CLAUDE.md)
Files:
src/synthorg/**/*.py📄 CodeRabbit inference engine (CLAUDE.md)
Files:
tests/**/*.py📄 CodeRabbit inference engine (CLAUDE.md)
Files:
🧠 Learnings (5)📚 Learning: 2026-03-15T11:48:14.867ZApplied to files:
📚 Learning: 2026-03-15T12:05:56.884ZApplied to files:
📚 Learning: 2026-03-15T11:48:14.867ZApplied to files:
📚 Learning: 2026-03-15T12:05:56.884ZApplied to files:
📚 Learning: 2026-03-15T12:05:56.884ZApplied to files:
🔇 Additional comments (4)
📝 WalkthroughSummary by CodeRabbit
WalkthroughAdds Pyright configuration and multiple small, safety/type-checking changes: type-ignore annotations, type-only imports, safer YAML error handling, SQL LIKE escaping, import-time preset validation refactor, a new observability constant, and a minor test type-narrowing adjustment. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes 🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
✨ Simplify code
📝 Coding Plan
Comment |
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request integrates Pyright as a complementary type checker to the existing MyPy setup. It establishes a Highlights
Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request introduces a pyrightconfig.json to improve the developer experience by enabling pyright as an in-editor type checker, while keeping mypy as the authoritative checker for CI. The changes also include fixes for all actionable errors reported by pyright, which improves overall code quality and type safety. My review found one issue in the new configuration file regarding the specified Python version. The rest of the changes are solid improvements.
| { | ||
| "include": ["src/", "tests/"], | ||
| "exclude": [".venv/", "build/", "dist/", ".pytest_cache/", ".hypothesis/"], | ||
| "pythonVersion": "3.14", |
There was a problem hiding this comment.
The pythonVersion is set to "3.14", which is not a released or planned version of Python. This could lead to unexpected behavior from pyright as it might not interpret this version correctly. It's recommended to use the actual Python version the project is targeting, for example "3.12" or "3.13", to ensure accurate type checking based on a real language version.
| "pythonVersion": "3.14", | |
| "pythonVersion": "3.13", |
Greptile SummaryThis PR introduces Key changes:
Confidence Score: 4/5
Important Files Changed
Prompt To Fix All With AIThis is a comment left during a code review.
Path: tests/unit/memory/test_factory.py
Line: 100
Comment:
**Misleading "always fails" comment**
The comment says `# always fails` on an `assert` statement, which typically means the assertion would raise `AssertionError` and the test would fail. The opposite is true: `_Dummy(x="not-an-int")` *always* raises `ValidationError`, so `side_effect` is always set and this assertion *always passes*. Consider rewording to avoid confusion for future readers.
```suggestion
assert side_effect is not None # always set — narrows type for pyright
```
How can I resolve this? If you propose a fix, please make it concise.
---
This is a comment left during a code review.
Path: pyrightconfig.json
Line: 12
Comment:
**`reportCallIssue: false` is broad**
`reportCallIssue` covers any error related to calling a non-callable or passing arguments to a call expression — it's not limited to Pydantic-dynamic patterns. Disabling it globally could silently hide real call-site bugs in non-Pydantic code throughout `src/` and `tests/`. The PR description justifies the other `reportUnknown*` suppressions as Pydantic noise, but `reportCallIssue` is harder to attribute purely to Pydantic. Consider using per-file or per-line `# pyright: ignore[reportCallIssue]` ignores at the handful of actual offending sites, or at minimum document here why this global suppression is safe.
How can I resolve this? If you propose a fix, please make it concise.Last reviewed commit: 38d1ca2 |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #448 +/- ##
=======================================
Coverage 93.67% 93.67%
=======================================
Files 469 469
Lines 22213 22219 +6
Branches 2144 2143 -1
=======================================
+ Hits 20808 20814 +6
- Misses 1094 1095 +1
+ Partials 311 310 -1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
tests/unit/memory/test_factory.py
Outdated
| except ValidationError as ve: | ||
| side_effect: ValidationError = ve | ||
| side_effect = ve | ||
| assert side_effect is not None # always fails, narrows type for pyright |
There was a problem hiding this comment.
Misleading "always fails" comment
The comment says # always fails on an assert statement, which typically means the assertion would raise AssertionError and the test would fail. The opposite is true: _Dummy(x="not-an-int") always raises ValidationError, so side_effect is always set and this assertion always passes. Consider rewording to avoid confusion for future readers.
| assert side_effect is not None # always fails, narrows type for pyright | |
| assert side_effect is not None # always set — narrows type for pyright |
Prompt To Fix With AI
This is a comment left during a code review.
Path: tests/unit/memory/test_factory.py
Line: 100
Comment:
**Misleading "always fails" comment**
The comment says `# always fails` on an `assert` statement, which typically means the assertion would raise `AssertionError` and the test would fail. The opposite is true: `_Dummy(x="not-an-int")` *always* raises `ValidationError`, so `side_effect` is always set and this assertion *always passes*. Consider rewording to avoid confusion for future readers.
```suggestion
assert side_effect is not None # always set — narrows type for pyright
```
How can I resolve this? If you propose a fix, please make it concise.| "reportUnknownMemberType": false, | ||
| "reportUnknownVariableType": false, | ||
| "reportUnknownParameterType": false, | ||
| "reportUnknownLambdaType": false, |
There was a problem hiding this comment.
reportCallIssue: false is broad
reportCallIssue covers any error related to calling a non-callable or passing arguments to a call expression — it's not limited to Pydantic-dynamic patterns. Disabling it globally could silently hide real call-site bugs in non-Pydantic code throughout src/ and tests/. The PR description justifies the other reportUnknown* suppressions as Pydantic noise, but reportCallIssue is harder to attribute purely to Pydantic. Consider using per-file or per-line # pyright: ignore[reportCallIssue] ignores at the handful of actual offending sites, or at minimum document here why this global suppression is safe.
Prompt To Fix With AI
This is a comment left during a code review.
Path: pyrightconfig.json
Line: 12
Comment:
**`reportCallIssue: false` is broad**
`reportCallIssue` covers any error related to calling a non-callable or passing arguments to a call expression — it's not limited to Pydantic-dynamic patterns. Disabling it globally could silently hide real call-site bugs in non-Pydantic code throughout `src/` and `tests/`. The PR description justifies the other `reportUnknown*` suppressions as Pydantic noise, but `reportCallIssue` is harder to attribute purely to Pydantic. Consider using per-file or per-line `# pyright: ignore[reportCallIssue]` ignores at the handful of actual offending sites, or at minimum document here why this global suppression is safe.
How can I resolve this? If you propose a fix, please make it concise.There was a problem hiding this comment.
Actionable comments posted: 4
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@pyrightconfig.json`:
- Line 13: The pyright config currently disables reportCallIssue by setting
"reportCallIssue": false which silences all call-site type mismatch warnings; to
avoid hiding real issues either re-enable reportCallIssue (set it back to true)
and address any noisy Pydantic/structlog false positives with targeted inline
ignores (use "# pyright: ignore[reportCallIssue]" on the specific functions or
call sites), or keep it disabled for editor ergonomics but add a short
repo-level comment explaining that mypy strict in CI is authoritative and to
revert to per-line ignores if real type errors are observed; reference the
"reportCallIssue" setting in pyrightconfig.json when making this change.
In `@src/synthorg/templates/presets.py`:
- Around line 435-437: The except block handling ValidationError/TypeError when
validating personality presets should log the failure with context before
raising: add a logger.warning or logger.error call (including the preset name
and exception info) inside the except that references the same variables (e.g.,
name, exc, msg) used in the block so observability is preserved before raising
the ValueError in the code path that handles personality preset validation.
- Line 435: Replace the tuple-style exception clause "except (ValidationError,
TypeError) as exc:" with the PEP 758-compliant syntax without parentheses:
"except ValidationError, TypeError as exc:"; update the except line where
ValidationError and TypeError are caught (keeping the exception variable name
exc) so ruff on Python 3.14 accepts it.
In `@tests/unit/memory/test_factory.py`:
- Line 100: The inline comment on the assertion for side_effect is incorrect: it
says "always fails" but the assertion actually always passes because
_Dummy(x="not-an-int") raises ValidationError and assigns side_effect; update or
remove the comment to accurately reflect this (e.g., "always passes, narrows
type for pyright" or simply remove the comment) where side_effect is asserted
after calling _Dummy and handling ValidationError.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: 223a8c5f-8cc3-4ef3-b127-9a9d08fd76ce
📒 Files selected for processing (9)
pyrightconfig.jsonsrc/synthorg/api/middleware.pysrc/synthorg/config/loader.pysrc/synthorg/memory/backends/mem0/adapter.pysrc/synthorg/memory/org/store.pysrc/synthorg/templates/presets.pysrc/synthorg/tools/mcp/__init__.pysrc/synthorg/tools/sandbox/docker_sandbox.pytests/unit/memory/test_factory.py
📜 Review details
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (6)
- GitHub Check: Deploy Preview
- GitHub Check: Test (Python 3.14)
- GitHub Check: Build Web
- GitHub Check: Build Backend
- GitHub Check: Greptile Review
- GitHub Check: Analyze (python)
🧰 Additional context used
📓 Path-based instructions (3)
**/*.py
📄 CodeRabbit inference engine (CLAUDE.md)
**/*.py: Nofrom __future__ import annotations— Python 3.14 has PEP 649 native lazy annotations
Useexcept A, B:syntax (no parentheses) instead ofexcept (A, B):— PEP 758 syntax enforced by ruff on Python 3.14
All public functions must have type hints; mypy strict mode is enforced
Use Google-style docstrings on all public classes and functions (enforced by ruff D rules)
UseNotBlankStrfromcore.typesfor all identifier/name fields (including optional and tuple variants) instead of manual whitespace validators
Use@computed_fieldin Pydantic models for derived values instead of storing and validating redundant fields
Preferasyncio.TaskGroupfor fan-out/fan-in parallel operations (e.g., multiple tool invocations, parallel agent calls) instead of barecreate_task
Line length: 88 characters (enforced by ruff)
Functions must be < 50 lines; files must be < 800 lines
Handle errors explicitly; never silently swallow exceptions
Validate input at system boundaries (user input, external APIs, config files)
Create new objects instead of mutating existing ones (immutability principle)
Files:
src/synthorg/memory/org/store.pysrc/synthorg/tools/sandbox/docker_sandbox.pysrc/synthorg/templates/presets.pysrc/synthorg/memory/backends/mem0/adapter.pytests/unit/memory/test_factory.pysrc/synthorg/tools/mcp/__init__.pysrc/synthorg/config/loader.pysrc/synthorg/api/middleware.py
src/synthorg/**/*.py
📄 CodeRabbit inference engine (CLAUDE.md)
src/synthorg/**/*.py: Every module with business logic must importfrom synthorg.observability import get_loggerand definelogger = get_logger(__name__)
Never useimport logging,logging.getLogger(), orprint()in application code — use the synthorg logger instead
Always use event name constants from domain-specific modules undersynthorg.observability.events(e.g.,PROVIDER_CALL_STARTfromevents.provider); import directly:from synthorg.observability.events.<domain> import EVENT_CONSTANT
Always log with structured kwargs:logger.info(EVENT, key=value)— never use old-style formattinglogger.info("msg %s", val)
All error paths must log at WARNING or ERROR with context before raising
All state transitions must log at INFO level
Use DEBUG level for object creation, internal flow, and entry/exit of key functions
Pure data models, enums, and re-exports do NOT need logging
Never implement retry logic in driver subclasses or calling code — all provider calls go throughBaseCompletionProviderwhich applies retry + rate limiting automatically
SetRetryConfigandRateLimiterConfigper-provider inProviderConfig; retryable errors areRateLimitError,ProviderTimeoutError,ProviderConnectionError,ProviderInternalError
Use frozen Pydantic models for config/identity; separate mutable-via-copy models (usingmodel_copy(update=...)) for runtime state
For dict/list fields in frozen Pydantic models, usecopy.deepcopy()at system boundaries (tool execution, LLM provider serialization, inter-agent delegation, persistence serialization)
Use Pydantic v2 conventions:BaseModel,model_validator,computed_field,ConfigDict
Files:
src/synthorg/memory/org/store.pysrc/synthorg/tools/sandbox/docker_sandbox.pysrc/synthorg/templates/presets.pysrc/synthorg/memory/backends/mem0/adapter.pysrc/synthorg/tools/mcp/__init__.pysrc/synthorg/config/loader.pysrc/synthorg/api/middleware.py
tests/**/*.py
📄 CodeRabbit inference engine (CLAUDE.md)
tests/**/*.py: Use@pytest.mark.unit,@pytest.mark.integration,@pytest.mark.e2e,@pytest.mark.slowto categorize tests
Maintain 80% minimum code coverage (enforced in CI)
Each test must complete within 30 seconds (timeout enforcement)
Always include-n autowhen running pytest viauv run python -m pytest— never run tests sequentially (pytest-xdist parallelism)
Prefer@pytest.mark.parametrizefor testing similar cases
Never use real vendor names (Anthropic, OpenAI, Claude, GPT, etc.) in project-owned code, docstrings, comments, tests, or config examples — use generic names likeexample-provider,example-large-001,test-provider,test-small-001, or size aliases (large/medium/small)
Use Hypothesis for property-based testing with@given+@settingsdecorators; control profiles viaHYPOTHESIS_PROFILEenv var (cifor 200 examples,devfor 1000 examples)
Files:
tests/unit/memory/test_factory.py
🧠 Learnings (2)
📚 Learning: 2026-03-15T12:05:56.884Z
Learnt from: CR
Repo: Aureliolo/synthorg PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-03-15T12:05:56.884Z
Learning: Applies to docker/**/*.py : Backend Dockerfile must use 3-stage build (builder → setup → distroless runtime), Chainguard Python base, run as non-root (UID 65532), and apply CIS hardening
Applied to files:
src/synthorg/tools/sandbox/docker_sandbox.py
📚 Learning: 2026-03-15T11:48:14.867Z
Learnt from: CR
Repo: Aureliolo/synthorg PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-03-15T11:48:14.867Z
Learning: Applies to docker/** : Docker build context: single root .dockerignore (both images build with context: .). Tags: CI tags images with version from pyproject.toml ([tool.commitizen].version), semver, and SHA.
Applied to files:
src/synthorg/tools/sandbox/docker_sandbox.py
🧬 Code graph analysis (2)
src/synthorg/templates/presets.py (1)
web/src/api/types.ts (1)
PersonalityConfig(267-282)
src/synthorg/tools/mcp/__init__.py (1)
tests/unit/tools/mcp/test_bridge_tool.py (1)
bridge_tool(23-31)
🔇 Additional comments (10)
src/synthorg/config/loader.py (1)
119-122: LGTM! Safe attribute access for YAML error marks.The
getattrpattern correctly handles the type-checking concern:yaml.YAMLErroris the base class and doesn't guaranteeproblem_mark, while subclasses likeScannerErrorandParserErrordo. This approach is both type-safe and maintains runtime behavior.pyrightconfig.json (1)
1-16: Configuration looks appropriate for an editor companion setup.The configuration correctly targets Python 3.14, uses standard mode, and disables noise from dynamic libraries (Pydantic, structlog, pytest) while keeping actionable checks enabled. This aligns well with the PR's intent to use Pyright alongside mypy in CI.
src/synthorg/tools/sandbox/docker_sandbox.py (2)
14-14: LGTM! Import needed for type annotations.The explicit
aiodocker.containersimport is required for theDockerContainertype hints used in method signatures (e.g.,_wait_for_exit,_safe_collect_logs,_collect_logs).
357-357: Appropriate use of pyright ignores for aiodocker container operations.The
# pyright: ignore[reportAttributeAccessIssue]comments are applied consistently to alldocker.containers.*access points. This is a reasonable workaround for incomplete type stubs inaiodocker, and the pattern is applied uniformly across create, lookup, stop, and remove operations.Also applies to: 413-413, 562-562, 589-589
src/synthorg/api/middleware.py (1)
156-156: LGTM! Appropriate pyright ignore for ASGI send wrapper.The
Sendtype expects specific ASGI message types, but the wrapper function receivesmessage: Anyfor flexibility. The runtime behavior is correct — valid ASGI messages flow through unchanged. The narrowly-scopedreportArgumentTypeignore is appropriate for this ASGI typing limitation.src/synthorg/memory/backends/mem0/adapter.py (1)
177-177: LGTM! Appropriate pyright ignore for protocol assignment.The
Mem0Clientprotocol defines the method subset used by the adapter, andMemory.from_config()returns an instance that satisfies it. Pyright may struggle with this inference due to the dynamic nature of themem0library. The narrowly-scoped ignore is appropriate since mypy handles this correctly in CI.src/synthorg/tools/mcp/__init__.py (1)
8-9: LGTM! Clean TYPE_CHECKING pattern for lazy-loaded symbols.The
TYPE_CHECKINGimports provide static type information for IDEs and type checkers, while__getattr__handles actual runtime imports. This correctly bridges static typing with the existing lazy-loading mechanism and avoids circular imports.Also applies to: 20-26
tests/unit/memory/test_factory.py (1)
95-99: Type narrowing approach is appropriate.The pattern of declaring
side_effect: ValidationError | None = None, then assigning in the except block, and finally asserting non-None is a valid way to satisfy pyright's type narrowing while keeping the test logic clear.src/synthorg/memory/org/store.py (1)
424-439: LGTM! Proper SQL LIKE escaping and variable initialization.The changes correctly:
- Initialize
escapedbefore conditional use (fixes pyright's "possibly unbound" warning)- Escape SQL LIKE wildcards (
\,%,_) with backslash- Use
ESCAPE '\\'clause for the LIKE pattern- Reuse the escaped value for
INSTRranking within the sameif text is not NoneblockThe escaping order is correct (backslash first to avoid double-escaping), and the logic flow ensures
escapedholds the proper value when used in the ORDER BY clause.src/synthorg/templates/presets.py (1)
440-441: Import-time validation invocation and namespace cleanup are good.Calling
_validate_presets()immediately and deleting the helper keeps startup validation explicit while preserving a clean module API surface.
| "reportUnknownVariableType": false, | ||
| "reportUnknownParameterType": false, | ||
| "reportUnknownLambdaType": false, | ||
| "reportCallIssue": false, |
There was a problem hiding this comment.
🧹 Nitpick | 🔵 Trivial
Consider the implications of disabling reportCallIssue.
Disabling reportCallIssue suppresses all call-site type mismatches, which could hide legitimate type errors beyond the intended Pydantic/structlog noise. Since mypy strict is the authoritative checker in CI, this may be acceptable for editor ergonomics, but be aware that some genuine issues might be silently skipped in the IDE.
If you find real type errors slipping through, consider re-enabling this and using targeted # pyright: ignore[reportCallIssue] comments on specific false-positive lines instead.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@pyrightconfig.json` at line 13, The pyright config currently disables
reportCallIssue by setting "reportCallIssue": false which silences all call-site
type mismatch warnings; to avoid hiding real issues either re-enable
reportCallIssue (set it back to true) and address any noisy Pydantic/structlog
false positives with targeted inline ignores (use "# pyright:
ignore[reportCallIssue]" on the specific functions or call sites), or keep it
disabled for editor ergonomics but add a short repo-level comment explaining
that mypy strict in CI is authoritative and to revert to per-line ignores if
real type errors are observed; reference the "reportCallIssue" setting in
pyrightconfig.json when making this change.
| for name, preset in PERSONALITY_PRESETS.items(): | ||
| try: | ||
| PersonalityConfig(**preset) | ||
| except (ValidationError, TypeError) as exc: |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Verify tuple-style multi-except usages that violate the repository rule.
# Expected: this file/line should appear until fixed.
rg -nP --type=py 'except\s*\([^)]*,[^)]*\)\s*(as\s+\w+)?\s*:' src testsRepository: Aureliolo/synthorg
Length of output: 11555
Change to PEP 758 except syntax (no parentheses).
Line 435 uses except (ValidationError, TypeError) as exc:, which violates the enforced exception syntax rule. Must use except ValidationError, TypeError as exc: instead per PEP 758 (enforced by ruff on Python 3.14).
Proposed fix
- except (ValidationError, TypeError) as exc:
+ except ValidationError, TypeError as exc:📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| except (ValidationError, TypeError) as exc: | |
| except ValidationError, TypeError as exc: |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@src/synthorg/templates/presets.py` at line 435, Replace the tuple-style
exception clause "except (ValidationError, TypeError) as exc:" with the PEP
758-compliant syntax without parentheses: "except ValidationError, TypeError as
exc:"; update the except line where ValidationError and TypeError are caught
(keeping the exception variable name exc) so ruff on Python 3.14 accepts it.
- Add logging before raise in preset validation (CLAUDE.md requirement)
- Add TEMPLATE_PERSONALITY_PRESET_INVALID event constant
- Fix misleading comment in test_factory.py ("always fails" -> "always set")
- Keep reportCallIssue disabled (393 false positives from Pydantic/Annotated)
- PEP 758 except syntax deferred (ruff doesn't support it yet)
There was a problem hiding this comment.
Aureliolo has reached the 50-review limit for trial accounts. If you'd like to continue receiving code reviews, you can add a payment method here.
🤖 I have created a release *beep* *boop* --- ## [0.2.5](v0.2.4...v0.2.5) (2026-03-15) ### Features * default sandbox to enabled, polish CLI output, add sandbox CI build ([#455](#455)) ([a4869b6](a4869b6)) ### Bug Fixes * export .intoto.jsonl provenance for OpenSSF Scorecard ([#456](#456)) ([2feed09](2feed09)) ### Maintenance * add pyrightconfig.json and fix all pyright errors ([#448](#448)) ([f60746a](f60746a)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
Summary
pyrightconfig.jsonwithstandardmode and suppressed noise rules for Pydantic/structlog/pytest (reduces 1648 false positives to 0)middleware.py: pyright-specific ignore for ASGIsend()type mismatchloader.py: usegetattrforYAMLError.problem_mark(avoids missing attr on base class)mem0/adapter.py: pyright ignore for_clientattr assignmentorg/store.py: initializeescapedbefore conditional usepresets.py: extract validation loop into function to avoid unbound variable warningsmcp/__init__.py: addTYPE_CHECKINGimports for lazy-loaded__all__symbolsdocker_sandbox.py: explicitaiodocker.containersimport + pyright ignorestest_factory.py: initializeside_effectwithNone+ assert narrowingContext
Pyright (used as LSP) produced 1648 errors due to no Pydantic plugin (unlike mypy). The project already has mypy strict + Pydantic plugin in CI as the authoritative type checker. This PR configures pyright as a useful editor companion by suppressing dynamic-library noise while keeping real bug detection.
Test plan
pyright src/ tests/— 0 errors, 0 warningsmypy src/ tests/— 0 issues in 974 filespytest tests/ -m unit -n auto— 7868 passedruff check— all passed