Просмотр исходного кода

fix: address error from system prompt validator (#8571)

- Remove SystemPromptSection.MCP from Gemini-3 component order
- Disable feedback section in XS variant component overrides
- Update variant validator to allow disabled overrides without requiring them in componentOrder/tools list

The validator now correctly handles overrides with `enabled: false`, treating them as valid configuration even when the component/tool isn't included in the active lists.
Bee 1 неделя назад
Родитель
Сommit
ea6cb4b29e

+ 0 - 1
src/core/prompts/system-prompt/variants/gemini-3/config.ts

@@ -38,7 +38,6 @@ export const config = createVariant(ModelFamily.GEMINI_3)
 		SystemPromptSection.EDITING_FILES,
 		SystemPromptSection.FEEDBACK,
 		SystemPromptSection.TODO,
-		SystemPromptSection.MCP,
 		SystemPromptSection.TASK_PROGRESS,
 		SystemPromptSection.SYSTEM_INFO,
 		SystemPromptSection.OBJECTIVE,

+ 16 - 4
src/core/prompts/system-prompt/variants/variant-validator.ts

@@ -125,9 +125,14 @@ export class VariantValidator {
 
 		// Check component overrides reference valid components
 		if (variant.componentOverrides) {
-			const invalidOverrides = Object.keys(variant.componentOverrides).filter(
-				(key) => !variant.componentOrder.includes(key as SystemPromptSection),
-			)
+			const invalidOverrides = Object.keys(variant.componentOverrides).filter((key) => {
+				const override = variant.componentOverrides[key as SystemPromptSection]
+				// Skip overrides that explicitly disable a component - these are valid even without being in componentOrder
+				if (override?.enabled === false) {
+					return false
+				}
+				return !variant.componentOrder.includes(key as SystemPromptSection)
+			})
 			if (invalidOverrides.length > 0) {
 				warnings.push(`Component overrides for unused components: ${invalidOverrides.join(", ")}`)
 			}
@@ -147,7 +152,14 @@ export class VariantValidator {
 
 		// Check tool overrides reference valid tools
 		if (variant.toolOverrides) {
-			const invalidOverrides = Object.keys(variant.toolOverrides).filter((key) => !variant.tools?.includes(key as any))
+			const invalidOverrides = Object.keys(variant.toolOverrides).filter((key) => {
+				const override = variant.toolOverrides![key as keyof typeof variant.toolOverrides]
+				// Skip overrides that explicitly disable a tool - these are valid even without being in tools list
+				if (override?.enabled === false) {
+					return false
+				}
+				return !variant.tools?.includes(key as any)
+			})
 			if (invalidOverrides.length > 0) {
 				warnings.push(`Tool overrides for unused tools: ${invalidOverrides.join(", ")}`)
 			}

+ 1 - 1
src/core/prompts/system-prompt/variants/xs/overrides.ts

@@ -94,6 +94,6 @@ export const xsComponentOverrides: PromptVariant["componentOverrides"] = {
 		enabled: true, // Use default user instructions
 	},
 	[SystemPromptSection.FEEDBACK]: {
-		enabled: true, // Use default feedback section
+		enabled: false,
 	},
 }