Skip to content

Move saved Agents into the agents domain and agentpg adapter (#315) #211

Move saved Agents into the agents domain and agentpg adapter (#315)

Move saved Agents into the agents domain and agentpg adapter (#315) #211

name: api-acceptance
on:
push:
branches: [main]
paths:
- 'services/core/**'
- 'contracts/agents-api/**'
- 'packages/agents-client/**'
- 'internal/**'
- 'go.mod'
- 'go.sum'
- 'Makefile'
- 'scripts/build-core.sh'
- 'scripts/build-core-image-context.sh'
- 'deploy/distribution/Dockerfile'
- '.github/workflows/api-acceptance.yml'
pull_request:
paths:
- 'services/core/**'
- 'contracts/agents-api/**'
- 'packages/agents-client/**'
- 'internal/**'
- 'go.mod'
- 'go.sum'
- 'Makefile'
- 'scripts/build-core.sh'
- 'scripts/build-core-image-context.sh'
- 'deploy/distribution/Dockerfile'
- '.github/workflows/api-acceptance.yml'
permissions:
contents: read
concurrency:
group: oac-core-${{ github.ref }}
cancel-in-progress: true
jobs:
official-client:
runs-on: ${{ vars.OAC_USE_GITHUB_RUNNERS == 'true' && 'ubuntu-24.04' || 'blacksmith-2vcpu-ubuntu-2404' }}
timeout-minutes: 20
services:
postgres:
image: postgres:16-alpine
env:
POSTGRES_DB: oac_ci_tests
POSTGRES_USER: agents_api
POSTGRES_PASSWORD: agents_api_test_only
ports:
- 5432/tcp
options: >-
--health-cmd "pg_isready -U agents_api -d oac_ci_tests"
--health-interval 5s
--health-timeout 5s
--health-retries 10
steps:
- uses: actions/checkout@v7
- uses: actions/setup-go@v7
with:
go-version-file: go.mod
cache: true
- name: Build standalone commands and verify migration entrypoints
env:
OAC_TEST_DATABASE_URL: postgres://agents_api:agents_api_test_only@127.0.0.1:${{ job.services.postgres.ports['5432'] }}/oac_ci_tests?sslmode=disable
run: |
OAC_DEV_CORE_BUILD_DIR="$RUNNER_TEMP/oac-core-build" make build-core
OAC_DATABASE_URL="$OAC_TEST_DATABASE_URL" "$RUNNER_TEMP/oac-core-build/oac-core-migrate"
"$RUNNER_TEMP/oac-core-build/oac-core-device" --help
"$RUNNER_TEMP/oac-core-build/oac-core-environment-key" --help
- uses: actions/setup-python@v6
with:
python-version: '3.12'
- name: Install pinned official client
run: |
python - <<'PY'
import json, subprocess, sys
pin = json.load(open('contracts/agents-api/upstream.json'))
subprocess.run([sys.executable, '-m', 'pip', 'install', '-r', 'services/core/tests/requirements.txt',
'openai @ git+https://github.com/openai/openai-python@' + pin['commit']], check=True)
PY
- name: Verify official-client HTTP compatibility
env:
OAC_TEST_DATABASE_URL: postgres://agents_api:agents_api_test_only@127.0.0.1:${{ job.services.postgres.ports['5432'] }}/oac_ci_tests?sslmode=disable
OAC_TEST_SERVER_BIN: ${{ runner.temp }}/oac-core-build/oac-core
OAC_TEST_OFFICIAL_SDK_PYTHON: python
run: |
python services/core/tests/official_client.py
go test ./services/core/internal/store -run '^(TestFunctionStateOfficialClientReadsAndLiveEvents|TestSavedReferenceRetryOfficialClient|TestAgentUpdateOfficialClient|TestAgentDeletionOfficialClient|TestSessionAgentFilterOfficialClient|TestSessionDeletionOfficialClient|TestEnvironmentInitialFailureOfficialClient|TestSelfHostedInitialCreationOfficialClient|TestSelfHostedCancellationOfficialClient|TestSelfHostedFunctionsOfficialClient|TestSelfHostedSteeringOfficialClient)$' -count=1
- name: Verify the distribution's Core image
env:
OAC_TEST_DATABASE_URL: postgres://agents_api:agents_api_test_only@127.0.0.1:${{ job.services.postgres.ports['5432'] }}/oac_ci_tests?sslmode=disable
OAC_DEV_CORE_IMAGE: oac-core:ci
OAC_TEST_OFFICIAL_SDK_PYTHON: python
run: make check-core-container