refactor: remove unused runtime and WebUI helpers (#5999)

* refactor: remove unused runtime and WebUI helpers

* fix: preserve exported agent helper methods
This commit is contained in:
chengyongru authored and GitHub committed 2026-10-02 01:41:05 +08:00
1 parent d3d70f2065
commit 6ecb74aea9
17 files changed
+26 -143

No files matched your search

-4
View File
@@ -877,10 +877,6 @@ class WebSocketChannel(BaseChannel):
return
await self._commands.dispatch(connection, client_id, envelope)
def _prune_webui_request_operations(self) -> None:
"""Compatibility hook for request-cache boundary tests."""
self._commands.prune_request_operations()
# -- Outbound WebSocket events -----------------------------------------
async def stop(self) -> None:
@@ -1360,7 +1360,7 @@ def test_webui_request_cache_prunes_expired_completed_but_keeps_pending(
)
operations["fresh"] = SimpleNamespace(completed_at=now - 1)
channel._prune_webui_request_operations()
channel._commands.prune_request_operations()
assert "pending" in operations
assert "expired" not in operations
@@ -1383,7 +1383,7 @@ def test_webui_request_cache_prunes_oldest_completed_at_capacity(
completed_at=now - 1 + index / 1_000
)
channel._prune_webui_request_operations()
channel._commands.prune_request_operations()
assert "pending" in operations
assert "completed-0" not in operations
-17
View File
@@ -677,23 +677,6 @@ class WeixinChannel(BaseChannel):
return WeixinChannel._is_retryable_http_status(status_code)
return False
async def _api_get(
self,
endpoint: str,
params: dict[str, Any] | None = None,
*,
auth: bool = True,
extra_headers: dict[str, str] | None = None,
) -> dict[str, Any]:
assert self._client is not None
url = f"{self.config.base_url}/{endpoint}"
hdrs = self._make_headers(auth=auth)
if extra_headers:
hdrs.update(extra_headers)
return await self._request_json(
"GET", url, endpoint=endpoint, params=params, headers=hdrs,
)
async def _api_get_with_base(
self,
*,
@@ -895,7 +895,6 @@ async def test_qr_login_switches_polling_base_url_on_redirect_status(
"ilink_user_id": "wx-user",
},
]
channel._api_get = AsyncMock(side_effect=list(status_side_effect))
channel._api_get_with_base = AsyncMock(side_effect=list(status_side_effect))
ok = await channel._qr_login()
@@ -929,7 +928,6 @@ async def test_qr_login_redirect_without_host_keeps_current_polling_base_url(
"ilink_user_id": "wx-user",
},
]
channel._api_get = AsyncMock(side_effect=list(status_side_effect))
channel._api_get_with_base = AsyncMock(side_effect=list(status_side_effect))
ok = await channel._qr_login()