Skip to content

feat(kb): expose resumable upload task status - #9639

Open
lxfight wants to merge 1 commit into
AstrBotDevs:masterfrom
lxfight:feat/kb-resumable-upload-status
Open

feat(kb): expose resumable upload task status#9639
lxfight wants to merge 1 commit into
AstrBotDevs:masterfrom
lxfight:feat/kb-resumable-upload-status

Conversation

@lxfight

@lxfight lxfight commented Aug 12, 2026

Copy link
Copy Markdown
Member

Modifications / 改动点

Backend / 后端

  • 添加 API 端点用于查询上传任务状态
  • 支持可恢复上传任务的追踪
  • 跨会话持久化上传任务状态

Frontend / 前端

  • 在文档列表中显示可恢复的上传任务
  • 显示中断上传的任务状态和进度
  • 允许用户识别和查看失败的上传

主要修改文件:

  • dashboard/src/views/knowledge-base/components/DocumentsTab.vue - 任务状态显示
  • dashboard/src/api/generated/openapi-v1.ts - API 类型定义

改动统计: +636/-37 行

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

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

测试场景:

  • ✅ 正常上传完成
  • ✅ 中断上传(浏览器刷新、连接断开)
  • ✅ 任务状态持久化和恢复
  • ✅ 失败任务的可见性

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.
    / 我的更改没有引入恶意代码。

@dosubot dosubot Bot added size:L This PR changes 100-499 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 12, 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 per-file task metadata structure is duplicated in multiple places (init_task, update_progress, background_*), which makes it easy to introduce inconsistencies; consider extracting a small helper for creating/updating file entries to centralize this logic.
  • update_progress returns silently when task_id is unknown or file_index is out of range, which can hide misuses or bugs; adding explicit logging or raising a clear error in these cases would make failures easier to diagnose.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- The per-file task metadata structure is duplicated in multiple places (init_task, update_progress, background_*), which makes it easy to introduce inconsistencies; consider extracting a small helper for creating/updating file entries to centralize this logic.
- update_progress returns silently when task_id is unknown or file_index is out of range, which can hide misuses or bugs; adding explicit logging or raising a clear error in these cases would make failures easier to diagnose.

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.

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:L This PR changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant