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.go — AgentDisplayName() 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
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:
agent_hook.go:agentDisplayNames,hooks_user_marker.go:agentDisplayNames,prime/agent_type.go:AgentDisplayName(), each Agent'sName()doctor_integration.go:detect*(),agent_auth.go:CheckAgentUsability(),hooks_*.godoctor_integration.go:detect*(),hooks_user_marker.go:agentContextPaths,agent_auth.goprime/agent_type.go:CanonicalAgentType(),adapters/*.go:init(),agent_hook.go:resolveAgentType()Proposed Solution
Add a
Metadata()method to theAgentinterface:All consumers read from the registry instead of maintaining local maps.
Files to Change
cmd/ox/hooks_agent.go— addMetadata()to interface, implement on each agent structcmd/ox/agent_hook.go— deleteagentDisplayNames, derive from registrycmd/ox/hooks_user_marker.go— deleteagentDisplayNamesandagentContextPaths, derive from registrycmd/ox/doctor_integration.go— rewrite detect functions to use metadatainternal/daemon/agentwork/agent_auth.go— use metadata instead of switchinternal/prime/agent_type.go—AgentDisplayName()delegates to registry or deletedRisk