feat(admin): Introduce remote admin settings & implement secureModeEnabled/mcpEnabled (#15935)

This commit is contained in:
Shreya Keshive
2026-01-06 16:38:07 -05:00
committed by GitHub
parent 56092bd782
commit 2fe45834dd
9 changed files with 360 additions and 14 deletions
+17
View File
@@ -88,6 +88,7 @@ import type { PolicyEngineConfig } from '../policy/types.js';
import { HookSystem } from '../hooks/index.js';
import type { UserTierId } from '../code_assist/types.js';
import type { RetrieveUserQuotaResponse } from '../code_assist/types.js';
import type { GeminiCodeAssistSetting } from '../code_assist/types.js';
import { getCodeAssistServer } from '../code_assist/codeAssist.js';
import type { Experiments } from '../code_assist/experiments/experiments.js';
import { AgentRegistry } from '../agents/registry.js';
@@ -356,6 +357,7 @@ export interface ConfigParameters {
disabledSkills?: string[];
experimentalJitContext?: boolean;
onModelChange?: (model: string) => void;
mcpEnabled?: boolean;
onReload?: () => Promise<{ disabledSkills?: string[] }>;
}
@@ -389,6 +391,7 @@ export class Config {
private readonly toolDiscoveryCommand: string | undefined;
private readonly toolCallCommand: string | undefined;
private readonly mcpServerCommand: string | undefined;
private readonly mcpEnabled: boolean;
private mcpServers: Record<string, MCPServerConfig> | undefined;
private userMemory: string;
private geminiMdFileCount: number;
@@ -491,6 +494,7 @@ export class Config {
private readonly experimentalJitContext: boolean;
private contextManager?: ContextManager;
private terminalBackground: string | undefined = undefined;
private remoteAdminSettings: GeminiCodeAssistSetting | undefined;
constructor(params: ConfigParameters) {
this.sessionId = params.sessionId;
@@ -512,6 +516,7 @@ export class Config {
this.toolCallCommand = params.toolCallCommand;
this.mcpServerCommand = params.mcpServerCommand;
this.mcpServers = params.mcpServers;
this.mcpEnabled = params.mcpEnabled ?? true;
this.allowedMcpServers = params.allowedMcpServers ?? [];
this.blockedMcpServers = params.blockedMcpServers ?? [];
this.allowedEnvironmentVariables = params.allowedEnvironmentVariables ?? [];
@@ -894,6 +899,14 @@ export class Config {
return this.terminalBackground;
}
getRemoteAdminSettings(): GeminiCodeAssistSetting | undefined {
return this.remoteAdminSettings;
}
setRemoteAdminSettings(settings: GeminiCodeAssistSetting): void {
this.remoteAdminSettings = settings;
}
shouldLoadMemoryFromIncludeDirectories(): boolean {
return this.loadMemoryFromIncludeDirectories;
}
@@ -1125,6 +1138,10 @@ export class Config {
return this.mcpServers;
}
getMcpEnabled(): boolean {
return this.mcpEnabled;
}
getMcpClientManager(): McpClientManager | undefined {
return this.mcpClientManager;
}