mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-05-20 08:42:39 -07:00
refactor(core): Unified context management settings schema (#24391)
This commit is contained in:
@@ -490,6 +490,7 @@ name = "allowed-path"
|
||||
expect(error.errorType).toBe('schema_validation');
|
||||
expect(error.details).toContain('toolName');
|
||||
expect(error.details).toContain('Invalid input');
|
||||
expect(error.suggestion).toContain('toolName');
|
||||
});
|
||||
|
||||
it('should return a schema_validation error if priority is missing', async () => {
|
||||
@@ -502,6 +503,7 @@ decision = "allow"
|
||||
const error = result.errors[0];
|
||||
expect(error.errorType).toBe('schema_validation');
|
||||
expect(error.details).toContain('priority');
|
||||
expect(error.suggestion).toContain('toolName');
|
||||
});
|
||||
|
||||
it('should return a schema_validation error if priority is a float', async () => {
|
||||
@@ -598,6 +600,7 @@ priority = 100
|
||||
expect(error.errorType).toBe('schema_validation');
|
||||
expect(error.details).toContain('toolName');
|
||||
expect(error.details).toContain('Invalid input');
|
||||
expect(error.suggestion).toContain('toolName');
|
||||
});
|
||||
|
||||
it('should return a schema_validation error if toolName is not a string or array', async () => {
|
||||
|
||||
@@ -383,7 +383,7 @@ export async function loadPoliciesFromToml(
|
||||
message: 'Schema validation failed',
|
||||
details: formatSchemaError(validationResult.error, 0),
|
||||
suggestion:
|
||||
'Ensure all required fields (decision, priority) are present with correct types',
|
||||
'Ensure all required fields (decision, priority, toolName) are present with correct types',
|
||||
});
|
||||
continue;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user