Description
Claude engine workflows fail with EHOSTUNREACH because the ANTHROPIC_API_KEY is not reaching the Claude Code CLI inside the sandbox container. The CLI reports apiKeySource: "none" at init.
Environment
gh aw CLI: v0.63.0
- Claude Code CLI: 2.1.81 (installed by gh-aw runtime)
- Repo: private, GitHub Teams plan
- OS: ubuntu-latest (GitHub-hosted runner)
Steps to Reproduce
- Create a simple Claude daemon spec:
---
description: "Test daemon"
strict: false
timeout-minutes: 20
on:
pull_request:
types: [opened]
engine:
id: claude
model: claude-opus-4-20250514
permissions:
contents: read
tools:
github:
toolsets: [pull_requests]
bash: true
network:
allowed: [defaults, api.anthropic.com]
---
# Test
Say hello.
- Set
ANTHROPIC_API_KEY as a repo secret (confirmed via gh secret list)
- Compile:
gh aw compile (succeeds, 0 errors)
- Push and trigger on a PR
Expected Behavior
Claude Code CLI should receive the API key via the one-shot token mechanism and connect to api.anthropic.com.
Actual Behavior
The workflow runs through all setup steps successfully:
- ✅
Validate ANTHROPIC_API_KEY secret step passes (✅ ANTHROPIC_API_KEY: Configured)
- ✅ API proxy health check passes (
✓ Anthropic API proxy is reachable at http://172.30.0.30:10001)
- ✅
ANTHROPIC_AUTH_TOKEN is placeholder value (correct)
- ✅ One-shot token library copied to chroot
- ❌ Claude Code CLI reports
apiKeySource: "none" at init
- ❌ All 10 API retry attempts fail with
error: "unknown"
- ❌ Final error:
API Error: Unable to connect to API (EHOSTUNREACH)
Firewall logs show only 1 request to raw.githubusercontent.com — Claude Code never attempts to reach api.anthropic.com or the API proxy.
Key Log Lines
[health-check] ✓ Anthropic API proxy is reachable at http://172.30.0.30:10001
[entrypoint] One-shot token library copied to chroot at /tmp/awf-lib/one-shot-token.so
[entrypoint] Unsetting sensitive tokens from parent shell environment...
{"apiKeySource":"none","claude_code_version":"2.1.81"}
{"subtype":"api_retry","attempt":1,"error_status":null,"error":"unknown"}
...
{"text":"API Error: Unable to connect to API (EHOSTUNREACH)"}
What I've Tried
strict: true (default) — same failure
strict: false — same failure
network.allowed: [defaults, api.anthropic.com] — same failure
- Upgraded from gh-aw v0.62.5 to v0.63.0 — same failure
- Confirmed
ANTHROPIC_API_KEY is a valid repo secret (used successfully by anthropics/claude-code-action@beta in another workflow in the same repo)
Notes
The gh-aw Claude smoke test (smoke-claude.md) in this repo passes. The key difference may be that the smoke test is compiled/run within the gh-aw CI infrastructure, while our workflow is in an external private repo. The compiled lock files look structurally identical.
Failed run: https://github.com/quitgenius/pelago-aiml/actions/runs/23497638247/job/68379397069
Description
Claude engine workflows fail with
EHOSTUNREACHbecause theANTHROPIC_API_KEYis not reaching the Claude Code CLI inside the sandbox container. The CLI reportsapiKeySource: "none"at init.Environment
gh awCLI: v0.63.0Steps to Reproduce
ANTHROPIC_API_KEYas a repo secret (confirmed viagh secret list)gh aw compile(succeeds, 0 errors)Expected Behavior
Claude Code CLI should receive the API key via the one-shot token mechanism and connect to
api.anthropic.com.Actual Behavior
The workflow runs through all setup steps successfully:
Validate ANTHROPIC_API_KEY secretstep passes (✅ ANTHROPIC_API_KEY: Configured)✓ Anthropic API proxy is reachable at http://172.30.0.30:10001)ANTHROPIC_AUTH_TOKEN is placeholder value (correct)apiKeySource: "none"at initerror: "unknown"API Error: Unable to connect to API (EHOSTUNREACH)Firewall logs show only 1 request to
raw.githubusercontent.com— Claude Code never attempts to reachapi.anthropic.comor the API proxy.Key Log Lines
What I've Tried
strict: true(default) — same failurestrict: false— same failurenetwork.allowed: [defaults, api.anthropic.com]— same failureANTHROPIC_API_KEYis a valid repo secret (used successfully byanthropics/claude-code-action@betain another workflow in the same repo)Notes
The gh-aw Claude smoke test (
smoke-claude.md) in this repo passes. The key difference may be that the smoke test is compiled/run within the gh-aw CI infrastructure, while our workflow is in an external private repo. The compiled lock files look structurally identical.Failed run: https://github.com/quitgenius/pelago-aiml/actions/runs/23497638247/job/68379397069