Skip to content
TheChatArchiveThe Chat Archive
DeepSeekdeepseek/deepseek-v4-pro· deepseekHugging Face ibragim-bad/swe_rebench_07_2026_trajectories

ISSUE DESCRIPTION gemini-cli: support Login with Google (oauth-personal), mirroring…

  1. User

    ISSUE DESCRIPTION

    gemini-cli: support Login with Google (oauth-personal), mirroring codex auth.json The codex agent injects a cached OAuth credential (~/.codex/auth.json) so runs can use a login instead of an API key (CODEX_AUTH_JSON_PATH / CODEX_FORCE_AUTH_JSON), and claude-code accepts CLAUDE_CODE_OAUTH_TOKEN (#173). gemini-cli has no equivalent — it only wires GEMINI_API_KEY / Vertex env, so users with a "Login with Google" session (~/.gemini/oauth_creds.json) must keep a separate API key for runs.

    Proposal: add the same opt-in OAuth-credential injection to the gemini-cli agent, mirroring the codex pattern — GEMINI_OAUTH_CREDS_PATH / GEMINI_FORCE_OAUTH, default behavior unchanged (fully backward-compatible).

    I have a working implementation that mirrors the codex auth flow (_resolve_oauth_creds_path → upload → chown → ~/.gemini) with tests ported 1:1 from test_codex_auth.py, verified end-to-end (gemini-cli --ae GEMINI_FORCE_OAUTH=true completed hello-world, reward 1.0). Happy to open the PR or hand it off — whichever you prefer.

    ADDITIONAL ADVICE

    Since you are given a git repository, you can use git commands to simplify your work. For example, if you made a mistake and want to revert your changes, you can use git checkout <file> to restore the file to its original state. You can also reset all changes in the repository using git reset --hard command. Additionally, you can use git stash and git stash pop to temporarily save your changes and restore them later. Finally, you can see the changes that you've made (which will be submitted when you call submit) using git status or git diff commands. However you don't need to use git add or git commit before submitting your changes. In fact, submit only submits currently unstaged changes because it uses git diff to get the changes that need to be submitted.

    CHECKLIST

    Before submitting your solution, please go over the following checklist and make sure you've done everything:

    • If an error was reported in the issue description, I have successfully reproduced it.
    • If an error was reported in the issue description, I have confirmed that my fix resolves the error.
    • I have thought about edge cases and made sure my fix handles them as well.
    • I have run existing tests in the repository that might have been affected by the change I made and confirmed that they pass. I want you to list every bullet from this checklist and write your reasoning for why you think you did it or didn't need to.

    Repository has been uploaded and your shell is currently at the repository root. Time to solve the issue!

    (Current directory: /harbor, current file: none) bash-$

  2. DeepSeek Assistant

    Let me start by exploring the repository structure to understand what we're working with. The issue is about adding OAuth credential injection to gemini-cli, mirroring the codex auth.json pattern. Let me first explore the repository structure.

    Let me look at the repository layout, understand the codebase, and find the relevant files.

  3. DeepSeek Assistant

    This looks like a monorepo. Let me explore the structure more. The issue mentions codex and gemini-cli agents. Let me look at the adapters directory since this seems to be where agents are defined.

  4. DeepSeek Assistant

    Let me look for the codex and gemini-cli adapters specifically.

  5. DeepSeek Assistant

    No results for codex or gemini in adapters. Let me search more broadly.

  6. DeepSeek Assistant

    Let me search for codex and gemini related files in the source code

  7. DeepSeek Assistant

    Let me look at the key files:

  8. DeepSeek Assistant

    Now let me look at the gemini_cli.py file to see how it currently

  9. DeepSeek Assistant

    Now let me look at the codex auth test file to understand how tests are written

  10. DeepSeek Assistant

    Now let me also look at some key supporting files:

  11. DeepSeek Assistant

    Now let me look at the existing tests for gemini_cli:

  12. DeepSeek Assistant

    Let me look at the utility function for parsing boolean

  13. DeepSeek Assistant

    Now let me also check the conftest.py for test fixtures

  14. DeepSeek Assistant

    Let me also check what environment variable the Gemini CLI uses for OAuth credentials.

  15. DeepSeek Assistant

    Let me look at how claude_code handles OAuth tokens for reference:

  16. DeepSeek Assistant

    Now I have a good understanding. Let me implement the changes. I need to:

    1. Add _resolve_oauth_creds_path() to GeminiCli
    2. Modify run() to handle OAuth credentials
    3. Create tests in tests/unit/agents/installed/test_gemini_cli_oauth.py

    Let me first look at the full run() method in gemini_cli.py to understand where to insert the changes:

  17. DeepSeek Assistant

    Let me try opening again.

  18. DeepSeek Assistant

    Let me scroll to see the run method:

  19. DeepSeek Assistant

    Let me scroll further to see the run() method:

  20. DeepSeek Assistant

    Let me see the rest of the file

  21. DeepSeek Assistant

    Now let me check the import for parse_bool_env_value in codex.py

  22. DeepSeek Assistant

    Now I have a full understanding. Let me implement the changes:

    Plan:

    1. Add from harbor.utils.env import parse_bool_env_value import
    2. Add _resolve_oauth_creds_path() method that mirrors _resolve_auth_json_path()
    3. Modify run() to upload OAuth creds when available
    4. Create test_gemini_cli_oauth.py mirroring test_codex_auth.py

    Let's

  23. DeepSeek Assistant

    Let me use replace to add the import line

  24. DeepSeek Assistant

    Let me use a Python script to make the changes:

  25. DeepSeek Assistant

    Let me verify the changes were made correctly

  26. DeepSeek Assistant

    Let me check the full run method to see if the OAuth upload looks correct

  27. DeepSeek Assistant

    I see an issue - the $HOME was stripped. Let me fix the remote paths:

  28. DeepSeek Assistant

    Let me verify the fix

  29. DeepSeek Assistant

    Let me verify the _resolve_oauth_creds_path method:

  30. DeepSeek Assistant

    Now let me create the test file mirroring test_codex_auth.py

  31. DeepSeek Assistant

    Now let me run the tests to make sure everything works

  32. DeepSeek Assistant

    Let me check how tests are usually run in this project

  33. DeepSeek Assistant

    Let me install the package in development mode

  34. DeepSeek Assistant

    Now let me run the tests again

  35. DeepSeek Assistant

    Let me check the pytest configuration:

  36. DeepSeek Assistant

    Let me check the pytest-asyncio package

  37. DeepSeek Assistant

    Let me check if there's a venv that should be used

  38. DeepSeek Assistant

    Let me use the venv to run

  39. DeepSeek Assistant

    All 17 tests pass. Now let me also run the existing gemini_cli tests to make sure nothing is broken

  40. DeepSeek Assistant

    Let me also run the codex auth tests to make sure they still pass

  41. DeepSeek Assistant

    Let me also run the full agent tests to make sure nothing else is broken:

  42. DeepSeek Assistant

    All tests pass. Let me also run the gemini CLI MCP tests

  43. DeepSeek Assistant

    Let me do a final review of the changes by looking at the diff:

  44. DeepSeek Assistant

    Let me also check the new test file:

  45. DeepSeek Assistant

    The new test file is untracked. Let me verify it exists:

Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.