Ensure configuration behavior is predictable, validated, and migration-friendly:

Example (fail-fast validation for a config-provided function):

from celery.exceptions import ImproperlyConfigured

repr_function = self.app.conf.task_args_repr_function
if not repr_function:
    raise ImproperlyConfigured("task_args_repr_function must be set")
if isinstance(repr_function, str):
    # resolve symbol_by_name(...)
    repr_function = symbol_by_name(repr_function)
if not callable(repr_function):
    raise ImproperlyConfigured("task_args_repr_function must be callable")

Example (explicit precedence):