Skip to content

WorkflowState.toLogicalPlan: unused targetOperatorId parameter — honor or remove (agent-service) #7170

Description

@mengw15

Task Summary

WorkflowState.toLogicalPlan(targetOperatorId?: string) (agent-service/src/agent/workflow-state.ts:418-454) declares a targetOperatorId parameter but never references it — it always builds the whole-graph plan from getAllEnabledOperators(). So toLogicalPlan("op1") returns the same plan as toLogicalPlan().

The only caller — agent-service/src/agent/texera-agent.ts:534 — passes no argument, and the "sub-graph of a target" need is already served by getSubDAG(targetOperatorId) (workflow-state.ts:238, used by tools/workflow-execution-tools.ts:204).

Pick one and do it:

  • Remove the unused parameter (likely correct — the sub-plan already lives in getSubDAG); or
  • Honor it — restrict the plan to the target and its upstream (e.g. reuse getSubDAG) and add a test.

Confirmed on main: toLogicalPlan("op1") deep-equals toLogicalPlan() today (characterized in #7159, then dropped from that coverage PR).

Task Type

  • Refactor / Cleanup

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions