Spaces:
Sleeping
Sleeping
Claude Code Claude Code commited on
Commit ·
f1cd1ec
1
Parent(s): 740ba92
Claude Code: Fix worker env injection - add ANTHROPIC_API_KEY and CLAUDE_API_KEY to env config
Browse filesThe worker process (brain_minimal.py) was failing to initialize because
ANTHROPIC_API_KEY and CLAUDE_API_KEY were not being explicitly exported
to the subprocess environment. These keys are required by error_handlers.py
which is imported by the worker.
Co-Authored-By: Claude Code <noreply@anthropic.com>
- entrypoint.sh +6 -0
entrypoint.sh
CHANGED
|
@@ -59,6 +59,12 @@ export SLEEP_INTERVAL="${SLEEP_INTERVAL:-5}"
|
|
| 59 |
export WORKER_START_TIMEOUT="${WORKER_START_TIMEOUT:-30}"
|
| 60 |
export OPENCLAW_DATA_DIR="/data"
|
| 61 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 62 |
# Log environment for debugging (exclude sensitive values)
|
| 63 |
echo "Environment check:"
|
| 64 |
echo " WORKER_MODE: ${WORKER_MODE:-not set}"
|
|
|
|
| 59 |
export WORKER_START_TIMEOUT="${WORKER_START_TIMEOUT:-30}"
|
| 60 |
export OPENCLAW_DATA_DIR="/data"
|
| 61 |
|
| 62 |
+
# CRITICAL: Export API keys for error_handlers.py used by worker
|
| 63 |
+
# These are required by Claude/Anthropic SDK in the worker process
|
| 64 |
+
# Preserves existing values (from HF secrets) or sets empty if not set
|
| 65 |
+
export ANTHROPIC_API_KEY="${ANTHROPIC_API_KEY:-}"
|
| 66 |
+
export CLAUDE_API_KEY="${CLAUDE_API_KEY:-}"
|
| 67 |
+
|
| 68 |
# Log environment for debugging (exclude sensitive values)
|
| 69 |
echo "Environment check:"
|
| 70 |
echo " WORKER_MODE: ${WORKER_MODE:-not set}"
|