Skip to content

Run precommit and fix type errors#146

Merged
benjibc merged 1 commit intomainfrom
cursor/run-precommit-and-fix-type-errors-48d4
Sep 1, 2025
Merged

Run precommit and fix type errors#146
benjibc merged 1 commit intomainfrom
cursor/run-precommit-and-fix-type-errors-48d4

Conversation

@benjibc
Copy link
Copy Markdown
Contributor

@benjibc benjibc commented Sep 1, 2025


name: Pull Request
about: Propose changes to the codebase
title: "Fix: Resolve initial type errors identified by pre-commit"
labels: ''
assignees: ''


Description

This PR addresses and resolves the first batch of type errors identified by make precommit. The primary motivation is to improve code quality and maintainability by ensuring type consistency.

Key changes include:

  • eval_protocol/agent/task_manager.py:
    • Safely cast result to Dict[str, Any] before dictionary updates to ensure type compatibility.
    • Corrected output_file handling to consistently pass Path objects.
  • eval_protocol/execution/pipeline.py:
    • Ensured _process_single_sample_internal always returns a Dict[str, Any], including structured error dictionaries instead of None.
    • Explicitly cast user_query to str where required for type correctness.
    • Provided missing cache parameters for the self.cache.get call.
    • Annotated assistant_msg_for_history as Dict[str, Any] to allow non-string values like tool call lists.

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 make precommit locally after applying the fixes.

  • make precommit

Test Configuration:

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

This PR addresses the initial set of type errors. Further type errors may exist in other parts of the codebase, particularly in tests and other modules, related to optional-member access, incorrect argument types, and list invariance.


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

@benjibc benjibc marked this pull request as ready for review September 1, 2025 07:52
@benjibc benjibc merged commit caf93cf into main Sep 1, 2025
7 checks passed
@benjibc benjibc deleted the cursor/run-precommit-and-fix-type-errors-48d4 branch September 1, 2025 07:53
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