Problem
When using engine: gemini in a workflow, the Gemini CLI fails with exit code 41 (no authentication configured) even though GEMINI_API_KEY is correctly set as a repository secret. The failure log shows:
[INFO] API proxy enabled: OpenAI=false, Anthropic=false, Copilot=false
[WARN] ⚠️ API proxy enabled but no API keys found in environment
The GEMINI_API_BASE_URL is being set to `(host.docker.internal/redacted) (the AWF api-proxy), but the proxy reports no Gemini support.
Context
Root Cause
In src/docker-manager.ts lines 1657–1673, GEMINI_API_BASE_URL is only set to the api-proxy address when config.geminiApiKey is present. However, in the reported scenario, the api-proxy is enabled (--enable-api-proxy) but GEMINI_API_KEY is not being forwarded to the AWF process — it's being held as a repository secret injected into the GitHub Actions environment, not the AWF runner environment.
The [WARN] API proxy enabled but no API keys found means config.geminiApiKey is undefined at compose generation time (line 1672). Despite this, when the agent receives GEMINI_API_KEY through --env-all or explicit env forwarding, it gets excluded from the agent environment at line 600 (EXCLUDED_ENV_VARS.add('GEMINI_API_KEY')) when api-proxy is enabled — leaving the Gemini CLI with no credential.
Proposed Solution
-
src/docker-manager.ts: When --enable-api-proxy is active and GEMINI_API_KEY is excluded from the agent environment (line 600), always set GEMINI_API_BASE_URL to the api-proxy address for port 10003 — regardless of whether the key is detected at compose-generation time. The api-proxy will return 503 if no key is available, which is a clearer failure than a silent auth error.
-
src/docker-manager.ts: Change the log at line 1672 from [WARN] to [ERROR] when GEMINI_API_KEY is excluded but no key is configured — this surfaces the misconfiguration at startup rather than silently failing.
-
containers/api-proxy/server.js: Verify the Gemini listener on port 10003 is initialized and that the health check reflects Gemini availability. Update the [INFO] API proxy enabled: ... log line to include Gemini=true/false.
-
Docs: Update the api-proxy documentation to clarify that GEMINI_API_KEY must be present in the runner environment (not just repository secrets) when --enable-api-proxy is used, or add a mechanism to read it from the Actions secret at runtime.
Generated by Firewall Issue Dispatcher · ● 1.6M · ◷
Problem
When using
engine: geminiin a workflow, the Gemini CLI fails with exit code 41 (no authentication configured) even thoughGEMINI_API_KEYis correctly set as a repository secret. The failure log shows:The
GEMINI_API_BASE_URLis being set to `(host.docker.internal/redacted) (the AWF api-proxy), but the proxy reports no Gemini support.Context
Root Cause
In
src/docker-manager.tslines 1657–1673,GEMINI_API_BASE_URLis only set to the api-proxy address whenconfig.geminiApiKeyis present. However, in the reported scenario, the api-proxy is enabled (--enable-api-proxy) butGEMINI_API_KEYis not being forwarded to the AWF process — it's being held as a repository secret injected into the GitHub Actions environment, not the AWF runner environment.The
[WARN] API proxy enabled but no API keys foundmeansconfig.geminiApiKeyisundefinedat compose generation time (line 1672). Despite this, when the agent receivesGEMINI_API_KEYthrough--env-allor explicit env forwarding, it gets excluded from the agent environment at line 600 (EXCLUDED_ENV_VARS.add('GEMINI_API_KEY')) when api-proxy is enabled — leaving the Gemini CLI with no credential.Proposed Solution
src/docker-manager.ts: When--enable-api-proxyis active andGEMINI_API_KEYis excluded from the agent environment (line 600), always setGEMINI_API_BASE_URLto the api-proxy address for port 10003 — regardless of whether the key is detected at compose-generation time. The api-proxy will return 503 if no key is available, which is a clearer failure than a silent auth error.src/docker-manager.ts: Change the log at line 1672 from[WARN]to[ERROR]whenGEMINI_API_KEYis excluded but no key is configured — this surfaces the misconfiguration at startup rather than silently failing.containers/api-proxy/server.js: Verify the Gemini listener on port 10003 is initialized and that the health check reflects Gemini availability. Update the[INFO] API proxy enabled: ...log line to includeGemini=true/false.Docs: Update the api-proxy documentation to clarify that
GEMINI_API_KEYmust be present in the runner environment (not just repository secrets) when--enable-api-proxyis used, or add a mechanism to read it from the Actions secret at runtime.