Repository navigation
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Code Review
This pull request refactors version management by defining __version__ in astrbot/__init__.py and deriving VERSION in astrbot/core/config/default.py from it. It also defers several imports in CLI commands to optimize startup and removes abort=True from a confirmation prompt. However, the release preparation script (scripts/prepare_release.py) needs to be updated to modify __version__ in astrbot/__init__.py instead of default.py to prevent execution failures.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
There was a problem hiding this comment.
Hey - I've found 1 issue, and left some high level feedback:
- The move of several imports (e.g.,
check_dashboard,get_astrbot_root, password helpers) inside functions appears to be addressing initialization side effects; consider adding a brief code comment to clarify that these are intentionally lazy imports to avoid unintended directory creation so future refactors don’t move them back to the module level. - Removing
abort=Truefromclick.confirmincheck_dashboardchanges the behavior when the user declines installation; if this is intentional, it might be clearer to explicitly handle theFalsecase (e.g., logging and returning early) so the flow is obvious and no follow-up logic runs unexpectedly.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- The move of several imports (e.g., `check_dashboard`, `get_astrbot_root`, password helpers) inside functions appears to be addressing initialization side effects; consider adding a brief code comment to clarify that these are intentionally lazy imports to avoid unintended directory creation so future refactors don’t move them back to the module level.
- Removing `abort=True` from `click.confirm` in `check_dashboard` changes the behavior when the user declines installation; if this is intentional, it might be clearer to explicitly handle the `False` case (e.g., logging and returning early) so the flow is obvious and no follow-up logic runs unexpectedly.
## Individual Comments
### Comment 1
<location path="astrbot/cli/utils/basic.py" line_range="42-45" />
<code_context>
if click.confirm(
"Install dashboard?",
default=True,
- abort=True,
):
click.echo("Installing dashboard...")
await download_dashboard(
</code_context>
<issue_to_address>
**issue (bug_risk):** Removing `abort=True` changes the control flow on a negative answer and may leave the dashboard uninstalled while continuing execution.
Without `abort=True`, answering "no" now just skips `download_dashboard` and continues initialization. If later steps assume the dashboard exists or depend on a hard failure when it doesn’t, this can result in partial setups or hard-to-diagnose errors. If you want to support running without the dashboard, please handle the "no" case explicitly (e.g., log a clear message or return early).
</issue_to_address>Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
…rBotDevs#8932) * fix: created unnecessary data dir when executing astrbot command fixes: AstrBotDevs#8853 * fix: 更新包版本更新函数以修改 astrbot/__init__.py 中的版本号
…rBotDevs#8932) * fix: created unnecessary data dir when executing astrbot command fixes: AstrBotDevs#8853 * fix: 更新包版本更新函数以修改 astrbot/__init__.py 中的版本号
fixes: #8853
Modifications / 改动点
Screenshots or Test Results / 运行截图或测试结果
Checklist / 检查清单
😊 If there are new features added in the PR, I have discussed it with the authors through issues/emails, etc.
/ 如果 PR 中有新加入的功能,已经通过 Issue / 邮件等方式和作者讨论过。
👀 My changes have been well-tested, and "Verification Steps" and "Screenshots" have been provided above.
/ 我的更改经过了良好的测试,并已在上方提供了“验证步骤”和“运行截图”。
🤓 I have ensured that no new dependencies are introduced, OR if new dependencies are introduced, they have been added to the appropriate locations in
requirements.txtandpyproject.toml./ 我确保没有引入新依赖库,或者引入了新依赖库的同时将其添加到
requirements.txt和pyproject.toml文件相应位置。😮 My changes do not introduce malicious code.
/ 我的更改没有引入恶意代码。
Summary by Sourcery
Align version management with astrbot.version and adjust CLI behavior around initialization and dashboard setup.
Bug Fixes:
Enhancements: