mirror of
https://github.com/langbot-app/LangBot.git
synced 2026-10-29 20:05:25 +08:00
* 重构文档结构:移除 docs 目录,调整文件组织结构 * Reorder "插件 SDK API" section in docs.json * Refactor and clarify various documentation sections * Refine warnings and info boxes across multiple docs * Refactor and simplify Japanese documentation content * Update package.json to include mintlify as a dependency and add pnpm-lock.yaml for dependency management * Update blog link and add description in docs.json --------- Co-authored-by: Junyan Chin <[email protected]>
18 lines
1.2 KiB
Plaintext
18 lines
1.2 KiB
Plaintext
---
|
|
title: "系统兼容处理"
|
|
---
|
|
|
|
LangBot 插件系统运用了`Asyncio`和`Subprocess`等机制,这在unix-like系统(如Linux、MacOS)上运行良好,但在Windows上存在一些问题,导致插件无法正常运行。
|
|
|
|
Windows 上的 Python 异步事件循环默认使用 `ProactorEventLoop`,但该事件循环对 Stdio 的支持性缺失,而非 Docker 环境下 LangBot 依赖 Stdio 与 Plugin Runtime 通信、Plugin Runtime 也依赖 Stdio 与插件通信。
|
|
|
|
若改为使用`SelectorEventLoop`,则会导致无法正常启动 Plugin Runtime 和插件,因为`SelectorEventLoop`不支持`Subprocess`。
|
|
|
|
详细问题参阅:[Python官方文档](https://docs.python.org/zh-cn/3.13/library/asyncio-platforms.html)
|
|
|
|
## 解决方案
|
|
|
|
与 Unix-like 系统上的子进程管理与 Stdio 通信绑定的形式不同,LangBot 和 Plugin Runtime 在 Windows 上会自动采用 子进程 + WebSocket 结合的跨进程通信技术,LangBot 通过子进程启动 Plugin Runtime 但通过 WebSocket 与其通信;Plugin Runtime 也通过子进程启动各个已安装插件但通过 WebSocket 通信。
|
|
|
|
这是 LangBot 根据系统标识自动适应的,您无需手动配置。
|