fix(patch): cherry-pick e9a601c to release/v0.23.0-preview.3-pr-15465 to patch version v0.23.0-preview.3 and create version 0.23.0-preview.4 (#15682)

Co-authored-by: Jack Wotherspoon <jackwoth@google.com>
This commit is contained in:
gemini-cli-robot
2025-12-29 13:05:52 -08:00
committed by GitHub
parent dbcad90661
commit 55b0c5cb50
3 changed files with 68 additions and 2 deletions

View File

@@ -219,6 +219,60 @@ describe('settings-validation', () => {
}
});
it('should validate mcpServers with type field for all transport types', () => {
const validSettings = {
mcpServers: {
'sse-server': {
url: 'https://example.com/sse',
type: 'sse',
headers: { 'X-API-Key': 'key' },
},
'http-server': {
url: 'https://example.com/mcp',
type: 'http',
},
'stdio-server': {
command: '/usr/bin/mcp-server',
type: 'stdio',
},
},
};
const result = validateSettings(validSettings);
expect(result.success).toBe(true);
});
it('should reject invalid type values in mcpServers', () => {
const invalidSettings = {
mcpServers: {
'bad-server': {
url: 'https://example.com/mcp',
type: 'invalid-type',
},
},
};
const result = validateSettings(invalidSettings);
expect(result.success).toBe(false);
});
it('should validate mcpServers without type field', () => {
const validSettings = {
mcpServers: {
'stdio-server': {
command: '/usr/bin/mcp-server',
args: ['--port', '8080'],
},
'url-server': {
url: 'https://example.com/mcp',
},
},
};
const result = validateSettings(validSettings);
expect(result.success).toBe(true);
});
it('should validate complex nested customThemes configuration', () => {
const invalidSettings = {
ui: {

View File

@@ -1662,7 +1662,8 @@ export const SETTINGS_SCHEMA_DEFINITIONS: Record<
},
url: {
type: 'string',
description: 'SSE transport URL.',
description:
'URL for SSE or HTTP transport. Use with "type" field to specify transport type.',
},
httpUrl: {
type: 'string',
@@ -1677,6 +1678,12 @@ export const SETTINGS_SCHEMA_DEFINITIONS: Record<
type: 'string',
description: 'TCP address for websocket transport.',
},
type: {
type: 'string',
description:
'Transport type. Use "stdio" for local command, "sse" for Server-Sent Events, or "http" for Streamable HTTP.',
enum: ['stdio', 'sse', 'http'],
},
timeout: {
type: 'number',
description: 'Timeout in milliseconds for MCP requests.',

View File

@@ -1562,7 +1562,7 @@
},
"url": {
"type": "string",
"description": "SSE transport URL."
"description": "URL for SSE or HTTP transport. Use with \"type\" field to specify transport type."
},
"httpUrl": {
"type": "string",
@@ -1579,6 +1579,11 @@
"type": "string",
"description": "TCP address for websocket transport."
},
"type": {
"type": "string",
"description": "Transport type. Use \"stdio\" for local command, \"sse\" for Server-Sent Events, or \"http\" for Streamable HTTP.",
"enum": ["stdio", "sse", "http"]
},
"timeout": {
"type": "number",
"description": "Timeout in milliseconds for MCP requests."