fix: add stdout startup completion signal for AstrBot Launcher - #7984
Closed
Blueteemo wants to merge 1 commit into
Closed
fix: add stdout startup completion signal for AstrBot Launcher#7984Blueteemo wants to merge 1 commit into
Blueteemo wants to merge 1 commit into
Conversation
Contributor
There was a problem hiding this comment.
Hey - I've left some high level feedback:
- Since this
printis intentionally bypassing the logger for the launcher’s stdout contract, consider adding a short comment explaining that it’s a startup completion signal consumed by AstrBot Launcher so future refactors don’t remove or redirect it accidentally. - To avoid potential confusion around mixed languages in startup messages, consider aligning the
printtext with any existing constant or clearly defined protocol string used by the launcher, or centralizing it as a constant so both sides rely on the same value.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- Since this `print` is intentionally bypassing the logger for the launcher’s stdout contract, consider adding a short comment explaining that it’s a startup completion signal consumed by AstrBot Launcher so future refactors don’t remove or redirect it accidentally.
- To avoid potential confusion around mixed languages in startup messages, consider aligning the `print` text with any existing constant or clearly defined protocol string used by the launcher, or centralizing it as a constant so both sides rely on the same value.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
Contributor
There was a problem hiding this comment.
Code Review
This pull request adds a print statement to signal the completion of the AstrBot startup process. A review comment points out that since background tasks are initialized asynchronously in the _load method, the startup signal might be printed before these tasks have actually begun. It is suggested to include await asyncio.sleep(0) before the print statement to ensure the event loop has an opportunity to start the background tasks.
Member
|
您好,AstrBot Launcher已在v0.3.3版本适配了新的日志行为。 另外我这边复核了一下AstrBot当前代码, |
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.
问题描述
AstrBot Launcher 通过监控 Python 进程 stdout 中的
AstrBot 启动完成来判断实例是否启动完成。但当前代码使用logger.info("AstrBot started.")输出启动消息,该消息走 loguru 日志通道(stderr),Launcher 无法检测到,导致 300 秒后超时 kill 进程。修复方案
在
core_lifecycle.py的start()方法中添加print("AstrBot 启动完成", flush=True),将启动完成信号输出到 stdout。关联 Issue
Fixes #7982
Summary by Sourcery
Bug Fixes: