name: Autoresearch Loop on: workflow_dispatch: inputs: fixture: description: 'Fixture name in fixtures/ (without .json)' required: true default: 'phase-a-toy' rq_id: description: 'Run ID — defaults to fixture name if blank' required: false default: '' iters: description: 'Max iterations' required: false default: '3' model: description: 'LiteLLM model override (leave blank for default berget/gemma4-31b)' required: false default: '' jobs: run: name: Autoresearch — ${{ inputs.fixture }} runs-on: self-hosted timeout-minutes: 90 steps: - uses: actions/checkout@v4 - name: Resolve run ID id: vars run: | RQ_ID="${{ inputs.rq_id }}" [ -z "$RQ_ID" ] && RQ_ID="${{ inputs.fixture }}" echo "rq_id=$RQ_ID" >> "$GITHUB_OUTPUT" - name: Clean stale run dir run: rm -rf "runs/${{ steps.vars.outputs.rq_id }}" - name: Set up Python venv run: | [ -d .venv ] || python3 -m venv .venv .venv/bin/pip install -q -r requirements.txt - name: Scaffold run dir run: | .venv/bin/python scripts/autoresearch_start.py \ "fixtures/${{ inputs.fixture }}.json" \ "${{ steps.vars.outputs.rq_id }}" - name: Run autoresearch loop env: LITELLM_KEY: ${{ secrets.LITELLM_KEY }} LITELLM_BASE: ${{ secrets.LITELLM_BASE }} NTFY_URL: ${{ secrets.NTFY_URL }} LOOP_MODEL: ${{ inputs.model }} run: | ARGS="--run-dir runs/${{ steps.vars.outputs.rq_id }} --iters ${{ inputs.iters }}" [ -n "${{ inputs.model }}" ] && ARGS="$ARGS --model ${{ inputs.model }}" .venv/bin/python loop.py $ARGS - name: Upload run artifacts if: always() uses: https://gitea.com/actions/upload-artifact@v3 with: name: run-${{ steps.vars.outputs.rq_id }}-${{ github.run_number }} path: | runs/${{ steps.vars.outputs.rq_id }}/STATUS.md runs/${{ steps.vars.outputs.rq_id }}/metrics.json runs/${{ steps.vars.outputs.rq_id }}/program.md retention-days: 30