feat: increase vault context limits and make them configurable

- Replace hardcoded 2000-char context limit with configurable maxContextLength
  setting (default: 8000 characters)
- Increase vaultSearchLimit default from 3 to 5 notes
- Add 'Max Context Length' setting to plugin settings UI
- Update README with new defaults
- Update chat-view tests for new setting
This commit is contained in:
2026-05-20 01:20:49 +02:00
parent f09e134948
commit 8e338afeac
7 changed files with 40 additions and 9 deletions
+2 -2
View File
@@ -434,7 +434,7 @@ export class ChatView extends ItemView {
return;
}
const MAX_CONTEXT_LENGTH = 2000;
const maxContextLength = this.settings.maxContextLength;
const tools = this.getTools();
const messageId = crypto.randomUUID();
const userMessageId = `${messageId}-user`;
@@ -490,7 +490,7 @@ export class ChatView extends ItemView {
return parts.join('\n');
})
.join('\n\n')
.slice(0, MAX_CONTEXT_LENGTH);
.slice(0, maxContextLength);
const userMessageWithContext = context
? `Relevant vault context:\n${context}\n\nUser question:\n${userMessage}`
: userMessage;