Skip to content

Commit 0b52592

Browse files
committed
fix empty api key causing override
1 parent 2f0d8ad commit 0b52592

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

crates/example-eventage-claw/docker-compose.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@ services:
1515
# Bind-mount a local directory so you can edit config and skills directly.
1616
- ${CLAW_DATA_DIR:-../../data/claw}:/root/.claw
1717
environment:
18-
# LLM credentials — set in .env or environment
19-
ANTHROPIC_API_KEY: ${ANTHROPIC_API_KEY:-}
20-
OPENAI_API_KEY: ${OPENAI_API_KEY:-}
21-
LLM_URL: ${LLM_URL:-https://api.anthropic.com/v1}
22-
LLM_MODEL: ${LLM_MODEL:-claude-sonnet-4-6}
18+
# API keys: only passed to container when set in .env (no empty-string override)
19+
- ANTHROPIC_API_KEY
20+
- OPENAI_API_KEY
21+
- LLM_URL
22+
- LLM_MODEL
2323
# To also run the live replay UI:
2424
# ports: ["3000:3000", "4567:4567"]
2525
# command: ["--no-tui", "--http-port", "3000", "--replay"]

crates/example-eventage-claw/src/config.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -209,17 +209,17 @@ impl ClawConfig {
209209
ClawConfig::default()
210210
};
211211

212-
// Environment variable overrides
212+
// Environment variable overrides (only apply when non-empty)
213213
if let Ok(k) =
214214
std::env::var("ANTHROPIC_API_KEY").or_else(|_| std::env::var("OPENAI_API_KEY"))
215215
{
216-
config.api_key = k;
216+
if !k.is_empty() { config.api_key = k; }
217217
}
218218
if let Ok(url) = std::env::var("LLM_URL") {
219-
config.llm_url = url;
219+
if !url.is_empty() { config.llm_url = url; }
220220
}
221221
if let Ok(m) = std::env::var("LLM_MODEL") {
222-
config.model = m;
222+
if !m.is_empty() { config.model = m; }
223223
}
224224

225225
// Ensure at least one group exists

0 commit comments

Comments
 (0)