Merge pull request #661 from animeshlego5/feat/disable-ai-system-message

feat: Add Toggle to Disable AI System Message Context
This commit is contained in:
Andrew Pareles 2025-05-29 23:58:34 -07:00 committed by GitHub
commit 182af95035
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 28 additions and 2 deletions

View file

@ -678,13 +678,15 @@ class ConvertToLLMMessageService extends Disposable implements IConvertToLLMMess
contextWindow,
supportsSystemMessage,
} = getModelCapabilities(providerName, modelName, overridesOfModel)
const systemMessage = await this._generateChatMessagesSystemMessage(chatMode, specialToolFormat)
const { disableSystemMessage } = this.voidSettingsService.state.globalSettings;
const fullSystemMessage = await this._generateChatMessagesSystemMessage(chatMode, specialToolFormat)
const systemMessage = disableSystemMessage ? '' : fullSystemMessage;
const modelSelectionOptions = this.voidSettingsService.state.optionsOfModelSelection['Chat'][modelSelection.providerName]?.[modelSelection.modelName]
// Get combined AI instructions
const aiInstructions = this._getCombinedAIInstructions();
const isReasoningEnabled = getIsReasoningEnabledState('Chat', providerName, modelName, modelSelectionOptions, overridesOfModel)
const reservedOutputTokenSpace = getReservedOutputTokenSpace(providerName, modelName, { isReasoningEnabled, overridesOfModel })
const llmMessages = this._chatMessagesToSimpleMessages(chatMessages)

View file

@ -1358,6 +1358,26 @@ Alternatively, place a \`.voidrules\` file in the root of your workspace.
<ErrorBoundary>
<AIInstructionsBox />
</ErrorBoundary>
{/* --- Disable System Message Toggle --- */}
<div className='my-4'>
<ErrorBoundary>
<div className='flex items-center gap-x-2'>
<VoidSwitch
size='xs'
value={settingsState.globalSettings.disableSystemMessage}
onChange={(newValue) => {
voidSettingsService.setGlobalSetting('disableSystemMessage', newValue);
}}
/>
<span className='text-void-fg-3 text-xs pointer-events-none'>
{settingsState.globalSettings.disableSystemMessage ? 'Minimal system messages sent' : 'Full system messages sent'}
</span>
</div>
</ErrorBoundary>
<div className='text-void-fg-3 text-xs mt-1'>
{`When enabled, Void will not include anything in the system message except for content you specified in voidrules and AI Instructions.`}
</div>
</div>
</div>
<div className='mt-12 max-w-[600px]'>

View file

@ -279,6 +279,8 @@ class VoidSettingsService extends Disposable implements IVoidSettingsService {
// autoapprove is now an obj not a boolean (1.2.5)
if (typeof readS.globalSettings.autoApprove === 'boolean') readS.globalSettings.autoApprove = {}
if (readS.globalSettings.disableSystemMessage === undefined) readS.globalSettings.disableSystemMessage = false;
}
catch (e) {
readS = defaultState()

View file

@ -434,6 +434,7 @@ export type GlobalSettings = {
showInlineSuggestions: boolean;
includeToolLintErrors: boolean;
isOnboardingComplete: boolean;
disableSystemMessage: boolean;
}
export const defaultGlobalSettings: GlobalSettings = {
@ -447,6 +448,7 @@ export const defaultGlobalSettings: GlobalSettings = {
showInlineSuggestions: true,
includeToolLintErrors: true,
isOnboardingComplete: false,
disableSystemMessage: false,
}
export type GlobalSettingName = keyof GlobalSettings