Bugfix: Fix inability to retrieve images and preview documents from local knowledge base - #3589
Merged
Conversation
Contributor
There was a problem hiding this comment.
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.
WMC001
approved these changes
Aug 5, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
修复无法从本地知识库检索图片和文档的问题
