Fix Feishu MCP npx resolution

This commit is contained in:
wuyang6
2026-05-11 17:25:16 +08:00
parent 2984cc44e8
commit 4964548fd1
3 changed files with 49 additions and 2 deletions
+22
View File
@@ -114,6 +114,28 @@ class FeishuIntegrationTests(unittest.TestCase):
self.assertEqual(url, 'https://mi.feishu.cn/docx/CZIldpM3QofbbXxxAq1cEininTd')
def test_feishu_command_uses_deployed_node_bin_dir(self) -> None:
with tempfile.TemporaryDirectory() as tmp_dir, patch.dict(
gui_server.os.environ,
{'CLAW_NODE_BIN_DIR': tmp_dir, 'PATH': ''},
clear=False,
):
npx_path = Path(tmp_dir) / 'npx'
npx_path.write_text('#!/usr/bin/env node\n', encoding='utf-8')
npx_path.chmod(0o755)
command = gui_server._feishu_command()
env = gui_server._feishu_env(
{
'home': Path(tmp_dir) / 'home',
'config': Path(tmp_dir) / 'config',
'npm_cache': Path(tmp_dir) / 'npm-cache',
}
)
self.assertEqual(command[0], str(npx_path))
self.assertTrue(env['PATH'].startswith(tmp_dir))
def test_create_online_doc_rejects_jsonl_for_now(self) -> None:
with tempfile.TemporaryDirectory() as tmp_dir:
client, state = _build_client(Path(tmp_dir))