Skip to content

Fix pyright type errors and suppress warnings#136

Merged
benjibc merged 1 commit intomainfrom
cursor/fix-pyright-type-errors-and-suppress-warnings-2ee2
Aug 30, 2025
Merged

Fix pyright type errors and suppress warnings#136
benjibc merged 1 commit intomainfrom
cursor/fix-pyright-type-errors-and-suppress-warnings-2ee2

Conversation

@benjibc
Copy link
Copy Markdown
Contributor

@benjibc benjibc commented Aug 30, 2025


name: Pull Request
about: Propose changes to the codebase
title: "Fix: Suppress Pyright warnings and resolve initial type errors"
labels: ''
assignees: ''


Description

This PR addresses initial Pyright errors by:

  1. Suppressing warnings: Configured the basedpyright pre-commit hook to only report errors, effectively suppressing all warnings.
  2. Fixing concrete type errors: Resolved several type errors across eval_protocol/mcp/simulation_server.py, eval_protocol/utils/logs_server.py, eval_protocol/mcp_servers/tau2/*_environment/*.py, and eval_protocol/rewards/format.py.
  3. Correcting Pyright configuration: Updated pyproject.toml to use a valid typeCheckingMode value ("standard" instead of "recommended").

The motivation is to reduce noise from type checkers and improve the overall type-safety and maintainability of the codebase.

Fixes # (issue)
Implements # (issue)

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update
  • Refactoring/Code cleanup
  • Build/CI/CD related changes
  • Other (please describe):

How Has This Been Tested?

The changes were verified by running Pyright locally:

  • make pre-commit (to confirm warning suppression and check for new errors)
  • npx --yes pyright -p pyproject.toml --level error (to directly run Pyright with the same warning suppression as pre-commit)

Test Configuration:

  • Firmware version: N/A
  • Hardware: N/A
  • Toolchain: N/A
  • SDK: N/A

Checklist:

  • My code follows the style guidelines of this project (ran black ., isort ., flake8 .)
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings (at the configured error level)
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules
  • I have checked my code and corrected any misspellings

Screenshots (if applicable)

N/A

Additional context

Many remaining Pyright errors are related to missing optional dependencies (e.g., pydantic, fastapi, httpx). These can be resolved by installing the dependencies or configuring Pyright to ignore specific directories/rules as needed.


Open in Cursor Open in Web

@cursor
Copy link
Copy Markdown

cursor bot commented Aug 30, 2025

Cursor Agent can help with this pull request. Just @cursor in comments and I'll start working on changes in this branch.
Learn more about Cursor Agents

@benjibc benjibc marked this pull request as ready for review August 30, 2025 11:04
@benjibc benjibc merged commit facd060 into main Aug 30, 2025
7 checks passed
@benjibc benjibc deleted the cursor/fix-pyright-type-errors-and-suppress-warnings-2ee2 branch August 30, 2025 11:04
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.

2 participants