Skip to content

[Code Quality] refactor: collapse EngineCapabilities/EngineCapabilitiesDefinition duplicate struct #48888

Description

@github-actions

Description

EngineCapabilities (pkg/workflow/agentic_engine.go:111) and EngineCapabilitiesDefinition (pkg/workflow/engine_definition.go:126) are field-for-field identical 6-bool structs. A direct struct conversion (EngineCapabilities(d)) only compiles because the two types have identical field names/order/types -- any future field addition to one without the other would silently break or drift.

Suggested Changes

  • Add yaml tags directly onto EngineCapabilities and delete EngineCapabilitiesDefinition, OR
  • Make EngineCapabilitiesDefinition a type alias: type EngineCapabilitiesDefinition = EngineCapabilities

Files Affected

  • pkg/workflow/agentic_engine.go:111
  • pkg/workflow/engine_definition.go:126,137

Success Criteria

  • Only one struct definition remains (or an alias)
  • Existing ToRuntimeCapabilities() conversion path removed or simplified
  • All existing tests pass

Source

Extracted from Typist - Go Type Consistency Analysis #48872

Priority

Low - <1 hour effort, prevents future drift

🔍 Task mining by Discussion Task Miner - Code Quality Improvement Agent · aut00 · 51.4 AIC · ⌖ 5.2 AIC · ⊞ 9.9K ·

  • expires on Jul 30, 2026, 5:24 AM UTC-08:00

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions