Skip to content

discovery(orchestration): dual AgentCapability definitions — Enum (orchestration) vs dataclass (agents.agent_orchestration) #6818

Closed

Description

@mrveiss

Discovered during

Audit of issue #4048 closure (orchestrator consolidation deep-audit, 2026-05-04).

Finding

Two completely different classes share the name `AgentCapability` in two packages:

Definition File Shape Values
`AgentCapability(Enum)` orchestration/types.py:19 Enum 7 capability tags (RESEARCH, ANALYSIS, …)
`AgentCapability` (dataclass) agents/agent_orchestration/types.py:147 dataclass 5 fields (model_size, specialization, strengths, limitations, …) — describes an agent's capability profile

These represent fundamentally different concepts: one is a tag/enum ("this task needs RESEARCH capability"), the other is a descriptor ("this agent has these specs"). Same name, different semantics, never reconciled.

The `enhanced_orchestration` package side-steps the collision by importing the Enum:

Evidence

grep -n "^class AgentCapability\|class AgentCapability(" \
  autobot-backend/orchestration/types.py \
  autobot-backend/agents/agent_orchestration/types.py \
  autobot-backend/enhanced_orchestration/types.py

Why it matters

A reader following `from … import AgentCapability` cannot tell which shape they're getting without checking the import path. Future refactors that move classes between packages risk silent semantic breakage.

Recommendation

Rename one of them to make intent unambiguous. Suggested:

  • Keep `orchestration.types.AgentCapability` as the Enum (tag) — broadly imported.
  • Rename `agents.agent_orchestration.types.AgentCapability` → `AgentCapabilityDescriptor` — it's an agent profile, not a capability tag.

Acceptance criteria

  • Single class named `AgentCapability` in the codebase, OR both classes have explicitly distinct names
  • All call sites updated
  • `grep -rn '^class AgentCapability'` returns at most one definition

Priority

P2 — confusing but not actively broken.

Activity

  1. mrveiss commented on May 4, 2026

    @mrveiss
    OwnerAuthor

    ✅ Closed with proof — PR #6924 merged in commit d7c3833e4

    Implementation acceptance criteria:

    • ✅ Tests passing — agents/agent_orchestration/ 76/76 pass (1 pre-existing unrelated failure confirmed present pre-PR)
    • ✅ Linting clean
    • ✅ agents.agent_orchestration.types.AgentCapability (dataclass, line 147) → AgentCapabilityDescriptor
    • ✅ All 14 caller references updated (DEFAULT_AGENT_CAPABILITIES dict + routing.py type hints)

    Integration acceptance criteria (#6836 gate):

    • ✅ Rename refactor — no new modules added
    • ✅ Verified post-merge: grep -rn '^class AgentCapability\b' autobot-backend --include='*.py' returns one hit (the Enum at orchestration/types.py:19) — collision resolved
    • ✅ grep -rn 'class AgentCapabilityDescriptor' autobot-backend --include='*.py' returns one hit — rename complete

    The canonical orchestration.types.AgentCapability(Enum) is untouched.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions