Repository navigation
fix: resolve MaiBot WebUI endpoint from [http] section (Core 1.3.15+) - #18
Open
NethielChou wants to merge 3 commits into
Open
NethielChou wants to merge 3 commits into
NethielChou wants to merge 3 commits into
Conversation
Author
|
补充两条最新信息:
当前 CI 为 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
问题
MaiBot Core 1.3.15+ 把 WebUI 的监听地址/端口从
[webui]段迁移到了[http]段([webui]仅剩 enabled/mode 等字段),但启动器readMaiBotWebUiEndpointSync()仍只读document.webui,读不到就回退MAIBOT_WEBUI_FALLBACK_PORT = 8001。后果:
conflictPorts、readyPorts固定使用 8001,与实例真实端口(如 8003/8008)不一致,内置 WebUI 打不开;Fixes #17
改动
src/main/services/init-manager.ts(1 行逻辑 + 注释):scripts/tests/runtime-config-isolation.test.ts:新增一条测试,覆盖[http]段存在时优先使用其 port;[webui]段时回退到旧字段(兼容旧核心)。兼容性
[http].port;[http].host是数组,asString()会回退到 fallback host(127.0.0.1),不影响外部访问配置;[http]段 →document.http为 undefined → 回退[webui],行为与现状一致;测试
本地环境没有 bun,未能执行
bun test/bun run typecheck,因此新增的测试与类型检查交给 CI 验证。改动仅为单行读取顺序 + 新增测试,不涉及其他逻辑。