// Returns an [ErrDuplicateRegistration] if a handler or definition is already registered.
// All registration is expected to happen in a single thread on process initialization.
for t, handler := range lib.CommandHandlers() {
if existing, ok := r.commandHandlers[t]; ok {
return fmt.Errorf("%w: command handler for %v: %v", ErrDuplicateRegistration, t, existing)