Skip to content

Gemini: isolate CLI home and set API-key auth#113

Merged
AarushiShah-db merged 3 commits into
mainfrom
fix/gemini-private-home
May 28, 2026
Merged

Gemini: isolate CLI home and set API-key auth#113
AarushiShah-db merged 3 commits into
mainfrom
fix/gemini-private-home

Conversation

@AarushiShah-db
Copy link
Copy Markdown
Collaborator

@AarushiShah-db AarushiShah-db commented May 28, 2026

Newer versions of gemini cli break with ucode (see failing tests in https://github.com/databricks/ucode/actions/runs/26546691234/job/78199961167?pr=112)

Summary

  • Isolate Gemini CLI state to an app-scoped home and default to API‑key auth to avoid mutating a user’s global ~/.gemini.

Motivation

  • Prevent cross-project state leakage when launching Gemini via ucode.
  • Make first‑run and CI behavior deterministic without prior Gemini setup.

Changes

  • Set GEMINI_CLI_HOME to a private app directory: .gemini-home.
  • Write .gemini/settings.json with security.auth.selectedType = "gemini-api-key".
  • Preserve any preexisting settings using deep_merge_dict rather than overwriting.
  • Add unit and e2e tests to redirect the Gemini home and validate settings behavior.

Testing

  • Focused unit tests pass: uv run pytest -q tests/test_agent_gemini.py (29 passed locally).
  • E2E tests with both old version and new version

- Set  to app-scoped \n- Write  with \n- Preserve existing settings via \n- Add unit/e2e tests and fixtures to redirect home paths
@AarushiShah-db AarushiShah-db changed the title Gemini: isolate CLI home and set API-key auth; add tests Gemini: isolate CLI home and set API-key auth May 28, 2026
rohita5l
rohita5l previously approved these changes May 28, 2026
@AarushiShah-db AarushiShah-db force-pushed the fix/gemini-private-home branch from f018f5a to 684b82f Compare May 28, 2026 02:06
@AarushiShah-db AarushiShah-db merged commit 6706226 into main May 28, 2026
2 checks passed
@AarushiShah-db AarushiShah-db deleted the fix/gemini-private-home branch May 28, 2026 04:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants