fix: 尊重显式配置的 Shipyard Neo profile#8167
Open
Tsukumi233 wants to merge 1 commit into
Open
Conversation
Contributor
There was a problem hiding this comment.
Hey - I've left some high level feedback:
- Consider using
Optional[str]withNoneas the sentinel for “auto-select” rather than overloading an empty string, and documenting this explicitly in the constructor docstring to make the profile semantics clearer to future maintainers. - Since
profileis now stripped on init, if leading/trailing spaces are considered invalid input it might be helpful to log a warning whenprofileis non-empty but becomes empty after stripping, to surface potential misconfigurations instead of silently switching to auto-select.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- Consider using `Optional[str]` with `None` as the sentinel for “auto-select” rather than overloading an empty string, and documenting this explicitly in the constructor docstring to make the profile semantics clearer to future maintainers.
- Since `profile` is now stripped on init, if leading/trailing spaces are considered invalid input it might be helpful to log a warning when `profile` is non-empty but becomes empty after stripping, to surface potential misconfigurations instead of silently switching to auto-select.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 updates the profile selection logic for the Shipyard Neo booter, changing the default profile from a hardcoded value to an empty string to enable automatic selection. When a profile is explicitly provided (including 'python-default'), it is now honored directly instead of potentially triggering auto-selection. These changes are supported by updated configuration hints, multi-language localization files, documentation, and new test cases. I have no feedback to provide as there were no review comments to evaluate.
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.
修复 Shipyard Neo 在 AstrBot 里错误地把
python-default当成“默认占位值”的问题。现在只要 profile 非空,就会按用户显式配置传给 Bay;只有 profile 为空时,才自动扫描并优先选择带browsercapability 的 profile。Modifications / 改动点
astrbot/core/computer/booters/shipyard_neo.py的 profile 解析逻辑,确保python-default作为显式配置时会被尊重。tests/test_profile_aware_tools.py,补充显式python-default和空值自动选择两类用例。Screenshots or Test Results / 运行截图或测试结果
已完成验证:
uv run pytest tests/test_profile_aware_tools.pyuv run ruff format .uv run ruff check .Checklist / 检查清单
requirements.txt和pyproject.toml。