Skip to content

refactor: remove dynamic content from system prompt for better prefix caching #2032

refactor: remove dynamic content from system prompt for better prefix caching

refactor: remove dynamic content from system prompt for better prefix caching #2032

Workflow file for this run

name: CI
on:
push:
branches: [main]
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
permissions:
contents: read
env:
CI: "true"
BUN_VERSION: "latest"
jobs:
lint:
name: Lint / Format
runs-on: ubuntu-24.04
if: github.event_name == 'push' || github.event.pull_request.draft == false
steps:
- uses: actions/checkout@v6
- name: Setup Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: ${{ env.BUN_VERSION }}
- name: Cache dependencies
id: deps-cache
uses: actions/cache@v5
with:
path: |
node_modules
packages/*/node_modules
packages/providers/*/node_modules
apps/*/node_modules
key: deps-${{ runner.os }}-${{ hashFiles('bun.lock') }}
- name: Install dependencies
if: steps.deps-cache.outputs.cache-hit != 'true'
run: bun install --frozen-lockfile
- name: Lint & Format check
run: bun run format-and-lint
typecheck:
name: Type Check
runs-on: ubuntu-24.04
if: github.event_name == 'push' || github.event.pull_request.draft == false
steps:
- uses: actions/checkout@v6
- name: Setup Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: ${{ env.BUN_VERSION }}
- name: Cache dependencies
id: deps-cache
uses: actions/cache@v5
with:
path: |
node_modules
packages/*/node_modules
packages/providers/*/node_modules
apps/*/node_modules
key: deps-${{ runner.os }}-${{ hashFiles('bun.lock') }}
- name: Install dependencies
if: steps.deps-cache.outputs.cache-hit != 'true'
run: bun install --frozen-lockfile
- name: Restore turbo cache
uses: actions/cache@v5
with:
path: .turbo
key: turbo-typecheck-${{ runner.os }}-${{ hashFiles('**/*.[tj]s', '**/*.[tj]sx', 'bun.lock') }}
restore-keys: |
turbo-typecheck-${{ runner.os }}-
- name: Type check
run: bun run typecheck
check-deps:
name: Check Dependencies
runs-on: ubuntu-24.04
if: github.event_name == 'push' || github.event.pull_request.draft == false
steps:
- uses: actions/checkout@v6
- name: Setup Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: ${{ env.BUN_VERSION }}
- name: Cache dependencies
id: deps-cache
uses: actions/cache@v5
with:
path: |
node_modules
packages/*/node_modules
packages/providers/*/node_modules
apps/*/node_modules
key: deps-${{ runner.os }}-${{ hashFiles('bun.lock') }}
- name: Install dependencies
if: steps.deps-cache.outputs.cache-hit != 'true'
run: bun install --frozen-lockfile
- name: Check unused dependencies
run: bun run check-deps
validate-versions:
name: Validate Versions
runs-on: ubuntu-24.04
if: github.event_name == 'push' || github.event.pull_request.draft == false
steps:
- uses: actions/checkout@v6
- name: Setup Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: ${{ env.BUN_VERSION }}
- name: Cache dependencies
id: deps-cache
uses: actions/cache@v5
with:
path: |
node_modules
packages/*/node_modules
packages/providers/*/node_modules
apps/*/node_modules
key: deps-${{ runner.os }}-${{ hashFiles('bun.lock') }}
- name: Install dependencies
if: steps.deps-cache.outputs.cache-hit != 'true'
run: bun install --frozen-lockfile
- name: Validate version sync
run: bun run validate:versions
validate-changeset:
name: Validate Changeset
runs-on: ubuntu-24.04
if: github.event_name == 'pull_request' && github.event.pull_request.draft == false
steps:
- uses: actions/checkout@v6
- name: Setup Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: ${{ env.BUN_VERSION }}
- name: Cache dependencies
id: deps-cache
uses: actions/cache@v5
with:
path: |
node_modules
packages/*/node_modules
packages/providers/*/node_modules
apps/*/node_modules
key: deps-${{ runner.os }}-${{ hashFiles('bun.lock') }}
- name: Install dependencies
if: steps.deps-cache.outputs.cache-hit != 'true'
run: bun install --frozen-lockfile
- name: Validate changesets
run: bun run validate:changeset
check-schema-diff:
name: Check Schema Diff
runs-on: ubuntu-24.04
if: github.event_name == 'pull_request' && github.event.pull_request.draft == false
steps:
- uses: actions/checkout@v6
- name: Setup Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: ${{ env.BUN_VERSION }}
- name: Cache dependencies
id: deps-cache
uses: actions/cache@v5
with:
path: |
node_modules
packages/*/node_modules
packages/providers/*/node_modules
apps/*/node_modules
key: deps-${{ runner.os }}-${{ hashFiles('bun.lock') }}
- name: Install dependencies
if: steps.deps-cache.outputs.cache-hit != 'true'
run: bun install --frozen-lockfile
- name: Check schema diff
run: bun run check:schema-diff
test:
name: Test
runs-on: ubuntu-24.04
if: github.event_name == 'push' || github.event.pull_request.draft == false
steps:
- uses: actions/checkout@v6
- name: Setup Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: ${{ env.BUN_VERSION }}
- name: Cache dependencies
id: deps-cache
uses: actions/cache@v5
with:
path: |
node_modules
packages/*/node_modules
packages/providers/*/node_modules
apps/*/node_modules
key: deps-${{ runner.os }}-${{ hashFiles('bun.lock') }}
- name: Install dependencies
if: steps.deps-cache.outputs.cache-hit != 'true'
run: bun install --frozen-lockfile
- name: Prepare test environment
run: bun run reset
- name: Run tests
run: bun run test
build:
name: Build
runs-on: ubuntu-24.04
if: github.event_name == 'push' || github.event.pull_request.draft == false
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Setup Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: ${{ env.BUN_VERSION }}
- name: Cache dependencies
id: deps-cache
uses: actions/cache@v5
with:
path: |
node_modules
packages/*/node_modules
packages/providers/*/node_modules
apps/*/node_modules
key: deps-${{ runner.os }}-${{ hashFiles('bun.lock') }}
- name: Install dependencies
if: steps.deps-cache.outputs.cache-hit != 'true'
run: bun install --frozen-lockfile
- name: Restore turbo cache
uses: actions/cache@v5
with:
path: .turbo
key: turbo-${{ runner.os }}-${{ hashFiles('**/*.[tj]s', '**/*.[tj]sx', 'bun.lock') }}
restore-keys: |
turbo-${{ runner.os }}-
- name: Build all packages
run: bun run build
env:
NODE_ENV: production
changeset-check:
name: Changeset Check
runs-on: ubuntu-24.04
if: github.event_name == 'pull_request' && github.event.pull_request.draft == false && !startsWith(github.head_ref, 'dependabot/') && !startsWith(github.head_ref, 'changeset-release/')
steps:
- name: Checkout
uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Check if package source code changed
id: check_files
run: |
PACKAGE_CHANGES=$(git diff --name-only origin/main...HEAD -- apps/ packages/ | grep -v '\.md$' || true)
if [ -z "$PACKAGE_CHANGES" ]; then
echo "needs_changeset=false" >> "$GITHUB_OUTPUT"
echo "No package source changes — skipping changeset check"
else
echo "needs_changeset=true" >> "$GITHUB_OUTPUT"
fi
- name: Setup Bun
if: steps.check_files.outputs.needs_changeset == 'true'
uses: oven-sh/setup-bun@v2
with:
bun-version: ${{ env.BUN_VERSION }}
- name: Cache dependencies
id: deps-cache
if: steps.check_files.outputs.needs_changeset == 'true'
uses: actions/cache@v5
with:
path: |
node_modules
packages/*/node_modules
packages/providers/*/node_modules
apps/*/node_modules
key: deps-${{ runner.os }}-${{ hashFiles('bun.lock') }}
- name: Install dependencies
if: steps.check_files.outputs.needs_changeset == 'true' && steps.deps-cache.outputs.cache-hit != 'true'
run: bun install --frozen-lockfile
- name: Check changeset
if: steps.check_files.outputs.needs_changeset == 'true'
run: bunx changeset status --since=origin/main