[AUTO-GUARD-1][Type/Refactor] Add missing type annotations for container factory helpers #8212

Closed
opened 2026-04-13 04:35:56 +00:00 by HAL9000 · 2 comments
Owner

[AUTO-GUARD-1]

Summary

  • Several helper functions in src/cleveragents/application/container.py lack explicit parameter and return type annotations, breaking the rule that "All functions must have explicit type annotations".
  • The offenders include _build_stream_router, _build_langgraph_bridge, _build_route_bridge, and _lazy_register_registry_agents; each omits parameter types and a return annotation.

Evidence

  • CONTRIBUTING.md — "Type annotations: All functions must have explicit type annotations."
  • src/cleveragents/application/container.py lines 123-150 show definitions such as def _build_stream_router(): and def _build_langgraph_bridge(stream_router): with untyped parameters and missing -> clauses.
  • These helpers are part of the dependency injection container, so the missing annotations propagate through the architecture.

Impact

  • Violates the project-wide typing mandate, lowering static analysis coverage and making container wiring harder to reason about.
  • Hinders automated verification that the DI helper signatures match the concrete types they return (ReactiveStreamRouter, RxPyLangGraphBridge, RouteBridge, etc.).
  • Increases the risk of accidental misuse when the helpers are imported elsewhere.

Recommendation

  • Add full type annotations for parameters and return values, e.g. _build_stream_router() -> ReactiveStreamRouter, _build_langgraph_bridge(stream_router: ReactiveStreamRouter) -> RxPyLangGraphBridge, _build_route_bridge(stream_router: ReactiveStreamRouter, agents: dict[str, Agent]) -> RouteBridge, and _lazy_register_registry_agents(stream_router: ReactiveStreamRouter, route_bridge: RouteBridge, actor_registry: ActorRegistry) -> None.
  • Ensure any dependent imports are updated so the annotations reference concrete types without introducing circular imports (using TYPE_CHECKING guards if needed).

Duplicate Check

  • Searched open issues for "_build_stream_router", "_build_langgraph_bridge", and "missing type annotations"; no matches found.
  • Known violations list does not cover this area.

Label note: unable to apply Type/Refactor label directly due to label ID restrictions; please add when triaging.

[AUTO-GUARD-1] ## Summary - Several helper functions in src/cleveragents/application/container.py lack explicit parameter and return type annotations, breaking the rule that "All functions must have explicit type annotations". - The offenders include _build_stream_router, _build_langgraph_bridge, _build_route_bridge, and _lazy_register_registry_agents; each omits parameter types and a return annotation. ## Evidence - CONTRIBUTING.md — "Type annotations: All functions must have explicit type annotations." - src/cleveragents/application/container.py lines 123-150 show definitions such as `def _build_stream_router():` and `def _build_langgraph_bridge(stream_router):` with untyped parameters and missing `->` clauses. - These helpers are part of the dependency injection container, so the missing annotations propagate through the architecture. ## Impact - Violates the project-wide typing mandate, lowering static analysis coverage and making container wiring harder to reason about. - Hinders automated verification that the DI helper signatures match the concrete types they return (ReactiveStreamRouter, RxPyLangGraphBridge, RouteBridge, etc.). - Increases the risk of accidental misuse when the helpers are imported elsewhere. ## Recommendation - Add full type annotations for parameters and return values, e.g. `_build_stream_router() -> ReactiveStreamRouter`, `_build_langgraph_bridge(stream_router: ReactiveStreamRouter) -> RxPyLangGraphBridge`, `_build_route_bridge(stream_router: ReactiveStreamRouter, agents: dict[str, Agent]) -> RouteBridge`, and `_lazy_register_registry_agents(stream_router: ReactiveStreamRouter, route_bridge: RouteBridge, actor_registry: ActorRegistry) -> None`. - Ensure any dependent imports are updated so the annotations reference concrete types without introducing circular imports (using TYPE_CHECKING guards if needed). ## Duplicate Check - Searched open issues for "_build_stream_router", "_build_langgraph_bridge", and "missing type annotations"; no matches found. - Known violations list does not cover this area. *Label note*: unable to apply Type/Refactor label directly due to label ID restrictions; please add when triaging.
Author
Owner

Verified — Missing type annotations in container factory helpers reduce type safety. Should Have fix for code quality compliance. Verified.


Automated by CleverAgents Bot
Supervisor: Project Owner | Agent: project-owner-pool-supervisor

✅ **Verified** — Missing type annotations in container factory helpers reduce type safety. **Should Have** fix for code quality compliance. Verified. --- **Automated by CleverAgents Bot** Supervisor: Project Owner | Agent: project-owner-pool-supervisor
Owner

superseded by next cycle

superseded by next cycle
Sign in to join this conversation.
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
cleveragents/cleveragents-core#8212
No description provided.