Skip to content

Bugfix: Fix inability to retrieve images and preview documents from local knowledge base - #3589

Merged
WMC001 merged 12 commits into
developfrom
xyq/bugfix_0804
Aug 5, 2026
Merged

Bugfix: Fix inability to retrieve images and preview documents from local knowledge base#3589
WMC001 merged 12 commits into
developfrom
xyq/bugfix_0804

Conversation

@xuyaqist

@xuyaqist xuyaqist commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

修复无法从本地知识库检索图片和文档的问题
image

Copilot AI lite review requested due to automatic review settings August 4, 2026 09:33

Copilot AI 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.

Pull request overview

This PR fixes frontend handling for assets returned from the local knowledge base by recognizing knowledge_base/ object paths (in addition to attachments/), enabling authenticated image retrieval, and adding a document preview action in the Sources panel. It also updates chat adapters to better attach/search-source metadata (including image results) and adds Chinese documentation for official skills.

Changes:

  • Extend storage object-name extraction and add helpers for identifying local-storage URLs and building preview URLs.
  • Update Sources UI to support document preview + authenticated downloads, and improve image rendering for local KB results.
  • Enhance adapter/source plumbing to preserve richer metadata (including image metadata parsing) and add i18n strings + documentation pages.

Reviewed changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
frontend/services/storageService.ts Adds knowledge_base path handling, local preview URL helper, and an authenticated download flow.
frontend/public/locales/zh/common.json Adds i18n label for source “preview”.
frontend/public/locales/en/common.json Adds i18n label for source “preview”.
frontend/app/[locale]/newchat/ui/tool-fallback.tsx Routes tool “Sources” chips into the Sources panel with richer source metadata.
frontend/app/[locale]/newchat/ui/sources-panel.tsx Adds document preview button, switches document download to authenticated flow, and improves local-image loading.
frontend/app/[locale]/newchat/ui/authenticated-image.tsx Adds support for fetching protected local-KB images via backend.
frontend/app/[locale]/newchat/adapter/remote-chat-model-adapter.ts Parses image metadata from retrieval results and improves searchContent attachment/deduplication.
frontend/app/[locale]/newchat/adapter/conversation-thread-list-adapter.tsx Restores richer tool search items (including image metadata) when loading history.
doc/docs/zh/user-guide/resource-repository/official-skills.md New Chinese doc page describing official skills list and usage.
doc/docs/zh/user-guide/resource-repository/create-docx.md New Chinese doc page for the create-docx official skill and file artifact contract.
doc/docs/.vitepress/config.mts Adds sidebar navigation entries for the new docs pages.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread frontend/app/[locale]/newchat/ui/sources-panel.tsx Outdated
Comment thread frontend/services/storageService.ts
Comment thread frontend/app/[locale]/newchat/adapter/remote-chat-model-adapter.ts
Comment thread frontend/app/[locale]/newchat/ui/authenticated-image.tsx
@WMC001
WMC001 merged commit cf50a90 into develop Aug 5, 2026
8 of 9 checks passed
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.

3 participants