修复异步初始化中的控制台输入事件循环冲突 - #145
Open
fuilyha56-wq wants to merge 1 commit into
Open
fuilyha56-wq wants to merge 1 commit into
fuilyha56-wq wants to merge 1 commit into
Conversation
minecraft1024a
requested changes
Aug 24, 2026
minecraft1024a
left a comment
Collaborator
There was a problem hiding this comment.
文件全是减掉全部再加上全部,我怎么看啊,diff给我弄好了
Contributor
Author
There was a problem hiding this comment.
什么玩意?这东西为什么要砍prompt喵?
fuilyha56-wq
force-pushed
the
fix/async-console-input-event-loop
branch
from
August 24, 2026 04:16
ca7267c to
793196b
Compare
Collaborator
|
prompt不错,我韩了 |
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.
变更说明
修复 Neo-MoFox 异步启动流程中的事件循环冲突,并理顺控制台快捷键与协议输入交互。
核心修改
解决事件循环冲突 & 去除重复确认
Bot._initialize_core中在异步主循环内调用同步控制台输入导致的asyncio.run() cannot be called from a running event loop错误。0.0.0.0/::等通配地址且无强密钥)保留终端 Warning 告警与 UI 状态标记,不再阻塞式二次要求回车确认。prompt_console_input冗余同步函数。理顺控制台快捷键
Ctrl+C直接触发优雅关闭(由后台输入 worker 捕获并向主进程发送 SIGINT,交由SignalHandler处理)。Ctrl+Shift+C),不再在应用层拦截。Ctrl+C保持立即强制退出行为。启动鲁棒性增强
user_agreements.py)增加非交互/非 TTY 环境检查,避免在无控制台重定向场景下无限阻塞。ipaddress判定,完整覆盖0.0.0.0、::、::0等通配绑定场景。total_steps=20)。测试验证
uv run pytest test/app/runtime/test_console_input.py test/app/runtime/test_command_parser.py test/app/runtime/test_user_agreements.py test/app/runtime/test_bot_http_security.py -q -p no:cacheprovider -p no:randomly --no-cov11 passed, 4 skippeduv run ruff check src/app/runtime/ test/app/runtime/全部通过。