Commit graph

753 commits

Author SHA1 Message Date
Wenzheng Jiang
61d423fd5f
Merge branch '3.1.0-preview' into memory-preview 2025-09-24 17:58:54 +09:00
Logan Yang
731a8e819e
3.0.3 (#1842) 2025-09-22 20:39:48 -07:00
Logan Yang
97f3b5d2c4
Update model setting buttons (#1843)
* Add grok 4 fast openrouter

* Update model setting buttons
2025-09-22 20:13:03 -07:00
Logan Yang
7bed022d8a
fix: adjust vertical positioning in ModelTable component (#1840) 2025-09-22 19:34:40 -07:00
wenzhengjiang
54b4241d8b Implement Persistent Memory for Copilot 2025-09-23 10:24:28 +09:00
Wenzheng Jiang
36f74c6192
Revert "Implement User Memory Feature for Enhanced Conversational Context" (#1839) 2025-09-22 18:08:44 -07:00
Emt-lin
86b7fcab88
feat: add mobile-responsive components for settings. (#1813)
* feat: add mobile-responsive components for settings.
* fix: Restrict HelpTooltip components to only affect mobile devices.
* fix: fix the args.diff case test.
2025-09-22 18:06:54 -07:00
Logan Yang
047d42c5a7
Update sources styling (#1838) 2025-09-22 17:19:17 -07:00
Logan Yang
feeea21127
Drop user and bot icons to save space and add shade to user message (#1837) 2025-09-22 14:22:52 -07:00
Wenzheng Jiang
058f6ebfcb
Merge pull request #1818 from logancyang/memory
Implement User Memory Feature for Enhanced Conversational Context
2025-09-22 19:59:04 +09:00
wenzhengjiang
1e3a2ae293 Fix test 2025-09-22 16:55:00 +09:00
Logan Yang
09124e19e5
Add OpenRouter GPT-4.1 models to projects mode (#1832) 2025-09-22 00:39:58 -07:00
wenzhengjiang
a4ea53d2db Minor fixes 2025-09-22 16:23:56 +09:00
Logan Yang
dd7e9e185f
Refactor active note inclusion and index event handling to respect setting (#1831)
* Refactor active note inclusion logic

* Refactor IndexEventHandler to manage event listeners based on semantic search settings

- Introduced `shouldHandleEvents` method to determine if indexing-related events should be processed.
- Replaced `initializeEventListeners` with `syncEventListeners` to conditionally register listeners based on settings.
- Added `teardownEventListeners` method to clean up listeners and reset state when not needed.
- Subscribed to settings changes to dynamically manage event listeners.
2025-09-22 00:02:20 -07:00
wenzhengjiang
00b24270ce Merge branch '3.1.0-preview' into memory 2025-09-22 15:26:42 +09:00
Wenzheng Jiang
351e23e12c
Merge branch '3.1.0-preview' into memory 2025-09-22 15:22:15 +09:00
Logan Yang
8076a0e171
Refactor constants and settings to enhance folder management (#1830)
* Refactor constants and settings to enhance folder management

- Introduced `COPILOT_FOLDER_ROOT` constant to streamline folder path definitions.
- Updated `DEFAULT_CHAT_HISTORY_FOLDER` and `DEFAULT_CUSTOM_PROMPTS_FOLDER` to use the new root constant for improved organization.
- Added `DEFAULT_QA_EXCLUSIONS_SETTING` to ensure consistent exclusion of the Copilot folder in QA settings.
- Implemented `sanitizeQaExclusions` function to normalize QA exclusion patterns, ensuring the Copilot folder is properly excluded from settings.

* Update log file management to reduce in-memory buffer size

- Decreased the in-memory ring buffer from 1000 to 500 entries to optimize memory usage.
- Adjusted documentation to reflect the new buffer size for clarity.
- Updated log truncation logic in BaseChainRunner to use a constant for maximum log length, enhancing maintainability.

* Add unit tests for sanitizeQaExclusions function

- Introduced a new test file `model.test.ts` to validate the behavior of the `sanitizeQaExclusions` function.
- Added tests to ensure proper handling of non-string values, distinct slash-only patterns, and normalization of trailing slashes.
- Enhanced the `sanitizeQaExclusions` function in `model.ts` to improve key handling and normalization logic for QA exclusion patterns.
2025-09-21 20:56:52 -07:00
Logan Yang
92d6f98af2
Implement inline citation (#1821)
* Implement inline citation for vault search for both vault QA and Plus chains

refactor: enhance citation utilities and improve source handling in chain runners

- Introduced new utility functions for citation management, including sanitization and formatting of source catalogs.
- Updated CopilotPlusChainRunner and VaultQAChainRunner to utilize the new citation utilities for improved citation handling.
- Enhanced ChatSingleMessage component to consolidate duplicate sources and ensure accurate citation numbering.
- Added comprehensive tests for citation utilities to ensure functionality and edge case handling.

refactor: dedupe chunks for unique titles in search tool sources

refactor: enhance citation handling in CopilotPlus and VaultQA chain runners

- Introduced a sanitization function to remove pre-existing citation markers from document content, preventing number leakage.
- Updated the formatting of retrieved documents in VaultQA to utilize the new sanitization function for cleaner output.
- Improved footnote renumbering logic in ChatSingleMessage to prioritize first-mention order, ensuring accurate citation mapping.

refactor: streamline source citation handling in ChatSingleMessage component and enhance web search tool instructions

- Simplified the processing of source links in ChatSingleMessage to use a more efficient mapping approach.
- Updated the web search tool's instruction to clarify the use of footnote-style citations, ensuring compatibility with Markdown formatting.

* feat: add inline citation setting toggle and refactor

- Introduced a new setting to enable inline citations in AI-generated responses, allowing for footnote-style references within the text.
- Updated citation utilities to manage fallback sources and improve citation instructions based on user settings.
- Enhanced CopilotPlusChainRunner and VaultQAChainRunner to utilize the new inline citation feature, ensuring accurate source representation.
- Modified ChatSingleMessage component to process inline citations based on the new setting, improving the display of sources in chat messages.
- Added tests for new citation functionalities to ensure reliability and correctness.

* feat: enhance citation utilities and add tests for normalization

- Introduced the `normalizeCitations` function to improve citation formatting by removing periods after citations and handling footnote references.
- Updated `processInlineCitations` to ensure correct mapping of non-sequential citations and consolidate duplicate sources.
- Added comprehensive tests for the new citation functionalities, ensuring accurate citation processing and representation in AI-generated responses.
- Modified QASettings description for clarity regarding the inline citations feature.

* fix: address critical bug in citation processing for consecutive citations

- Enhanced the `normalizeCitations` function to correctly handle consecutive citations without spaces, ensuring accurate mapping and representation in output.
- Added a test case to replicate and validate the fix for the identified bug, confirming that both citations are processed and displayed correctly.
- Updated existing citation handling logic to improve robustness and prevent unconverted citations in the output.

* refactor: improve citation handling and enhance citation utilities

- Refactored `CopilotPlusChainRunner` to streamline citation source management, replacing `lastCitationLines` with `lastCitationSources` for better clarity and structure.
- Updated the `addFallbackSources` function to handle citation formatting more effectively, ensuring proper display of titles and paths.
- Enhanced the `normalizeCitations` function to support multiple citations in brackets, ensuring correct sorting and mapping of citation numbers.
- Added new test cases to validate the handling of alternate headings, HTML summaries, and multiple citations, improving overall robustness of citation processing.
- Introduced `getWebSearchCitationInstructions` for web-specific citation guidance, enhancing user experience with clear instructions for inline citations.

* fix: move documentations

* refactor: normalize footnote rendering in ChatSingleMessage component

- Introduced `normalizeFootnoteRendering` function to streamline footnote display by removing separators and backreferences, and fixing numbering artifacts.
- Updated `ChatSingleMessage` to utilize the new normalization function, enhancing the clarity and presentation of footnotes in chat messages.
- Added unit tests for `normalizeFootnoteRendering` to ensure proper functionality and handling of various footnote scenarios.

* test: enhance ChatSingleMessage tests and add deduplication tests for search tools

- Updated `ChatSingleMessage.test.tsx` to include `TooltipProvider` for improved rendering context.
- Refactored mock implementation for `obsidian` to streamline testing setup.
- Introduced new test file `SearchTools.dedupe.test.ts` to validate the deduplication logic in search tool sources, ensuring correct handling of duplicate entries while preserving the highest score.
- Added tests to verify deduplication behavior for various scenarios, enhancing overall test coverage and reliability.
2025-09-21 20:03:09 -07:00
wenzhengjiang
094e3f8af0 Add support for "@memory" command in builtin tools. 2025-09-21 18:35:47 +09:00
Wenzheng Jiang
70d37fe52f
Merge branch '3.1.0-preview' into memory 2025-09-21 18:24:06 +09:00
Wenzheng Jiang
a7c7823ba4
Map Copilot aliases to builtin tools (#1829) 2025-09-20 19:48:43 -07:00
wenzhengjiang
dd47de2eab Update design doc 2025-09-20 21:44:24 +09:00
wenzhengjiang
ea72057544 Improve timestamp format 2025-09-20 21:37:40 +09:00
wenzhengjiang
e3af03c8de Support "@memory" in non-agent mode 2025-09-20 21:20:20 +09:00
Zero Liu
e3f232f795
Fix chat crash issue (#1827) 2025-09-19 14:37:29 -07:00
wenzhengjiang
d867546fa6 Fix memory setting check 2025-09-16 09:58:23 +09:00
wenzhengjiang
9e3f501ba3 Update savedMemory setting 2025-09-16 09:53:06 +09:00
Wenzheng Jiang
b65600522e
FIX: Supporting creating new folders in composer tools (#1796)
* Create non-existent folder in composer tools

* Improve getFile
2025-09-15 17:28:19 -07:00
wenzhengjiang
deac33bba3 Fix test 2025-09-15 23:31:09 +09:00
wenzhengjiang
3da77b4ddf Update design doc 2025-09-15 23:27:11 +09:00
wenzhengjiang
1765366993 Implement memory tool. 2025-09-15 23:24:41 +09:00
wenzhengjiang
502d57a44b Rename memory functions 2025-09-15 22:36:33 +09:00
wenzhengjiang
cbe7b8c408 Better memory prompt and fix conversation parsing 2025-09-15 22:18:23 +09:00
wenzhengjiang
c836de32c1 Refactor for a simpiler implementation 2025-09-15 20:02:45 +09:00
wenzhengjiang
2a9ac449c0 Fix build error 2025-09-15 19:12:11 +09:00
wenzhengjiang
2ff8020002 Backfill condensedUserMessage 2025-09-15 18:15:39 +09:00
wenzhengjiang
3cd9eb5186 Replace console.error with logError 2025-09-15 17:52:58 +09:00
wenzhengjiang
06b635cdb2 Improve documentation and remove unused code 2025-09-15 17:25:11 +09:00
wenzhengjiang
addbefdaa0 Use logError for error logging 2025-09-13 22:33:56 +09:00
wenzhengjiang
6c078808db Refactor UserMemoryManager to utilize utility function for folder creation 2025-09-13 22:31:47 +09:00
wenzhengjiang
24bf217b1c Fix PR issues 2025-09-13 16:59:50 +09:00
Logan Yang
6f18acc0cc
Update README.md (#1819) 2025-09-12 22:17:15 -07:00
wenzhengjiang
0a6b6fa2a0 Fix user message formatting 2025-09-13 10:27:28 +09:00
Logan Yang
b18782040e
feat: conditionally initialize VectorStoreManager and enhance relevant notes handling based on semantic search setting (#1817) 2025-09-12 18:26:18 -07:00
wenzhengjiang
88417353d0 Merge master into memory branch 2025-09-13 09:11:18 +09:00
wenzhengjiang
e44c3d17b7 Support multiple conclusions and add unit tests 2025-09-13 09:09:45 +09:00
Logan Yang
0d477f869e
feat: enhance folder management by ensuring nested folder paths exist (#1816)
- Make sure nested folder works cross-platform
- Move defaults under copilot parent folder
- Update log file to only create on manual trigger
2025-09-12 16:30:30 -07:00
wenzhengjiang
6dac3742d3 Add maxRecentConversations setting and update memory formatting 2025-09-12 18:27:56 +09:00
wenzhengjiang
e0127270f3 Remove user insights/long-term memory functionality
- Removed user insights extraction and storage logic
- Simplified UserMemoryManager to focus only on recent conversations
- Updated memory design documentation to reflect current implementation
- Maintains recent conversation tracking with 40-line rolling buffer
- No breaking changes to public API
2025-09-12 16:27:53 +09:00
Logan Yang
5a2d4603b4
feat: add setting to generate AI chat title on save (#1811) 2025-09-11 18:36:40 -07:00