#10372: Fix google-gemini-cli-auth to work on Windows
extensions: google-gemini-cli-auth
stale
Cluster:
OAuth and CLI Fixes
I ran into #4155/#2233/#4228 while playing around with openclaw today.
I used Gemini to fix it, it fixed the issue for me.
Tried polishing it to be pull request worthy, but if this is far from the repository standards feel free to reject.
Hope this helps!
<!-- greptile_comment -->
<h2>Greptile Overview</h2>
<h3>Greptile Summary</h3>
- Updates the google-gemini-cli-auth extension to locate `oauth2.js` using a new SDK helper (`resolveToolPackageFile`) instead of manual PATH/node_modules probing, improving Windows compatibility.
- Introduces new infra utilities in `src/infra/module-resolution.ts` to resolve files within installed CLI tool packages (supports nested/hoisted deps via `createRequire`).
- Exposes the new module-resolution helpers via `src/plugin-sdk/index.ts` so extensions can use them.
- Adjusts OAuth credential extraction tests to mock the SDK helper rather than filesystem/PATH traversal, and adds a new test suite for the resolver helper itself.
<h3>Confidence Score: 4/5</h3>
- This PR is largely safe to merge, but the new test file has correctness/cleanliness issues that should be fixed first.
- Core runtime changes are straightforward and scoped (credential extraction now delegates to a resolver helper). The main concerns are in the newly added module-resolution test: trailing whitespace flagged by `git diff --check` and a duplicated mock implementation that can make the test pass without exercising the intended behavior.
- src/infra/module-resolution.test.ts
<!-- greptile_other_comments_section -->
<sub>(2/5) Greptile learns from your feedback when you react with thumbs up/down!</sub>
<!-- /greptile_comment -->
Most Similar PRs
#6045: fix(auth): fix Gemini CLI path detection for global npm installs on...
by ehgamemo · 2026-02-01
86.0%
#7781: fix: resolve Google Gemini CLI auth credential extraction #4585
by ManojPanda3 · 2026-02-03
84.9%
#10984: OpenClaw lists gemini-2.0-flash but misses gemini-2.5-flash-lite (G...
by jatinb92 · 2026-02-07
78.3%
#2657: fix: use TLS 1.2 for gemini-cli and google-antigravity OAuth reques...
by PrentissLiu · 2026-01-27
77.8%
#23139: test: fix flaky auth tests when OPENCLAW_GATEWAY_TOKEN is present
by Imccccc · 2026-02-22
77.4%
#3521: fix(gemini-auth): handle mise shims and nested node_modules paths
by sebslight · 2026-01-28
76.6%
#15767: Fix: Gemini REQUIRED_FIELD_MISSING on corrupted toolResults
by janhcla · 2026-02-13
75.7%
#4550: fix: sync google-gemini-cli-auth tokens from external CLI (#3803)
by SalimBinYousuf1 · 2026-01-30
75.3%
#7913: fix: fixed gemini-cli usage not working for preview models
by RomanHotsiy · 2026-02-03
74.4%
#11048: fix: address repository issues (env, author, CI comments, security ...
by cavula · 2026-02-07
74.4%