-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Feat/improve file attachments #7080
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feat/improve file attachments #7080
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This pull request implements a comprehensive file attachment system with multiple ingestion modes, allowing users to choose how documents are processed in chat conversations. The feature supports automatic, inline injection, embeddings-based indexing, and per-file prompting modes, with special handling for local models that can estimate context usage.
Key Changes:
- Added four attachment processing modes: Auto (with context threshold), Include in chat (inline injection), Ingest as embeddings (RAG), and Ask every time (prompt per file)
- Implemented intelligent context estimation for local models to automatically decide between inline injection and embeddings based on available context
- Created a centralized attachment processing library that handles both images and documents with proper error handling and status updates
Reviewed changes
Copilot reviewed 31 out of 32 changed files in this pull request and generated 10 comments.
Show a summary per file
| File | Description |
|---|---|
| web-app/src/lib/attachmentProcessing.ts | New centralized attachment processing logic with support for inline and embedding modes |
| web-app/src/hooks/useChatAttachments.ts | New Zustand store for managing attachments per thread with transfer functionality |
| web-app/src/hooks/useAttachmentIngestionPrompt.ts | New hook for showing modal dialog to prompt user for ingestion mode choice |
| web-app/src/containers/dialogs/AttachmentIngestionDialog.tsx | New dialog component for attachment ingestion mode selection |
| web-app/src/lib/messages.ts | Updated to inject inline file contents into chat completion messages |
| web-app/src/lib/completion.ts | Modified to include inline documents in message metadata |
| web-app/src/hooks/useChat.ts | Refactored to use centralized attachment processing with context estimation |
| web-app/src/containers/ChatInput.tsx | Updated to use new attachment store and process documents with mode selection |
| web-app/src/containers/ThreadContent.tsx | Enhanced to display attachment indicators and allow viewing inline content |
| web-app/src/routes/settings/attachments.tsx | Added new settings for parse mode and auto-inline threshold |
| web-app/src/hooks/useAttachments.ts | Added parseMode and autoInlineContextRatio settings |
| extensions/rag-extension/src/index.ts | Implemented parseDocument method for text extraction |
| extensions/rag-extension/settings.json | Added new settings UI for parse mode and auto-inline threshold |
| extensions/llamacpp-extension/src/index.ts | Enhanced embed function to handle large documents with dynamic ubatch sizing and chunk aggregation |
| web-app/src/locales/*/common.json | Added translation strings for attachment indicators and dialog (incomplete translations) |
| web-app/src/locales/*/settings.json | Added translation strings for new attachment settings |
| web-app/package.json | Updated @tanstack/react-router from 1.117.0 to ^1.121.34 |
| yarn.lock | Updated dependencies for react-router and related packages |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review for a chance to win a $100 gift card. Take the survey.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 32 out of 33 changed files in this pull request and generated 20 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review for a chance to win a $100 gift card. Take the survey.
This reverts commit 8518486.
Implemented batch‑based embedding for both rag-extension and vector-db-extension. - Introduced a `batchSize` parameter with a sensible default. - Processed texts in chunks to avoid large single calls to the LlamaCPP embed API. - Mapped batch results to global indices and added per‑batch error handling. - Logged failures and re‑thrown errors with contextual information. This change improves memory usage, resilience to API timeouts, and overall scalability of the embedding pipeline.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 32 out of 33 changed files in this pull request and generated 7 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review for a chance to win a $100 gift card. Take the survey.
…e-file-attachments
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 32 out of 33 changed files in this pull request and generated 13 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review for a chance to win a $100 gift card. Take the survey.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 34 out of 35 changed files in this pull request and generated 4 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Describe Your Changes
Settings page
Auto mode Llama.cpp
Dialog showing selection options
With multiple files
Fixes Issues
Self Checklist