Skip to content

fix: 尊重显式配置的 Shipyard Neo profile#8167

Open
Tsukumi233 wants to merge 1 commit into
AstrBotDevs:masterfrom
Tsukumi233:fix/shipyard-neo-explicit-default-profile
Open

fix: 尊重显式配置的 Shipyard Neo profile#8167
Tsukumi233 wants to merge 1 commit into
AstrBotDevs:masterfrom
Tsukumi233:fix/shipyard-neo-explicit-default-profile

Conversation

@Tsukumi233
Copy link
Copy Markdown

@Tsukumi233 Tsukumi233 commented May 12, 2026

修复 Shipyard Neo 在 AstrBot 里错误地把 python-default 当成“默认占位值”的问题。现在只要 profile 非空,就会按用户显式配置传给 Bay;只有 profile 为空时,才自动扫描并优先选择带 browser capability 的 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.py
  • uv run ruff format .
  • uv run ruff check .

Checklist / 检查清单

  • 😊 如果这个 PR 里有新功能,我已经通过 Issue / 邮件等方式和作者讨论过。
  • 👀 我的更改已经充分测试,并且上方已经提供了“验证步骤”和“运行截图/日志”。
  • 🤓 我确保没有引入新依赖库;如果引入了新依赖,也已同步更新 requirements.txtpyproject.toml
  • 😮 我的更改没有引入恶意代码。

@auto-assign auto-assign Bot requested review from Fridemn and LIghtJUNction May 12, 2026 16:48
@dosubot dosubot Bot added size:S This PR changes 10-29 lines, ignoring generated files. area:provider The bug / feature is about AI Provider, Models, LLM Agent, LLM Agent Runner. labels May 12, 2026
@Tsukumi233 Tsukumi233 changed the title fix: respect explicit Shipyard Neo profile fix: 尊重显式配置的 Shipyard Neo profile May 12, 2026
Copy link
Copy Markdown
Contributor

@sourcery-ai sourcery-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've left some high level feedback:

  • 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.
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.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:provider The bug / feature is about AI Provider, Models, LLM Agent, LLM Agent Runner. size:S This PR changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant