🗼 fix: Serialize MCP OAuth Token Refresh Across Replicas #4760
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Integration Tests | |
| # Runs every packages/api `*.integration.spec.ts` / `*.integration.test.ts` suite (e.g. the | |
| # durable HITL checkpointer and cross-replica subagent delivery against real MongoDB and | |
| # Redis, the admin config secret registry against a real Config collection, MCP flows | |
| # against in-process servers). `test:ci` deliberately excludes them, and the Redis-backed | |
| # `*.cache_integration` / `*.stream_integration` suites run in cache-integration-tests.yml — | |
| # without this job they run nowhere and their regressions guard nothing. Selection is by | |
| # suffix, not folder, so a suite added anywhere under src is picked up. | |
| on: | |
| pull_request: | |
| branches: | |
| - main | |
| - dev | |
| - dev-staging | |
| - release/* | |
| # The suites build and consume data-provider and data-schemas and import | |
| # across packages/api (the build-cache keys below hash all three src trees), | |
| # so they must re-run on any of them. | |
| paths: | |
| - 'packages/api/src/**' | |
| - 'packages/api/package.json' | |
| - 'packages/data-provider/src/**' | |
| - 'packages/data-provider/package.json' | |
| - 'packages/data-schemas/src/**' | |
| - 'packages/data-schemas/package.json' | |
| - '.github/workflows/agents-integration-tests.yml' | |
| - '!**.md' | |
| permissions: | |
| contents: read | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| agents_integration_tests: | |
| name: Integration Tests (MongoDB and Redis) | |
| timeout-minutes: 20 | |
| runs-on: ubuntu-latest | |
| services: | |
| redis: | |
| image: redis:7-alpine | |
| ports: | |
| - 6379:6379 | |
| options: >- | |
| --health-cmd "redis-cli ping" | |
| --health-interval 5s | |
| --health-timeout 5s | |
| --health-retries 5 | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v5 | |
| - name: Use Node.js 24.16.0 | |
| uses: actions/setup-node@v5 | |
| with: | |
| node-version: '24.16.0' | |
| - name: Restore node_modules cache | |
| id: cache-node-modules | |
| uses: actions/cache@v5 | |
| with: | |
| path: | | |
| node_modules | |
| api/node_modules | |
| packages/api/node_modules | |
| packages/data-provider/node_modules | |
| packages/data-schemas/node_modules | |
| key: node-modules-backend-${{ runner.os }}-24.16.0-${{ hashFiles('package-lock.json') }} | |
| - name: Install dependencies | |
| if: steps.cache-node-modules.outputs.cache-hit != 'true' | |
| run: npm ci | |
| - name: Restore data-provider build cache | |
| id: cache-data-provider | |
| uses: actions/cache@v5 | |
| with: | |
| path: packages/data-provider/dist | |
| key: build-data-provider-${{ runner.os }}-${{ hashFiles('package.json', 'package-lock.json', 'packages/data-provider/src/**', 'packages/data-provider/tsconfig*.json', 'packages/data-provider/tsdown.config.mjs', 'packages/data-provider/package.json') }} | |
| - name: Build data-provider | |
| if: steps.cache-data-provider.outputs.cache-hit != 'true' | |
| run: npm run build:data-provider | |
| - name: Restore data-schemas build cache | |
| id: cache-data-schemas | |
| uses: actions/cache@v5 | |
| with: | |
| path: packages/data-schemas/dist | |
| key: build-data-schemas-${{ runner.os }}-${{ hashFiles('package.json', 'package-lock.json', 'packages/data-schemas/src/**', 'packages/data-schemas/tsconfig*.json', 'packages/data-schemas/tsdown.config.mjs', 'packages/data-schemas/package.json', 'packages/data-provider/src/**', 'packages/data-provider/tsconfig*.json', 'packages/data-provider/tsdown.config.mjs', 'packages/data-provider/package.json') }} | |
| - name: Build data-schemas | |
| if: steps.cache-data-schemas.outputs.cache-hit != 'true' | |
| run: npm run build:data-schemas | |
| - name: Restore api build cache | |
| id: cache-api | |
| uses: actions/cache@v5 | |
| with: | |
| path: packages/api/dist | |
| key: build-api-${{ runner.os }}-${{ hashFiles('package.json', 'package-lock.json', 'packages/api/src/**', 'packages/api/tsconfig*.json', 'packages/api/tsdown.config.mjs', 'packages/api/package.json', 'packages/data-provider/src/**', 'packages/data-provider/tsconfig*.json', 'packages/data-provider/tsdown.config.mjs', 'packages/data-provider/package.json', 'packages/data-schemas/src/**', 'packages/data-schemas/tsconfig*.json', 'packages/data-schemas/tsdown.config.mjs', 'packages/data-schemas/package.json') }} | |
| - name: Build api | |
| if: steps.cache-api.outputs.cache-hit != 'true' | |
| run: npm run build:api | |
| - name: Run integration tests | |
| working-directory: packages/api | |
| env: | |
| NODE_ENV: test | |
| REDIS_URI: redis://127.0.0.1:6379 | |
| run: npm run test:integration |