Skip to content

P1: consolidate agent metadata into Agent.Metadata() interface #397

@rsnodgrass

Description

@rsnodgrass

Parent Epic

Part of #396 (unify agent abstraction layer)

Problem

Agent display names, CLI binary names, config paths, and type aliases are defined in 4+ separate locations:

Data Locations
Display names agent_hook.go:agentDisplayNames, hooks_user_marker.go:agentDisplayNames, prime/agent_type.go:AgentDisplayName(), each Agent's Name()
CLI binary names doctor_integration.go:detect*(), agent_auth.go:CheckAgentUsability(), hooks_*.go
Config paths doctor_integration.go:detect*(), hooks_user_marker.go:agentContextPaths, agent_auth.go
Type aliases prime/agent_type.go:CanonicalAgentType(), adapters/*.go:init(), agent_hook.go:resolveAgentType()

Proposed Solution

Add a Metadata() method to the Agent interface:

type AgentMetadata struct {
    Type        string   // "claude-code"
    CLIBinary   string   // "claude"
    DisplayName string   // "Claude Code"
    ConfigPaths []string // paths to check for detection
    Aliases     []string // ["claude", "claude-code"]
}

All consumers read from the registry instead of maintaining local maps.

Files to Change

  • cmd/ox/hooks_agent.go — add Metadata() to interface, implement on each agent struct
  • cmd/ox/agent_hook.go — delete agentDisplayNames, derive from registry
  • cmd/ox/hooks_user_marker.go — delete agentDisplayNames and agentContextPaths, derive from registry
  • cmd/ox/doctor_integration.go — rewrite detect functions to use metadata
  • internal/daemon/agentwork/agent_auth.go — use metadata instead of switch
  • internal/prime/agent_type.goAgentDisplayName() delegates to registry or deleted

Risk

  • Blast radius: Medium (~8 files, mechanical changes)
  • Behavior change: None — all consumers switch from local maps to registry lookups

Metadata

Metadata

Assignees

No one assigned

    Labels

    tech-debtTechnical debt requiring cleanup or refactoring

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions