Skip to content

fix(types): add class-level type hints to ACP event classes#585

Open
github-actions[bot] wants to merge 1 commit intomainfrom
fix/code-quality/event-class-type-hints
Open

fix(types): add class-level type hints to ACP event classes#585
github-actions[bot] wants to merge 1 commit intomainfrom
fix/code-quality/event-class-type-hints

Conversation

@github-actions
Copy link
Contributor

@github-actions github-actions bot commented Mar 9, 2026

Summary

Adds class-level type hints to ACP event-related classes as identified in the code quality report.

Changes

  • Add class-level type hints to EventSubscriber:
    • session_id: str, conn: Client, conversation: BaseConversation | None, shared_events_handler: SharedEventHandler
  • Add class-level type hints to TokenBasedEventSubscriber:
    • session_id: str, conn: Client, loop: asyncio.AbstractEventLoop, conversation: BaseConversation | None, _streaming_tool_calls: dict[int, ToolCallState], shared_events_handler: SharedEventHandler, _reasoning_header_emitted: bool
  • Add class-level type hints to ToolCallState:
    • All 11 instance attributes: tool_call_id, tool_name, is_think, args, lexer, prev_emitted_thought_chunk, started, thought_header_emitted, _valid_skeleton_cached, _cached_kind, summary
  • Add -> None return type to __init__ methods

Related Issue

Addresses findings from #583

Testing

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

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

Addresses item from code quality report.

- Add class-level type hints to EventSubscriber (session_id, conn, conversation, shared_events_handler)
- Add class-level type hints to TokenBasedEventSubscriber (session_id, conn, loop, conversation, _streaming_tool_calls, shared_events_handler, _reasoning_header_emitted)
- Add class-level type hints to ToolCallState (all 11 instance attributes)
- Add -> None return type to __init__ methods

Addresses findings from #583

Co-authored-by: openhands <openhands@all-hands.dev>
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.

1 participant