[refactor] Retire the legacy config accessor and the remaining process singletons (#30493)

This commit is contained in:
Cheng Wan
2026-07-09 02:10:47 -07:00
committed by GitHub
parent 122b3266a2
commit 1f15308dca
158 changed files with 773 additions and 710 deletions
@@ -602,10 +602,18 @@ class TestResolveAutoParsers(unittest.TestCase):
qwen3_template = "{% set enable_thinking = enable_thinking if enable_thinking is defined else true %}"
class _Args(SimpleNamespace):
# Write-through override, per the runtime-context testing idiom:
# production adjusts parsers through override(source, ...), so the
# stand-in needs the method (a bare SimpleNamespace would raise).
def override(self, source, **fields):
for key, value in fields.items():
setattr(self, key, value)
def _make_server_args(
self, reasoning_parser=None, tool_call_parser=None, chat_template=None
):
return SimpleNamespace(
return self._Args(
reasoning_parser=reasoning_parser,
tool_call_parser=tool_call_parser,
model_path="Qwen/Qwen3-0.6B",
@@ -650,12 +658,8 @@ class TestResolveAutoParsers(unittest.TestCase):
self.assertEqual(args.tool_call_parser, "qwen")
def test_nonexistent_model_disables_both_parsers(self):
args = SimpleNamespace(
reasoning_parser="auto",
tool_call_parser="auto",
model_path="nonexistent/model-does-not-exist-xyz",
trust_remote_code=False,
)
args = self._make_server_args(reasoning_parser="auto", tool_call_parser="auto")
args.model_path = "nonexistent/model-does-not-exist-xyz"
with _patch_hf_transformers_utils(
Mock(side_effect=RuntimeError("tokenizer unavailable")),
Mock(side_effect=RuntimeError("config unavailable")),