mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-07-15 20:40:35 -07:00
fix(cli): improve mcp list UX in untrusted folders (#26457)
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
This commit is contained in:
@@ -348,6 +348,15 @@ export class LoadedSettings {
|
||||
return this._merged;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a merged settings object as if the folder were trusted.
|
||||
* This is useful for commands like 'mcp list' that want to show
|
||||
* what's configured even if it's currently disabled for security reasons.
|
||||
*/
|
||||
getMergedSettingsAsIfTrusted(): MergedSettings {
|
||||
return this.computeMergedSettings(true);
|
||||
}
|
||||
|
||||
setTrusted(isTrusted: boolean): void {
|
||||
if (this.isTrusted === isTrusted) {
|
||||
return;
|
||||
@@ -368,13 +377,16 @@ export class LoadedSettings {
|
||||
};
|
||||
}
|
||||
|
||||
private computeMergedSettings(): MergedSettings {
|
||||
private computeMergedSettings(forceTrusted = false): MergedSettings {
|
||||
const isTrusted = forceTrusted || this.isTrusted;
|
||||
const workspace = forceTrusted ? this._workspaceFile : this.workspace;
|
||||
|
||||
const merged = mergeSettings(
|
||||
this.system.settings,
|
||||
this.systemDefaults.settings,
|
||||
this.user.settings,
|
||||
this.workspace.settings,
|
||||
this.isTrusted,
|
||||
workspace.settings,
|
||||
isTrusted,
|
||||
);
|
||||
|
||||
// Remote admin settings always take precedence and file-based admin settings
|
||||
|
||||
Reference in New Issue
Block a user