fix: include Gemini in api-proxy validation, add 503 fallback#1808
fix: include Gemini in api-proxy validation, add 503 fallback#1808
Conversation
There was a problem hiding this comment.
Pull request overview
Fixes Gemini-only api-proxy configurations being mis-validated as having “no API keys”, and improves behavior when GEMINI_API_KEY is missing by providing clearer warnings and a 503 fallback on the Gemini port.
Changes:
- Extend
validateApiProxyConfig()to include Gemini key detection and update CLI status/warning text accordingly. - Add a Docker-manager warning when api-proxy is enabled without
GEMINI_API_KEY. - Add a port
10003fallback server that returns503JSON errors when Gemini is not configured, avoiding connection-refused.
Show a summary per file
| File | Description |
|---|---|
| src/docker-manager.ts | Adds warning logs when api-proxy is enabled but Gemini key is absent. |
| src/cli.ts | Updates api-proxy validation + status logging + redaction to include Gemini. |
| src/cli.test.ts | Updates/extends unit tests for Gemini key detection and mixed-key scenarios. |
| containers/api-proxy/server.js | Adds a 503 fallback listener on port 10003 when GEMINI_API_KEY is unset. |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 4/4 changed files
- Comments generated: 1
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
✅ Coverage Check PassedOverall Coverage
📁 Per-file Coverage Changes (2 files)
Coverage comparison generated by |
🔬 Smoke Test ResultsPR: fix: include Gemini in api-proxy validation, add 503 fallback
Overall:
|
|
Smoke Test Results ✅ GitHub MCP: "fix: normalize API target env vars to bare hostnames via URL parsing", "chore: upgrade smoke-copilot workflow to gh-aw v0.67.3" Overall: PASS
|
Smoke Test: GitHub Actions Services Connectivity ✅All connectivity checks passed:
|
|
🔮 Oracle smoke test report
|
Chroot Version Comparison Results
Result: ❌ Not all tests passed — Python and Node.js versions differ between host and chroot.
|
validateApiProxyConfig()didn't know aboutGEMINI_API_KEY, so Gemini-only api-proxy configurations triggered a false "no API keys found" warning. When the key was absent, port 10003 silently refused connections instead of returning an actionable error.Changes
src/cli.ts— AddhasGeminiKeyparam tovalidateApiProxyConfig(), include Gemini in the status log (OpenAI=…, Gemini=…), addgeminiApiKeyto redacted config filtersrc/docker-manager.ts— Emit explicit warning when--enable-api-proxyis active butGEMINI_API_KEYis absent:containers/api-proxy/server.js— Add 503 fallback listener on port 10003 whenGEMINI_API_KEYis unset (matches existing OpenAI fallback pattern), so callers get a descriptive JSON error instead of connection-refusedsrc/cli.test.ts— Update validation tests for Gemini key detection, mixed-key combinations, and updated "no keys" warning text