fix(proxy): restore click decorator chain on run_server

The _value_type_name helper was inserted between the last @click.option
decorator and def run_server, which hijacked the entire click decorator
stack onto the helper and left run_server as a bare 51-arg function.
That broke:
  - the litellm console entry point (TypeError: run_server() missing 51 args)
  - python-310-import-smoke, Core checks on all Pythons
  - proxy-infra-root / All Other Providers tests that access run_server.main/.name
  - the basedpyright type-check budget (3 extra reportCallIssue)

Move the helper above @click.command() so the decorators re-attach to
run_server as on main.
This commit is contained in:
linhongyu510 2026-10-05 14:39:47 +08:00
parent 8003d5920b
commit e8162412d1

View file

@ -702,6 +702,16 @@ class ProxyInitializationHelpers:
return multiproc_dir
def _value_type_name(value: object) -> str:
"""Return the runtime class name of an arbitrary config value.
The value read from YAML is untyped; annotate the parameter as ``object``
so ``type()`` receives a known-typed argument and the strict type gate does
not count a ``reportUnknownArgumentType`` error on the error path.
"""
return type(value).__name__
@click.command()
@click.argument("cli_args", nargs=-1)
@click.option("--host", default="0.0.0.0", help="Host for the server to listen on.", envvar="HOST")
@ -1014,16 +1024,6 @@ class ProxyInitializationHelpers:
),
envvar="PROMETHEUS_METRICS_PORT",
)
def _value_type_name(value: object) -> str:
"""Return the runtime class name of an arbitrary config value.
The value read from YAML is untyped; annotate the parameter as ``object``
so ``type()`` receives a known-typed argument and the strict type gate does
not count a ``reportUnknownArgumentType`` error on the error path.
"""
return type(value).__name__
def run_server(
cli_args,
host,