Skip to content

fix: avoid WebUI ready banner when assets missing#8804

Merged
Soulter merged 1 commit into
masterfrom
codex/fix-webui-ready-log
Jun 15, 2026
Merged

fix: avoid WebUI ready banner when assets missing#8804
Soulter merged 1 commit into
masterfrom
codex/fix-webui-ready-log

Conversation

@Soulter

@Soulter Soulter commented Jun 15, 2026

Copy link
Copy Markdown
Member

Summary

  • Check dashboard static entry files before printing the WebUI ready banner
  • Log a clear warning and start only the web backend/API path when WebUI assets are missing
  • Add regression coverage for missing WebUI static files

Fixes #8795

Tests

  • uv run ruff format .
  • uv run ruff check .
  • uv run pytest tests/test_dashboard.py::test_dashboard_ssl_missing_cert_and_key_falls_back_to_http tests/test_dashboard.py::test_dashboard_run_skips_ready_banner_when_static_files_missing

Summary by Sourcery

Guard the WebUI startup flow against missing static assets and adjust logging and readiness output accordingly.

Bug Fixes:

  • Avoid printing the WebUI ready banner and implying a functional frontend when required static files are missing, while still starting the backend APIs.

Tests:

  • Extend dashboard SSL fallback test to run with an explicit WebUI directory containing minimal assets.
  • Add a regression test verifying that dashboard run logs a warning, starts only the web backend, and skips the WebUI ready banner when static files are missing.

@dosubot dosubot Bot added size:M This PR changes 30-99 lines, ignoring generated files. area:webui The bug / feature is about webui(dashboard) of astrbot. labels Jun 15, 2026

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Hey - I've reviewed your changes and they look great!


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.

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

Copy link
Copy Markdown
Contributor

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 adds a check to verify if WebUI static files are present before starting the dashboard, falling back to starting only the backend APIs and skipping the ready banner if they are missing. Corresponding unit tests were also added. Feedback on the changes highlights a critical issue: skipping the ready banner entirely when static files are missing prevents the initial generated credentials from being printed, permanently locking the user out. It is recommended to customize the banner to display backend API details and credentials even when frontend assets are missing.

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.

Comment thread astrbot/dashboard/server.py Outdated
Comment thread astrbot/dashboard/server.py Fixed
@Soulter Soulter force-pushed the codex/fix-webui-ready-log branch 2 times, most recently from 93e3552 to 77a26e5 Compare June 15, 2026 14:47
@Soulter Soulter force-pushed the codex/fix-webui-ready-log branch from 77a26e5 to 26c71c1 Compare June 15, 2026 14:54
@dosubot dosubot Bot added size:XS This PR changes 0-9 lines, ignoring generated files. and removed size:M This PR changes 30-99 lines, ignoring generated files. labels Jun 15, 2026
@Soulter Soulter merged commit a938620 into master Jun 15, 2026
21 checks passed

@Cyrene2026 Cyrene2026 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

我重新验证了一下:按照当前逻辑,只要 data/dist/index.html 存在,AstrBot 就会打印 WebUI is ready。
但我只是在 data/dist 里放了一个空的 index.html,没有 assets/,WebUI 仍然被判定为 ready。
这说明这里检查的并不是 WebUI 是否真的可用,而只是 index.html 是否存在。一个空文件都能通过,很显然,这里并不是真正检查 WebUI readiness check

@Soulter

Soulter commented Jun 16, 2026

Copy link
Copy Markdown
Member Author

我重新验证了一下:按照当前逻辑,只要 data/dist/index.html 存在,AstrBot 就会打印 WebUI is ready。
但我只是在 data/dist 里放了一个空的 index.html,没有 assets/,WebUI 仍然被判定为 ready。
这说明这里检查的并不是 WebUI 是否真的可用,而只是 index.html 是否存在。一个空文件都能通过,很显然,这里并不是真正检查 WebUI readiness check

有谁会这样做。。

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

Labels

area:webui The bug / feature is about webui(dashboard) of astrbot. size:XS This PR changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] WebUI 下载dashboard.zip失败后,日志显示下载失败,WebUI将不可用,但是出现WebUI is ready的提示

3 participants