Skip to content

execute_parallel and execute_sequential are dead code in executor.py #52

Description

@himanshu231204

Description

In openagent_eval/core/executor.py, two methods — execute_parallel (lines 31-71) and execute_sequential (lines 97-134) — are defined but never called anywhere in the codebase. The pipeline uses gather() for parallel execution (line 88) and a list comprehension for sequential execution (line 90), completely bypassing these methods.

Location

openagent_eval/core/executor.py, lines 31-71 and 97-134

Dead Code

execute_parallel (lines 31-71)

async def execute_parallel(
    self,
    tasks: list[Callable[..., Coroutine[Any, Any, Any]]],
    *args: Any,
    **kwargs: Any,
) -> list[Any]:

This method takes a list of callables and executes them all with the same *args and **kwargs. The pipeline never uses it — it calls gather() instead.

execute_sequential (lines 97-134)

async def execute_sequential(
    self,
    tasks: list[Callable[..., Coroutine[Any, Any, Any]]],
    *args: Any,
    **kwargs: Any,
) -> list[Any]:

This method runs tasks sequentially, stopping on the first failure. The pipeline implements sequential execution directly:

result.results = [await coro for coro in coroutines]

Why This Matters

  1. Dead code: Unused code adds maintenance burden, confuses readers, and increases the surface area for bugs
  2. Potential confusion: Developers might try to use execute_parallel or execute_sequential only to discover they're not used by the pipeline
  3. Async code that's never tested: These methods may have subtle bugs that go unnoticed

Suggested Fix

Remove both unused methods, or if they're intended for future use, mark them explicitly:

# TODO: Remove if unused after v1.0 release

Severity

Medium — Dead code that adds maintenance burden but doesn't cause runtime issues.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions