From 1ed664359ee1e5ff10b067947215488934220ab0 Mon Sep 17 00:00:00 2001 From: Xiang-Player Date: Mon, 16 Nov 2026 23:20:01 +0800 Subject: [PATCH 1/2] fix(lark): recognize international Lark setup URL lark-cli emits open.larksuite.com for --brand lark, but the app setup manager only accepted Feishu hosts. The verification URL was dropped, so Dashboard stayed at starting and the operator had to run the CLI to obtain the link. Add the official host and cover the real URL shape with a focused regression test. Signed-off-by: Xiang-Player --- loopx/extensions/lark/app_setup.py | 1 + tests/extensions/test_lark_app_setup.py | 28 +++++++++++++++++++++++++ 2 files changed, 29 insertions(+) diff --git a/loopx/extensions/lark/app_setup.py b/loopx/extensions/lark/app_setup.py index d72ec98899..788698e547 100644 --- a/loopx/extensions/lark/app_setup.py +++ b/loopx/extensions/lark/app_setup.py @@ -20,6 +20,7 @@ _OFFICIAL_SETUP_HOSTS = ( "open.feishu.cn", + "open.larksuite.com", "open." + "la" + "rk" + "office.com", ) OFFICIAL_SETUP_URL_PATTERN = re.compile( diff --git a/tests/extensions/test_lark_app_setup.py b/tests/extensions/test_lark_app_setup.py index cef804e546..5a1547da39 100644 --- a/tests/extensions/test_lark_app_setup.py +++ b/tests/extensions/test_lark_app_setup.py @@ -125,6 +125,34 @@ def test_setup_accepts_the_official_lark_authorization_host() -> None: ) +def test_setup_accepts_the_international_lark_authorization_host() -> None: + verification_url = ( + "https://open.larksuite.com/page/cli?user_code=public-code" + "&lpv=1.0.99&ocv=1.0.99&from=cli" + ) + manager = LarkAppSetupManager( + cli_resolution=LarkCliResolution( + command="fake-lark", + available=True, + source="path", + version="1.0.99", + error_code=None, + ), + process_factory=lambda _args, _env: _FakeProcess([ + "打开以下链接配置应用:\n", + f" {verification_url}\n", + "等待配置应用...\n", + ]), + profile_verifier=lambda app_ref: app_ref == "loopx-lark-bot", + ) + + started = manager.start(app_ref="loopx-lark-bot", brand="lark") + completed = _wait_for_terminal(manager, started["setup_id"]) + + assert completed["status"] == "ready" + assert completed["verification_url"] == verification_url + + def test_cancel_stops_the_registration_process_without_exposing_logs() -> None: process = _BlockingProcess() manager = LarkAppSetupManager( From 2db06716b28a56d8baf1ddbc71334f4dfe339356 Mon Sep 17 00:00:00 2001 From: "Wang, Xiang-Han" Date: Wed, 18 Nov 2026 01:02:40 +0800 Subject: [PATCH 2/2] fix(test): decode bridge URL pathname with fileURLToPath A checkout path containing spaces reaches import.meta.url as %20 in URL.pathname. The stdio relay fixture then spawns a script path that does not exist and all four relay tests time out. fileURLToPath preserves the real path on every checkout. Signed-off-by: Wang, Xiang-Han --- tests/control_plane_ts/host_stdio_bridge.test.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/control_plane_ts/host_stdio_bridge.test.ts b/tests/control_plane_ts/host_stdio_bridge.test.ts index 568289b57f..4ddb19fae1 100644 --- a/tests/control_plane_ts/host_stdio_bridge.test.ts +++ b/tests/control_plane_ts/host_stdio_bridge.test.ts @@ -7,8 +7,9 @@ import {tmpdir} from "node:os"; import {join} from "node:path"; import {setTimeout as delay} from "node:timers/promises"; import test from "node:test"; +import {fileURLToPath} from "node:url"; -const bridge = new URL("../../loopx/control_plane/turn_driver/host_stdio_bridge.ts", import.meta.url).pathname; +const bridge = fileURLToPath(new URL("../../loopx/control_plane/turn_driver/host_stdio_bridge.ts", import.meta.url)); const launch = (script: string) => spawn(process.execPath, ["--no-warnings", "--experimental-strip-types", bridge, process.execPath, "-e", script], {stdio: ["pipe", "pipe", "pipe"]});