Skip to content

fix(kb): distinguish loading errors from empty states - #9578

Merged
Soulter merged 2 commits into
AstrBotDevs:masterfrom
lxfight:fix/kb-loading-states
Aug 7, 2026
Merged

fix(kb): distinguish loading errors from empty states#9578
Soulter merged 2 commits into
AstrBotDevs:masterfrom
lxfight:fix/kb-loading-states

Conversation

@lxfight

@lxfight lxfight commented Aug 7, 2026

Copy link
Copy Markdown
Member

Failed knowledge base requests currently fall through to empty or zero-value content, which makes service failures look like missing data.

Modifications / 改动点

  • Added explicit retryable error states for the knowledge base list and detail views.
  • Added separate document-detail and chunk-list failure states.
  • Preserved already loaded list content when a refresh fails.
  • Added localized retry and failure labels for Chinese, English, and Russian.
  • This is NOT a breaking change. / 这不是一个破坏性变更。

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

Verification steps:

  • cd dashboard && pnpm typecheck
  • cd dashboard && node --test tests/*.test.mjs (36 passed)
  • uv run ruff format . (499 files unchanged)
  • uv run ruff check . (passed)

The change reuses the existing AstrBot empty-state, alert, and tonal button styles. No global layout or theme styles were changed.

Knowledge base loading failure with retry action:

Knowledge base loading failure with retry action

Checklist / 检查清单

  • 😊 No new feature is introduced; issue discussion is not applicable.
  • 👀 The changes were self-reviewed and the verification steps and results are provided above.
  • 🤓 No new dependencies are introduced.
  • 😮 The changes do not introduce malicious code.

Summary by Sourcery

Improve error handling and user feedback for knowledge base list, detail, and document chunk views.

Bug Fixes:

  • Prevent failed knowledge base list, detail, and document requests from appearing as empty states by introducing explicit error flags and UI states.
  • Ensure chunk list loading failures are surfaced via an alert with retry instead of silently failing or showing empty data.
  • Preserve previously loaded knowledge base list content when refresh requests fail instead of clearing to an apparent empty list.

Enhancements:

  • Add localized load-error and retry messaging for knowledge base views in English, Chinese, and Russian to align with existing UI patterns.

Summary by Sourcery

Improve error handling and user feedback for knowledge base list, detail, and document views when backend requests fail.

Bug Fixes:

  • Prevent failed knowledge base list, detail, and document chunk requests from appearing as empty or zero-value states by introducing explicit error flags and failure UIs.
  • Preserve previously loaded knowledge base list content when refresh requests fail instead of clearing the list or showing misleading emptiness.

Enhancements:

  • Add localized load-error and retry messaging and UI for knowledge base list, detail, and document chunk views across supported languages.

@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. feature:knowledge-base The bug / feature is about knowledge base labels Aug 7, 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 left some high level feedback:

  • The new error-with-retry UIs in KBList, KBDetail, and DocumentDetail share very similar structure; consider extracting a small reusable component (icon + message + retry button) so the layout and behavior stay consistent and easier to adjust later.
  • In DocumentDetail.vue, loadError and chunksLoadError are used alongside snackbars; if the intent is for inline error UI to be the primary feedback, you might want to reduce or conditionally suppress duplicate snackbar messages to avoid noisy, redundant error reporting.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- The new error-with-retry UIs in KBList, KBDetail, and DocumentDetail share very similar structure; consider extracting a small reusable component (icon + message + retry button) so the layout and behavior stay consistent and easier to adjust later.
- In DocumentDetail.vue, `loadError` and `chunksLoadError` are used alongside snackbars; if the intent is for inline error UI to be the primary feedback, you might want to reduce or conditionally suppress duplicate snackbar messages to avoid noisy, redundant error reporting.

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.

@Soulter
Soulter merged commit 0024a5d into AstrBotDevs:master Aug 7, 2026
40 checks passed
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. feature:knowledge-base The bug / feature is about knowledge base size:M This PR changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants