fix(proxy): silence reportUnknownArgumentType on general_settings error path

The `elif not isinstance(general_settings, dict)` branch sees
`general_settings` as `Unknown` (the YAML config dict is untyped),
so calling `_value_type_name(general_settings)` trips
basedpyright's reportUnknownArgumentType budget by 1.
Cast to `object` at the call site so the argument has a known type
without changing runtime behavior (cast is a no-op).
This commit is contained in:
linhongyu510 2026-10-05 14:57:09 +08:00
parent e8162412d1
commit 46ac0bb172

View file

@ -9,7 +9,7 @@ import sys
import urllib.parse as urlparse
from collections.abc import Iterable, Mapping, Sequence
from pathlib import Path
from typing import TYPE_CHECKING, Any, Final
from typing import TYPE_CHECKING, Any, Final, cast
import click
import httpx
@ -1240,7 +1240,7 @@ def run_server(
elif not isinstance(general_settings, dict):
raise ValueError(
"`general_settings` in the proxy config must be a mapping "
f"(got {_value_type_name(general_settings)}). Check the "
f"(got {_value_type_name(cast(object, general_settings))}). Check the "
"`general_settings:` block in your config file."
)
### LOAD KEY MANAGEMENT SETTINGS FIRST (needed for custom secret manager) ###