gemini-cli Fix: One Bad Extension No Longer Breaks Loading for All
jesussamuel-byte · ghdev · 2026-10-12
PR #29720 in google-gemini/gemini-cli fixes a fault-tolerance bug in extension loading.
When an allowedExtensions list is configured, a single extension directory that cannot be checked against it made every extension fail to load. Two triggers:
- A missing or unreadable .gemini-extension-install.json
- A pattern in the list that is not a valid regular expression
Both errors were thrown from ExtensionManager.buildExtension() outside its per-extension error handling, so the Promise.all in loadExtensions() rejected and callers such as extensions list exited with an error instead of listing the extensions that were fine.
The fix skips only the affected directory, logs a warning, and loads the rest.
- Directories without usable install metadata now log the existing "file is missing or misconfigured" warning and return null instead of throwing
- Pattern evaluation is wrapped, so an invalid pattern is reported as a warning for that directory and the directory is skipped; the inner handler producing the "Invalid regex pattern in allowedExtensions setting" message is unchanged
- Unchanged behavior: an extension loads only when a pattern matches its source; non-matching extensions are still skipped with the existing warning; the path without an allowlist (including blockGitExtensions) is untouched; patterns are still evaluated in order and stop at the first match, so a valid pattern listed before an invalid one still allows the extension
- The install-time check in installOrUpdateExtension still reports an invalid pattern as an error to the person running the install
- Tests: added coverage for missing/unparsable install metadata and invalid patterns
More from coding & agent
- Agent failures increasingly stem from product decisions, not model intelligence — hazelcough · 2026-10-13
- Native Mac app to message all your AI agents at once is almost ready — msg · 2026-10-13
- Stripe makes payments programmatic for AI agents via Link and Duffel — jeff_weinstein · 2026-10-13
- User says Codex agent burned $2,500 in credits without permission or warning — Yamapama · 2026-10-13
- Deterministic automation and integrations are key to effective AI agents — adamse · 2026-10-13
- Writer ditches $200/mo Opus 5.5 for Gemini 4 over one reason: it writes well — iamtrask · 2026-10-13