Skip to content

Add Hermes Agent integration helpers #2022

Add Hermes Agent integration helpers

Add Hermes Agent integration helpers #2022

Workflow file for this run

name: ci
on:
push:
branches: [main]
pull_request:
concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true
jobs:
lint:
runs-on: ubuntu-latest
defaults:
run:
working-directory: autocontext
steps:
- uses: actions/checkout@v5
- uses: actions/setup-python@v6
with:
python-version: "3.11"
- name: Install uv
uses: astral-sh/setup-uv@v7
with:
enable-cache: true
- name: Install
run: uv sync --group dev
- name: Ruff
run: uv run ruff check src tests
- name: Mypy
run: uv run mypy src
- name: Protocol parity check
run: uv run python ../scripts/generate_protocol.py --check
test:
runs-on: ubuntu-latest
defaults:
run:
working-directory: autocontext
steps:
- uses: actions/checkout@v5
- uses: actions/setup-python@v6
with:
python-version: "3.11"
- name: Install uv
uses: astral-sh/setup-uv@v7
with:
enable-cache: true
- name: Install
run: uv sync --group dev
- name: Tests
run: uv run pytest --cov=src/autocontext --cov-report=html:htmlcov -m "not live"
- name: Upload coverage
if: always()
uses: actions/upload-artifact@v6
with:
name: coverage-report
path: autocontext/htmlcov/
retention-days: 14
package-boundaries:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: actions/setup-python@v6
with:
python-version: "3.11"
- uses: actions/setup-node@v5
with:
node-version: "24"
cache: "npm"
cache-dependency-path: ts/package-lock.json
- name: Install uv
uses: astral-sh/setup-uv@v7
with:
enable-cache: true
- name: Install Python deps
working-directory: autocontext
run: uv sync --group dev
- name: Install TypeScript deps
working-directory: ts
run: npm ci
- name: Python package boundary checks
working-directory: autocontext
run: uv run pytest tests/test_package_topology.py tests/test_package_boundaries.py -q
- name: TypeScript package boundary checks
working-directory: ts
run: npx vitest run tests/package-topology.test.ts tests/package-boundaries.test.ts
smoke:
needs: [lint, test, package-boundaries]
runs-on: ubuntu-latest
defaults:
run:
working-directory: autocontext
steps:
- uses: actions/checkout@v5
- uses: actions/setup-python@v6
with:
python-version: "3.11"
- name: Install uv
uses: astral-sh/setup-uv@v7
with:
enable-cache: true
- name: Install
run: uv sync --group dev
- name: Deterministic scenario runs
env:
AUTOCONTEXT_AGENT_PROVIDER: deterministic
run: |
uv run python -m autocontext.cli run --scenario grid_ctf --gens 3 --run-id ci_smoke_grid
uv run python -m autocontext.cli run --scenario othello --gens 1 --run-id ci_smoke_othello
- name: Dashboard API smoke
env:
AUTOCONTEXT_AGENT_PROVIDER: deterministic
run: |
cleanup() { kill $SERVER_PID 2>/dev/null || true; }
trap cleanup EXIT
uv run autoctx serve --host 127.0.0.1 --port 8010 &
SERVER_PID=$!
sleep 2
curl -fsS http://127.0.0.1:8010/health
curl -fsS http://127.0.0.1:8010/api/runs
# ────────────────────────────────────────────────────────────────────────────
# OpenAI SDK version-pin matrix (A2-II-b Task 7.4)
# Tests the OpenAI integration against the 3 most-recent 1.x patches (Python)
# and 3 most-recent 4.x patches (TypeScript).
#
# Python: 1.82.0, 1.83.0, 1.84.0 (latest 3 minor patches of openai 1.x)
# TS: 4.102.0, 4.103.0, 4.104.0 (latest 3 minor patches of openai 4.x)
# ────────────────────────────────────────────────────────────────────────────
openai-sdk-matrix-python:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
openai-version: ["1.82.0", "1.83.0", "1.84.0"]
defaults:
run:
working-directory: autocontext
env:
OPENAI_VERSION: ${{ matrix.openai-version }}
steps:
- uses: actions/checkout@v5
- uses: actions/setup-python@v6
with:
python-version: "3.11"
- name: Install uv
uses: astral-sh/setup-uv@v7
with:
enable-cache: true
- name: Install base deps
run: uv sync --group dev
- name: Pin openai to matrix version
run: uv pip install "openai==$OPENAI_VERSION"
- name: Run OpenAI integration tests
run: uv run pytest tests/production_traces/ tests/integrations/ -q -m "not live"
openai-sdk-matrix-ts:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
openai-version: ["4.102.0", "4.103.0", "4.104.0"]
defaults:
run:
working-directory: ts
env:
OPENAI_VERSION: ${{ matrix.openai-version }}
steps:
- uses: actions/checkout@v5
- uses: actions/setup-python@v6
with:
python-version: "3.11"
- uses: actions/setup-node@v5
with:
node-version: "24"
cache: "npm"
cache-dependency-path: ts/package-lock.json
- name: Reuse setup-node headers for native addons
shell: bash
run: |
nodedir="$(dirname "$(dirname "$(command -v node)")")"
test -d "$nodedir/include/node"
echo "npm_config_nodedir=$nodedir" >> "$GITHUB_ENV"
- name: Install uv
uses: astral-sh/setup-uv@v7
with:
enable-cache: true
- name: Install Python parity deps
working-directory: autocontext
run: uv sync --group dev
- name: Install base deps
run: npm ci
- name: Pin openai to matrix version
run: npm install "openai@$OPENAI_VERSION"
- name: Run OpenAI integration tests
run: npm test -- --run --reporter=verbose tests/integrations/ tests/control-plane/instrument/
# ────────────────────────────────────────────────────────────────────────────
# Anthropic SDK version-pin matrix (A2-III)
# Tests the Anthropic integration against the 3 most-recent 0.x patches (Python)
# and 3 most-recent 0.x patches (TypeScript @anthropic-ai/sdk).
#
# Python: 0.49.0, 0.50.0, 0.51.0 (latest 3 minor patches of anthropic 0.x)
# TS: 0.39.0, 0.40.0, 0.41.0 (latest 3 minor patches of @anthropic-ai/sdk 0.x)
# ────────────────────────────────────────────────────────────────────────────
anthropic-sdk-matrix-python:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
anthropic-version: ["0.49.0", "0.50.0", "0.51.0"]
defaults:
run:
working-directory: autocontext
env:
ANTHROPIC_VERSION: ${{ matrix.anthropic-version }}
steps:
- uses: actions/checkout@v5
- uses: actions/setup-python@v6
with:
python-version: "3.11"
- name: Install uv
uses: astral-sh/setup-uv@v7
with:
enable-cache: true
- name: Install base deps
run: uv sync --group dev
- name: Pin anthropic to matrix version
run: uv pip install "anthropic==$ANTHROPIC_VERSION"
- name: Run Anthropic integration tests
run: uv run pytest tests/production_traces/ tests/integrations/ -q -m "not live"
anthropic-sdk-matrix-ts:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
anthropic-version: ["0.39.0", "0.40.0", "0.41.0"]
defaults:
run:
working-directory: ts
env:
ANTHROPIC_VERSION: ${{ matrix.anthropic-version }}
steps:
- uses: actions/checkout@v5
- uses: actions/setup-python@v6
with:
python-version: "3.11"
- uses: actions/setup-node@v5
with:
node-version: "24"
cache: "npm"
cache-dependency-path: ts/package-lock.json
- name: Install uv
uses: astral-sh/setup-uv@v7
with:
enable-cache: true
- name: Install Python parity deps
working-directory: autocontext
run: uv sync --group dev
- name: Install base deps
run: npm ci
- name: Pin anthropic to matrix version
run: npm install "@anthropic-ai/sdk@$ANTHROPIC_VERSION"
- name: Run Anthropic integration tests
run: npm test -- --run --reporter=verbose tests/integrations/ tests/control-plane/instrument/
primeintellect-live:
runs-on: ubuntu-latest
defaults:
run:
working-directory: autocontext
env:
AUTOCONTEXT_PRIMEINTELLECT_API_KEY: ${{ secrets.AUTOCONTEXT_PRIMEINTELLECT_API_KEY }}
AUTOCONTEXT_ANTHROPIC_API_KEY: ${{ secrets.AUTOCONTEXT_ANTHROPIC_API_KEY }}
steps:
- uses: actions/checkout@v5
- uses: actions/setup-python@v6
with:
python-version: "3.11"
- name: Install uv
uses: astral-sh/setup-uv@v7
with:
enable-cache: true
- name: Install
run: uv sync --group dev
- name: Live PrimeIntellect verification
if: ${{ env.AUTOCONTEXT_PRIMEINTELLECT_API_KEY != '' && env.AUTOCONTEXT_ANTHROPIC_API_KEY != '' }}
env:
AUTOCONTEXT_EXECUTOR_MODE: primeintellect
AUTOCONTEXT_PRIMEINTELLECT_API_BASE: https://api.primeintellect.ai
AUTOCONTEXT_AGENT_PROVIDER: anthropic
run: uv run autoctx run --scenario grid_ctf --gens 1 --run-id ci_prime_live