feat(network): centralize proxy settings and add MCP routing (NAN-315) (#6372)

* feat(network): share proxy settings across features and MCP (NAN-315)

* fix(network): address shared proxy review regressions

* test(network): align rebased OAuth fixtures with runtime admission

* fix(webui): configure shared proxy without leaving connection drafts

* feat(webui): add optional shared proxy authentication editor

* fix(webui): align proxy save tests and loading skeleton
This commit is contained in:
chengyongru authored and GitHub committed 2026-10-22 15:49:27 +08:00
1 parent 872a83340d
commit 084b6bb394
181 files changed
+3740 -807

No files matched your search

+3 -2
View File
@@ -602,7 +602,8 @@ async def test_custom_messages_uses_its_proxy_and_does_not_inherit_native_creden
config = _config()
connection = config.get_provider(preset=config.model_presets["messages"])
connection.api_key = None
connection.proxy = "http://proxy.test:8080"
config.network.proxy = "http://proxy.test:8080"
connection.use_proxy = True
monkeypatch.setenv("ANTHROPIC_API_KEY", "native-key")
monkeypatch.setenv("ANTHROPIC_AUTH_TOKEN", "native-token")
requests = []
@@ -612,7 +613,7 @@ async def test_custom_messages_uses_its_proxy_and_does_not_inherit_native_creden
return _answer(request)
def transport(**kwargs):
assert kwargs.pop("proxy") == connection.proxy
assert kwargs.pop("proxy") == config.network.proxy
assert kwargs["trust_env"] is False
return DefaultAsyncHttpxClient(transport=httpx.MockTransport(handler), **kwargs)
+2 -1
View File
@@ -417,9 +417,10 @@ async def test_factory_builds_xai_provider_and_applies_explicit_body_overrides(m
"provider": "xai_grok",
}
},
"network": {"proxy": "http://127.0.0.1:7890"},
"providers": {
"xaiGrok": {
"proxy": "http://127.0.0.1:7890",
"useProxy": True,
"extraBody": {
"parallel_tool_calls": False,
"max_turns": 2,