Skip to content

Autonomous Agent — Self-Modifying Loop #375

Autonomous Agent — Self-Modifying Loop

Autonomous Agent — Self-Modifying Loop #375

name: Autonomous Agent — Self-Modifying Loop
on:
push:
branches: [master, main]
schedule:
- cron: '0 */4 * * *' # every 4 hours
workflow_dispatch:
inputs:
task:
description: 'Override task prompt'
required: false
default: ''
permissions:
contents: write
jobs:
agent:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
fetch-depth: 0
- uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install deps
run: pip install requests orjson
- name: Run sovereign agent
env:
OPENROUTER_API_KEY: ${{ secrets.OPENROUTER_API_KEY }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
OVERRIDE_TASK: ${{ github.event.inputs.task }}
run: python .github/scripts/agent.py
- name: Commit changes
run: |
git config user.name "SNAPKITTY-AGENT"
git config user.email "agent@snapkittywest.io"
git add -A
if git diff --cached --quiet; then
echo "Nothing to commit."
else
git commit -m "⟦Ω⟧ agent: $(date -u +%Y-%m-%dT%H:%M:%SZ)"
git push origin HEAD
fi