Skip to content

Commit bdc5757

Browse files
author
StackMemory Bot (CLI)
committed
fix(dspy): source bash_profile for API key, first successful run (75%→100% on complexity)
1 parent 9822d22 commit bdc5757

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

scripts/dspy/loop.sh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,10 @@ if [ ! -f "$DB_PATH" ]; then
4848
fi
4949

5050
if [ -z "${ANTHROPIC_API_KEY:-}" ]; then
51-
# Try loading from .env
52-
if [ -f "$REPO_ROOT/.env" ]; then
51+
# Try shell profile first, then .env
52+
[ -f "$HOME/.bash_profile" ] && source "$HOME/.bash_profile" 2>/dev/null || true
53+
[ -f "$HOME/.zprofile" ] && source "$HOME/.zprofile" 2>/dev/null || true
54+
if [ -z "${ANTHROPIC_API_KEY:-}" ] && [ -f "$REPO_ROOT/.env" ]; then
5355
export $(grep ANTHROPIC_API_KEY "$REPO_ROOT/.env" 2>/dev/null | head -1 | xargs) 2>/dev/null || true
5456
fi
5557
if [ -z "${ANTHROPIC_API_KEY:-}" ]; then

0 commit comments

Comments
 (0)