Skip to content

Run precommit and fix type errors#145

Merged
benjibc merged 3 commits intomainfrom
cursor/run-precommit-and-fix-type-errors-3253
Sep 1, 2025
Merged

Run precommit and fix type errors#145
benjibc merged 3 commits intomainfrom
cursor/run-precommit-and-fix-type-errors-3253

Conversation

@benjibc
Copy link
Copy Markdown
Contributor

@benjibc benjibc commented Sep 1, 2025


name: Pull Request
about: Propose changes to the codebase
title: "Refactor: Reduce Type Errors and Improve Type Consistency"
labels: ''
assignees: ''


Description

This PR addresses a batch of type errors identified by pyright and ensures make precommit runs cleanly. The primary motivation was to reduce the overall count of type checking issues, improving code quality and maintainability.

Key changes include:

  • Adjusted OpenAI tool definitions to use List[dict] for broader compatibility and implemented a runtime import strategy for OpenAI in orchestrator.py and mcp_multi_client.py.
  • Corrected return types and default factories in playback_policy.py and models.py.
  • Improved type safety and handling of optional values in simple_process_manager.py and mcp_agent/main.py.
  • Relaxed Docker SDK type annotations to Any to prevent conflicts in docker_resource.py.
  • Normalized tool results and rollout outputs to List[Dict[str, Any]] in default_agent_rollout_processor.py and task_manager.py.

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?

  • Ran make precommit locally, which now passes cleanly.
  • Verified a material reduction in pyright type errors.

Test Configuration:

  • Firmware version: N/A
  • Hardware: N/A
  • Toolchain: Python 3.x, uv, make
  • 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
  • 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

Pre-commit now runs cleanly, and the number of basedpyright errors has been materially reduced across the codebase, with at least 10 specific issues addressed. Remaining errors are concentrated in agent/task_manager.py, dataset/benchmarks, and several integration modules.


Open in Cursor Open in Web

@cursor
Copy link
Copy Markdown

cursor bot commented Sep 1, 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

cursoragent and others added 2 commits September 1, 2025 06:47
…ibility

Co-authored-by: bchen <bchen@fireworks.ai>
…initions

Co-authored-by: bchen <bchen@fireworks.ai>
@benjibc benjibc marked this pull request as ready for review September 1, 2025 07:01
@benjibc benjibc merged commit fbb8d34 into main Sep 1, 2025
7 checks passed
@benjibc benjibc deleted the cursor/run-precommit-and-fix-type-errors-3253 branch September 1, 2025 07:01
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