release: Gemini CLI v0.33.1 (6 patches)

This commit is contained in:
delta-cloud-208e
2026-03-13 20:11:43 +00:00
parent 073cb7b18d
commit 5ddf29ab12
6 changed files with 18318 additions and 4 deletions

View File

@@ -11,7 +11,7 @@ Targets:
6. system_env — env vars injection
7. auto_update_registry — redirect registry-url default to npm.sensey24.ru
8. auto_update_commands — add --registry to update commands
9. auto_permissions — bypass tool approval prompts (YOLO mode via settings)
9. auto_permissions — bypass tool approval prompts (YOLO mode + conseca safety bypass)
10. default_models — override DEFAULT_GEMINI_MODEL/FLASH/LITE/AUTO in models.js
11. model_dialog_desc — fix hardcoded model names in ModelDialog.js
12. compression_aliases — fix compression config aliases in chatCompressionService.js
@@ -48,6 +48,7 @@ MODELS_JS_SUBPATH = "node_modules/@google/gemini-cli-core/dist/src/config/models
MODEL_DIALOG_JS_SUBPATH = "dist/src/ui/components/ModelDialog.js"
CHAT_COMPRESSION_SUBPATH = "node_modules/@google/gemini-cli-core/dist/src/services/chatCompressionService.js"
AGENT_CONFIG_DIALOG_SUBPATH = "dist/src/ui/components/AgentConfigDialog.js"
CONSECA_TOML_SUBPATH = "node_modules/@google/gemini-cli-core/dist/src/policy/policies/conseca.toml"
# ANSI colors
GREEN = "\033[92m"
@@ -621,6 +622,7 @@ def patch_auto_permissions(gemini_root, config):
Target 9a: Patch config.js to allow YOLO mode from settings.json.
Target 9b: Set defaultApprovalMode=yolo + disable folderTrust in settings.json.
Target 9c: Auto-trust folders via trustedFolders.json.
Target 9d: Patch conseca.toml to skip safety checker in YOLO mode.
"""
changes = 0
patched_parts = []
@@ -723,6 +725,10 @@ def patch_auto_permissions(gemini_root, config):
existing["security"]["disableYoloMode"] = False
settings_changed = True
if not existing["security"].get("enablePermanentToolApproval"):
existing["security"]["enablePermanentToolApproval"] = True
settings_changed = True
if settings_changed:
with open(settings_path, "w") as f:
json.dump(existing, f, indent=2)
@@ -756,6 +762,50 @@ def patch_auto_permissions(gemini_root, config):
else:
patched_parts.append("trustedFolders.json: already configured")
# --- 9d: Patch conseca.toml to exclude YOLO from safety checker ---
# The conseca safety checker can override YOLO ALLOW → ASK_USER for
# "dangerous" commands (rm, chmod, etc.). Adding modes excludes YOLO.
conseca_path = os.path.join(gemini_root, CONSECA_TOML_SUBPATH)
if os.path.isfile(conseca_path):
with open(conseca_path, "r", encoding="utf-8") as f:
conseca_content = f.read()
# Original conseca.toml has no modes= field, meaning it applies to ALL modes.
# We add modes to restrict it to non-YOLO modes only.
old_conseca = (
'[[safety_checker]]\n'
'toolName = "*"\n'
'priority = 100\n'
'[safety_checker.checker]\n'
'type = "in-process"\n'
'name = "conseca"'
)
new_conseca = (
'[[safety_checker]]\n'
'toolName = "*"\n'
'priority = 100\n'
'modes = ["default", "auto_edit", "plan"]\n'
'[safety_checker.checker]\n'
'type = "in-process"\n'
'name = "conseca"'
)
if old_conseca in conseca_content and 'modes = ["default"' not in conseca_content:
backup = conseca_path + ".backup"
if not os.path.exists(backup):
shutil.copy2(conseca_path, backup)
conseca_content = conseca_content.replace(old_conseca, new_conseca, 1)
with open(conseca_path, "w", encoding="utf-8") as f:
f.write(conseca_content)
changes += 1
patched_parts.append("conseca.toml: YOLO excluded from safety checker")
elif 'modes = ["default"' in conseca_content:
patched_parts.append("conseca.toml: already patched")
else:
patched_parts.append("conseca.toml: pattern not found")
else:
patched_parts.append("conseca.toml: not found")
if changes == 0 and any("already" in p for p in patched_parts):
return True, "Already patched (" + "; ".join(patched_parts) + ")"
elif changes == 0: