Skip to content

🌱 OpenCLAW SEED — Autonomous Growth #257

🌱 OpenCLAW SEED — Autonomous Growth

🌱 OpenCLAW SEED — Autonomous Growth #257

Workflow file for this run

name: "🌱 OpenCLAW SEED — Autonomous Growth"
on:
schedule:
- cron: "0 */4 * * *"
- cron: "30 */12 * * *"
workflow_dispatch:
inputs:
command:
description: "Command"
default: "full"
type: choice
options: [full, agent, seed, harvest]
permissions:
contents: write
jobs:
agent-cycle:
if: github.event.schedule == '0 */4 * * *' || github.event.inputs.command == 'agent' || github.event.inputs.command == 'full'
runs-on: ubuntu-latest
timeout-minutes: 15
env:
NVIDIA_API_KEY: ${{ secrets.NVIDIA_API_KEY }}
GROQ_API_KEYS: ${{ secrets.GROQ_API_KEYS }}
OPENROUTER_API_KEYS: ${{ secrets.OPENROUTER_API_KEYS }}
NVIDIA_API_KEYS: ${{ secrets.NVIDIA_API_KEYS }}
MISTRAL_API_KEYS: ${{ secrets.MISTRAL_API_KEYS }}
DEEPSEEK_API_KEYS: ${{ secrets.DEEPSEEK_API_KEYS }}
MOLTHUB_API_KEY: ${{ secrets.MOLTHUB_API_KEY }}
SMTP_USER: ${{ secrets.SMTP_USER }}
SMTP_PASSWORD: ${{ secrets.SMTP_PASSWORD }}
MOLTBOOK_API_KEY: ${{ secrets.MOLTBOOK_API_KEY }}
HF_TOKEN: ${{ secrets.HF_TOKEN }}
BRAVE_API_KEY: ${{ secrets.BRAVE_API_KEY }}
STATE_DIR: ./state
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/setup-python@v5
with:
python-version: "3.11"
- run: pip install -q requests
- name: "📥 Restore state"
run: |
git fetch origin state --depth=1 2>/dev/null || true
if git show-ref --verify --quiet refs/remotes/origin/state; then
git checkout origin/state -- state/ 2>/dev/null || mkdir -p state
else
mkdir -p state
fi
- name: "🤖 Run Agent"
run: python main.py run
- name: "💾 Save state"
run: |
git config user.name "OpenCLAW Bot"
git config user.email "openclaw-bot@noreply.github.com"
git add -f state/ 2>/dev/null || true
git stash --include-untracked 2>/dev/null || true
git checkout state 2>/dev/null || git checkout --orphan state
git rm -rf . 2>/dev/null || true
git stash pop 2>/dev/null || true
mkdir -p state
cp -r state/ . 2>/dev/null || true
git add state/ 2>/dev/null || true
git commit -m "Agent state $(date -u +%Y-%m-%dT%H:%M)" --allow-empty || true
git push origin state --force || echo "State push skipped"
- name: "📊 Status"
if: always()
run: |
cat state/agent_state.json 2>/dev/null || echo "No state"
cat state/last_cycle.json 2>/dev/null || echo "No cycle"
seed-growth:
if: github.event.schedule == '30 */12 * * *' || github.event.inputs.command == 'seed' || github.event.inputs.command == 'full' || github.event.inputs.command == 'harvest'
runs-on: ubuntu-latest
timeout-minutes: 30
env:
HF_TOKEN: ${{ secrets.HF_TOKEN }}
NVIDIA_API_KEY: ${{ secrets.NVIDIA_API_KEY }}
GROQ_API_KEYS: ${{ secrets.GROQ_API_KEYS }}
OPENROUTER_API_KEYS: ${{ secrets.OPENROUTER_API_KEYS }}
NVIDIA_API_KEYS: ${{ secrets.NVIDIA_API_KEYS }}
MISTRAL_API_KEYS: ${{ secrets.MISTRAL_API_KEYS }}
DEEPSEEK_API_KEYS: ${{ secrets.DEEPSEEK_API_KEYS }}
MOLTHUB_API_KEY: ${{ secrets.MOLTHUB_API_KEY }}
SMTP_USER: ${{ secrets.SMTP_USER }}
SMTP_PASSWORD: ${{ secrets.SMTP_PASSWORD }}
SEED_STATE_DIR: ./seed_state
SEED_DATA_DIR: ./seed_data
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/setup-python@v5
with:
python-version: "3.11"
- run: pip install -q requests huggingface_hub
- name: "📥 Restore seed state"
run: |
git fetch origin seed-state --depth=1 2>/dev/null || true
if git show-ref --verify --quiet refs/remotes/origin/seed-state; then
git checkout origin/seed-state -- seed_state/ seed_data/ 2>/dev/null || true
fi
mkdir -p seed_state seed_data
- name: "🌱 Run SEED Growth"
run: |
python -c "
import sys, os, logging
sys.path.insert(0, '.')
logging.basicConfig(level=logging.INFO, format='%(asctime)s [%(levelname)s] %(name)s: %(message)s')
from seed.growth_engine import GrowthEngine
engine = GrowthEngine(
hf_token=os.environ.get('HF_TOKEN', ''),
state_dir='seed_state', data_dir='seed_data',
)
import json
results = engine.run_cycle()
print(json.dumps(results, indent=2, default=str))
print(json.dumps(engine.get_status(), indent=2, default=str))
"
- name: "💾 Save seed state"
if: always()
run: |
git config user.name "SEED Bot"
git config user.email "seed-bot@noreply.github.com"
git add -f seed_state/ seed_data/ 2>/dev/null || true
git stash --include-untracked 2>/dev/null || true
git checkout seed-state 2>/dev/null || git checkout --orphan seed-state
git rm -rf . 2>/dev/null || true
git stash pop 2>/dev/null || true
mkdir -p seed_state seed_data
cp -r seed_state/ . 2>/dev/null || true
cp -r seed_data/ . 2>/dev/null || true
git add seed_state/ seed_data/ 2>/dev/null || true
git commit -m "SEED $(date -u +%Y-%m-%dT%H:%M)" --allow-empty || true
git push origin seed-state --force || echo "Seed state push skipped"
- name: "📊 Status"
if: always()
run: |
echo "=== Cycle ===" && cat seed_state/cycle_log.json 2>/dev/null || true
echo "=== Data ===" && wc -l seed_data/*.jsonl 2>/dev/null || true