Commit 4a94f62
feat: add Google Gemini API proxy support (port 10003) (#1640)
* feat: add Google Gemini API proxy support (port 10003)
Add full Gemini API proxy support to the AWF api-proxy sidecar,
matching the pattern of existing OpenAI, Anthropic, and Copilot
providers. This enables Gemini CLI to work inside the AWF sandbox
without requiring workarounds in gh-aw.
Changes:
- Add GEMINI port 10003 to API_PROXY_PORTS
- Add geminiApiKey, geminiApiTarget, geminiApiBasePath to WrapperConfig
- Add --gemini-api-target and --gemini-api-base-path CLI flags
- Add GEMINI_API_KEY to excluded env vars when api-proxy is enabled
- Set placeholder GEMINI_API_KEY in agent container (Gemini CLI
v0.65.0+ exits 41 without auth when GEMINI_API_BASE_URL is set)
- Set GEMINI_API_BASE_URL pointing to sidecar in agent env
- Add .gemini to whitelisted home subdirectories (bind mount + chroot)
- Add Gemini proxy server in server.js using x-goog-api-key header
- Expose port 10003 in Dockerfile
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* test: add tests for Gemini API proxy support in docker-manager (#1654)
Agent-Logs-Url: https://github.com/github/gh-aw-firewall/sessions/03ba1344-8f2e-4d67-890f-46e665522db4
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
* test: add missing Gemini API target test coverage to fix CI branch coverage regression (#1662)
* test: add missing Gemini API target test coverage in cli.test.ts
Agent-Logs-Url: https://github.com/github/gh-aw-firewall/sessions/0ed05562-3ddb-490f-9b6a-dd5cfa3bb0fc
* fix: rename describe block to reflect all API target constants
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
---------
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: Landon Cox <landon.cox@microsoft.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
---------
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>1 parent b70b7a7 commit 4a94f62
File tree
7 files changed
+333
-6
lines changed- containers/api-proxy
- src
7 files changed
+333
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
| 30 | + | |
30 | 31 | | |
31 | | - | |
| 32 | + | |
32 | 33 | | |
33 | 34 | | |
34 | 35 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
62 | 62 | | |
63 | 63 | | |
64 | 64 | | |
| 65 | + | |
65 | 66 | | |
66 | 67 | | |
67 | 68 | | |
68 | 69 | | |
| 70 | + | |
69 | 71 | | |
70 | 72 | | |
71 | 73 | | |
| |||
115 | 117 | | |
116 | 118 | | |
117 | 119 | | |
| 120 | + | |
118 | 121 | | |
119 | 122 | | |
120 | 123 | | |
| |||
160 | 163 | | |
161 | 164 | | |
162 | 165 | | |
| 166 | + | |
163 | 167 | | |
164 | 168 | | |
165 | 169 | | |
166 | 170 | | |
167 | 171 | | |
| 172 | + | |
168 | 173 | | |
169 | 174 | | |
170 | 175 | | |
171 | 176 | | |
| 177 | + | |
172 | 178 | | |
173 | 179 | | |
174 | 180 | | |
| |||
707 | 713 | | |
708 | 714 | | |
709 | 715 | | |
| 716 | + | |
710 | 717 | | |
711 | 718 | | |
712 | 719 | | |
| |||
840 | 847 | | |
841 | 848 | | |
842 | 849 | | |
| 850 | + | |
| 851 | + | |
| 852 | + | |
| 853 | + | |
| 854 | + | |
| 855 | + | |
| 856 | + | |
| 857 | + | |
| 858 | + | |
| 859 | + | |
| 860 | + | |
| 861 | + | |
| 862 | + | |
| 863 | + | |
| 864 | + | |
| 865 | + | |
| 866 | + | |
| 867 | + | |
| 868 | + | |
| 869 | + | |
| 870 | + | |
| 871 | + | |
| 872 | + | |
| 873 | + | |
| 874 | + | |
| 875 | + | |
| 876 | + | |
| 877 | + | |
843 | 878 | | |
844 | 879 | | |
845 | 880 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
| 2 | + | |
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| |||
1780 | 1780 | | |
1781 | 1781 | | |
1782 | 1782 | | |
1783 | | - | |
| 1783 | + | |
1784 | 1784 | | |
1785 | 1785 | | |
1786 | 1786 | | |
1787 | 1787 | | |
| 1788 | + | |
1788 | 1789 | | |
1789 | 1790 | | |
1790 | 1791 | | |
| |||
1988 | 1989 | | |
1989 | 1990 | | |
1990 | 1991 | | |
| 1992 | + | |
| 1993 | + | |
| 1994 | + | |
| 1995 | + | |
| 1996 | + | |
| 1997 | + | |
| 1998 | + | |
| 1999 | + | |
| 2000 | + | |
| 2001 | + | |
| 2002 | + | |
| 2003 | + | |
| 2004 | + | |
| 2005 | + | |
| 2006 | + | |
| 2007 | + | |
| 2008 | + | |
| 2009 | + | |
| 2010 | + | |
| 2011 | + | |
| 2012 | + | |
| 2013 | + | |
| 2014 | + | |
| 2015 | + | |
| 2016 | + | |
| 2017 | + | |
| 2018 | + | |
| 2019 | + | |
| 2020 | + | |
| 2021 | + | |
| 2022 | + | |
| 2023 | + | |
| 2024 | + | |
| 2025 | + | |
| 2026 | + | |
| 2027 | + | |
| 2028 | + | |
| 2029 | + | |
| 2030 | + | |
| 2031 | + | |
| 2032 | + | |
| 2033 | + | |
| 2034 | + | |
| 2035 | + | |
| 2036 | + | |
| 2037 | + | |
| 2038 | + | |
| 2039 | + | |
| 2040 | + | |
1991 | 2041 | | |
1992 | 2042 | | |
1993 | 2043 | | |
| |||
2117 | 2167 | | |
2118 | 2168 | | |
2119 | 2169 | | |
| 2170 | + | |
| 2171 | + | |
| 2172 | + | |
| 2173 | + | |
| 2174 | + | |
| 2175 | + | |
| 2176 | + | |
| 2177 | + | |
| 2178 | + | |
| 2179 | + | |
| 2180 | + | |
| 2181 | + | |
| 2182 | + | |
| 2183 | + | |
| 2184 | + | |
| 2185 | + | |
| 2186 | + | |
| 2187 | + | |
| 2188 | + | |
| 2189 | + | |
| 2190 | + | |
| 2191 | + | |
2120 | 2192 | | |
2121 | 2193 | | |
2122 | 2194 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
252 | 252 | | |
253 | 253 | | |
254 | 254 | | |
| 255 | + | |
| 256 | + | |
255 | 257 | | |
256 | 258 | | |
257 | 259 | | |
| |||
345 | 347 | | |
346 | 348 | | |
347 | 349 | | |
348 | | - | |
| 350 | + | |
349 | 351 | | |
350 | 352 | | |
351 | 353 | | |
| |||
380 | 382 | | |
381 | 383 | | |
382 | 384 | | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
383 | 395 | | |
384 | 396 | | |
385 | 397 | | |
| |||
495 | 507 | | |
496 | 508 | | |
497 | 509 | | |
| 510 | + | |
498 | 511 | | |
499 | 512 | | |
500 | 513 | | |
| |||
520 | 533 | | |
521 | 534 | | |
522 | 535 | | |
| 536 | + | |
| 537 | + | |
| 538 | + | |
| 539 | + | |
| 540 | + | |
| 541 | + | |
523 | 542 | | |
524 | 543 | | |
525 | 544 | | |
| |||
1371 | 1390 | | |
1372 | 1391 | | |
1373 | 1392 | | |
| 1393 | + | |
| 1394 | + | |
| 1395 | + | |
| 1396 | + | |
| 1397 | + | |
| 1398 | + | |
| 1399 | + | |
| 1400 | + | |
1374 | 1401 | | |
1375 | 1402 | | |
1376 | 1403 | | |
| |||
1751 | 1778 | | |
1752 | 1779 | | |
1753 | 1780 | | |
| 1781 | + | |
1754 | 1782 | | |
1755 | 1783 | | |
1756 | 1784 | | |
1757 | 1785 | | |
1758 | 1786 | | |
| 1787 | + | |
| 1788 | + | |
1759 | 1789 | | |
1760 | 1790 | | |
1761 | 1791 | | |
| |||
0 commit comments