Skip to content

fix(types): create Feature TypedDict for critic refinement module - #792

Open
github-actions[bot] wants to merge 1 commit into
mainfrom
fix/code-quality/return-types-and-typeddict
Open

fix(types): create Feature TypedDict for critic refinement module#792
github-actions[bot] wants to merge 1 commit into
mainfrom
fix/code-quality/return-types-and-typeddict

Conversation

@github-actions

Copy link
Copy Markdown
Contributor

Summary

Creates a proper Feature TypedDict to replace dict[str, Any] for critic feature dictionaries, improving type safety and IDE support.

Changes

  • Added Feature TypedDict in openhands_cli/tui/utils/critic/refinement.py with fields:
    • name: str
    • display_name: str
    • probability: float
  • Updated function signatures to use Feature instead of dict[str, Any]:
    • _format_feature_for_prompt()
    • get_high_probability_issues()
    • build_refinement_message()
    • should_trigger_refinement()
  • Removed unused Any import

Related Issue

Addresses findings from #790 (item #6 from the Low-Hanging Fruit section)

Testing

  • Linting passes (make lint)
  • Tests pass (make test - 1361 tests)

This PR was automatically generated by the Code Quality Report workflow.

Replaces dict[str, Any] with a proper Feature TypedDict for critic
feature dictionaries (e.g., agent behavioral issues). This improves
type safety and IDE support.

Changes:
- Added Feature TypedDict with name, display_name, and probability fields
- Updated all function signatures in refinement.py to use Feature
- Removed unused Any import

Addresses item from code quality report.

Closes #790

Co-authored-by: openhands <openhands@all-hands.dev>
@github-actions

Copy link
Copy Markdown
Contributor Author

This PR is stale because it has been open for 40 days with no activity. Remove the stale label or leave a comment, otherwise it will be closed in 10 days.

@github-actions github-actions Bot added the Stale label Aug 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants