Skip to content

fix: defer dashboard setup until startup - #9879

Merged
Soulter merged 2 commits into
masterfrom
codex/defer-dashboard-setup
Aug 31, 2026
Merged

fix: defer dashboard setup until startup#9879
Soulter merged 2 commits into
masterfrom
codex/defer-dashboard-setup

Conversation

@Soulter

@Soulter Soulter commented Aug 31, 2026

Copy link
Copy Markdown
Member

Motivation

Running astrbot init checked and prepared WebUI assets, which imported the core configuration too early. This could generate the initial Dashboard password during initialization, so it was no longer available for astrbot run to print on first startup.

Modifications / 改动点

  • Defer Dashboard asset preparation from astrbot init to astrbot run.

  • Keep initial Dashboard password generation and output in the first startup flow.

  • Replace the plain missing-WebUI response with a minimal bilingual recovery page.

  • Explain the automatic download/restart flow and the separate manual installation steps.

  • Use the Dashboard primary color for links and buttons, without box shadows.

  • Add regression coverage for CLI initialization and the Dashboard fallback page.

  • This is NOT a breaking change. / 这不是一个破坏性变更。

Screenshots or Test Results / 运行截图或测试结果

Verification steps:

uv run pytest tests/test_cli_init.py tests/test_cli_run.py tests/unit/test_config.py tests/test_fastapi_v1_dashboard.py::test_dashboard_static_dist_files_are_served -q
uv run ruff format .
uv run ruff check .

Results:

  • 52 tests passed.
  • Ruff formatting reported 502 files unchanged.
  • Ruff checks passed.
  • Manual verification confirmed that astrbot init -y does not create the core config, while the first successful astrbot run prints the initial username and password.

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.txt and pyproject.toml. / 我确保没有引入新依赖库,或者引入了新依赖库的同时将其添加到 requirements.txtpyproject.toml 文件相应位置。
  • 😮 My changes do not introduce malicious code. / 我的更改没有引入恶意代码。

Summary by Sourcery

Defer Dashboard setup to startup so the initial credentials remain available for first-run output and provide actionable guidance when WebUI assets are unavailable.

Bug Fixes:

  • Defer Dashboard asset handling until application startup so initialization no longer creates the initial Dashboard configuration or consumes the first-startup credentials.

Enhancements:

  • Replace the missing-WebUI plain-text response with a bilingual recovery page covering automatic recovery, manual installation, release downloads, and callback reachability.

Tests:

  • Add regression coverage confirming CLI initialization leaves the core configuration uncreated and validating the bilingual Dashboard fallback page.

Chores:

  • Remove redundant WebChat migration logging while preserving error propagation.

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

Sorry @Soulter, you've used your own review budget of 250,000 diff characters for the last 7 days.

You can request another review in 1 day and 8 hours by commenting @sourcery-ai review. Upgrade to get a review now.

@Soulter
Soulter merged commit 2ea3bd7 into master Aug 31, 2026
21 of 22 checks passed
@Soulter
Soulter deleted the codex/defer-dashboard-setup branch August 31, 2026 02:35
Komorebiehco pushed a commit to Komorebiehco/AstrBot that referenced this pull request Sep 1, 2026
* fix: defer dashboard setup until startup

* refactor(migration): remove logging statements from webchat session migration
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant