diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml deleted file mode 100644 index 6b3a3e33d7..0000000000 --- a/.github/workflows/build.yml +++ /dev/null @@ -1,86 +0,0 @@ -name: Build - -on: - pull_request: - branches: ["**"] - merge_group: - workflow_dispatch: # Allow manual triggering - -jobs: - build-macos: - name: Build macOS - runs-on: ${{ github.repository_owner == 'coder' && 'depot-macos-15' || 'macos-latest' }} - steps: - - name: Checkout code - uses: actions/checkout@v4 - with: - fetch-depth: 0 # Required for git describe to find tags - - - uses: ./.github/actions/setup-mux - - # No code signing - releases use release.yml (triggered by tag publish). - # Without CSC_LINK, x64 and arm64 builds run in parallel (~12 min faster). - - name: Package for macOS - run: make dist-mac - - - name: Upload macOS DMG (x64) - uses: actions/upload-artifact@v4 - with: - name: macos-dmg-x64 - path: release/*-x64.dmg - retention-days: 30 - if-no-files-found: error - - - name: Upload macOS DMG (arm64) - uses: actions/upload-artifact@v4 - with: - name: macos-dmg-arm64 - path: release/*-arm64.dmg - retention-days: 30 - if-no-files-found: error - - build-linux: - name: Build Linux - runs-on: ${{ github.repository_owner == 'coder' && 'depot-ubuntu-22.04-16' || 'ubuntu-latest' }} - steps: - - name: Checkout code - uses: actions/checkout@v4 - with: - fetch-depth: 0 # Required for git describe to find tags - - - uses: ./.github/actions/setup-mux - - - name: Build application - run: bun run build - - - name: Package for Linux - run: make dist-linux - - - name: Upload Linux AppImage - uses: actions/upload-artifact@v4 - with: - name: linux-appimage - path: release/*.AppImage - retention-days: 30 - if-no-files-found: error - - build-vscode-extension: - name: Build VS Code Extension - runs-on: ${{ github.repository_owner == 'coder' && 'depot-ubuntu-22.04-16' || 'ubuntu-latest' }} - steps: - - name: Checkout code - uses: actions/checkout@v4 - with: - fetch-depth: 0 # Required for git describe to find tags - - - uses: ./.github/actions/setup-mux - - - uses: ./.github/actions/build-vscode-extension - - - name: Upload VS Code extension artifact - uses: actions/upload-artifact@v4 - with: - name: vscode-extension - path: vscode/mux-*.vsix - retention-days: 30 - if-no-files-found: error diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml deleted file mode 100644 index fc13a60377..0000000000 --- a/.github/workflows/ci.yml +++ /dev/null @@ -1,312 +0,0 @@ -name: CI - -on: - pull_request: - branches: ["**"] - merge_group: - workflow_dispatch: - inputs: - test_filter: - description: 'Optional test filter (e.g., "workspace", "tests/file.test.ts", or "-t pattern")' - required: false - type: string - # This filter is passed to unit tests, integration tests, e2e tests, and storybook tests - # to enable faster iteration when debugging specific test failures in CI - -concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} - cancel-in-progress: true - -jobs: - static-check: - name: Static Checks (lint + typecheck + fmt) - runs-on: ${{ github.repository_owner == 'coder' && 'depot-ubuntu-22.04-16' || 'ubuntu-latest' }} - steps: - - name: Checkout code - uses: actions/checkout@v4 - with: - fetch-depth: 0 # Required for git describe to find tags - - - uses: ./.github/actions/setup-mux - - - name: Generate version file - run: ./scripts/generate-version.sh - - - name: Cache shfmt - id: cache-shfmt - uses: actions/cache@v4 - with: - path: ~/.local/bin/shfmt - # We install latest via webinstall; reflect that in the cache key to avoid pinning mismatches - key: ${{ runner.os }}-shfmt-latest - restore-keys: | - ${{ runner.os }}-shfmt- - - - name: Install and setup shfmt - run: | - # Install shfmt if not cached or if cached binary is broken - if [[ ! -f "$HOME/.local/bin/shfmt" ]] || ! "$HOME/.local/bin/shfmt" --version >/dev/null 2>&1; then - curl -sS https://webinstall.dev/shfmt | bash - fi - echo "$HOME/.local/bin" >> $GITHUB_PATH - # Verify shfmt is available - "$HOME/.local/bin/shfmt" --version - - - name: Install Nix - uses: cachix/install-nix-action@v27 - with: - extra_nix_config: | - experimental-features = nix-command flakes - - - name: Install uv - run: curl -LsSf https://astral.sh/uv/install.sh | sh - - - name: Add uv to PATH - run: echo "$HOME/.local/bin" >> $GITHUB_PATH - - - name: Run static checks - run: make -j3 static-check - - test: - name: Unit Tests - runs-on: ${{ github.repository_owner == 'coder' && 'depot-ubuntu-22.04-16' || 'ubuntu-latest' }} - steps: - - name: Checkout code - uses: actions/checkout@v4 - with: - fetch-depth: 0 # Required for git describe to find tags - - - uses: ./.github/actions/setup-mux - - - name: Build worker files - run: make build-main - - - name: Run tests with coverage - run: bun test --coverage --coverage-reporter=lcov ${{ github.event.inputs.test_filter || 'src' }} - - - name: Upload coverage to Codecov - uses: codecov/codecov-action@v5 - with: - token: ${{ secrets.CODECOV_TOKEN }} - files: ./coverage/lcov.info - flags: unit-tests - fail_ci_if_error: false - - integration-test: - name: Integration Tests - timeout-minutes: 10 - runs-on: ${{ github.repository_owner == 'coder' && 'depot-ubuntu-22.04-16' || 'ubuntu-latest' }} - steps: - - name: Checkout code - uses: actions/checkout@v4 - with: - fetch-depth: 0 # Required for git describe to find tags - - - uses: ./.github/actions/setup-mux - - - name: Build worker files - run: make build-main - - - name: Run all integration tests with coverage - # --silent suppresses per-test output (17+ test files × workers = overwhelming logs) - run: TEST_INTEGRATION=1 bun x jest --coverage --maxWorkers=100% --silent ${{ github.event.inputs.test_filter || 'tests' }} - env: - OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} - ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }} - - - name: Upload coverage to Codecov - uses: codecov/codecov-action@v5 - with: - token: ${{ secrets.CODECOV_TOKEN }} - files: ./coverage/lcov.info - flags: integration-tests - fail_ci_if_error: false - - storybook-test: - name: Storybook Interaction Tests - runs-on: ${{ github.repository_owner == 'coder' && 'depot-ubuntu-22.04-16' || 'ubuntu-latest' }} - if: github.event.inputs.test_filter == '' - steps: - - name: Checkout code - uses: actions/checkout@v4 - with: - fetch-depth: 0 # Required for git describe to find tags - - - uses: ./.github/actions/setup-mux - - - uses: ./.github/actions/setup-playwright - - - name: Build Storybook - run: make storybook-build - - - name: Serve Storybook - run: | - bun x http-server storybook-static -p 6006 & - sleep 5 - - - name: Run Storybook tests - run: make test-storybook - - e2e-test: - name: E2E Tests (${{ matrix.os }}) - if: github.event.inputs.test_filter == '' - strategy: - fail-fast: false - matrix: - include: - # Linux: comprehensive E2E tests - - os: linux - runner: ${{ github.repository_owner == 'coder' && 'depot-ubuntu-22.04-16' || 'ubuntu-latest' }} - test_scope: "all" - # macOS: window lifecycle and platform-dependent tests only - - os: macos - runner: ${{ github.repository_owner == 'coder' && 'depot-macos-latest' || 'macos-latest' }} - test_scope: "window-lifecycle" - runs-on: ${{ matrix.runner }} - steps: - - name: Checkout code - uses: actions/checkout@v4 - with: - fetch-depth: 0 # Required for git describe to find tags - - - uses: ./.github/actions/setup-mux - - - name: Install xvfb (Linux) - if: matrix.os == 'linux' - run: | - sudo apt-get update - sudo apt-get install -y xvfb - - - uses: ./.github/actions/setup-playwright - - - name: Run comprehensive e2e tests (Linux) - if: matrix.os == 'linux' - run: xvfb-run -a make test-e2e - env: - ELECTRON_DISABLE_SANDBOX: 1 - - - name: Run window lifecycle e2e tests (macOS) - if: matrix.os == 'macos' - run: make test-e2e PLAYWRIGHT_ARGS="tests/e2e/scenarios/windowLifecycle.spec.ts" - - docker-smoke-test: - name: Docker Smoke Test - runs-on: ${{ github.repository_owner == 'coder' && 'depot-ubuntu-22.04-16' || 'ubuntu-latest' }} - # Only run in merge queue (Docker builds are slow) - if: github.event_name == 'merge_group' - steps: - - name: Checkout code - uses: actions/checkout@v4 - with: - fetch-depth: 0 # Required for git describe to find tags - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - - - name: Build Docker image - uses: docker/build-push-action@v6 - with: - context: . - load: true - tags: mux-server:test - cache-from: type=gha - cache-to: type=gha,mode=max - - - name: Start container - run: | - docker run -d --name mux-test -p 3000:3000 mux-server:test - # Wait for server to be ready - for i in {1..30}; do - if curl -sf http://localhost:3000/health; then - echo "Server is ready" - break - fi - echo "Waiting for server... ($i/30)" - sleep 1 - done - - - name: Health check - run: | - response=$(curl -sf http://localhost:3000/health) - echo "Health response: $response" - if ! echo "$response" | grep -q '"status":"ok"'; then - echo "Health check failed" - exit 1 - fi - - - name: Version check - run: | - response=$(curl -sf http://localhost:3000/version) - echo "Version response: $response" - # Verify response contains expected fields - if ! echo "$response" | grep -q '"mode":"server"'; then - echo "Version check failed: missing mode=server" - exit 1 - fi - if ! echo "$response" | grep -q '"git_describe"'; then - echo "Version check failed: missing git_describe field" - exit 1 - fi - - - name: Show container logs on failure - if: failure() - run: docker logs mux-test - - - name: Cleanup - if: always() - run: docker rm -f mux-test || true - - mux-server-smoke-test: - name: Mux Server Smoke Test - runs-on: ${{ github.repository_owner == 'coder' && 'depot-ubuntu-22.04-16' || 'ubuntu-latest' }} - # Tests oRPC/WebSocket flows that catch MockBrowserWindow bugs - steps: - - name: Checkout code - uses: actions/checkout@v4 - with: - fetch-depth: 0 # Required for git describe to find tags - - - uses: ./.github/actions/setup-mux - - - name: Build application - run: make build - - - name: Pack npm package - run: npm pack - - - name: Run smoke test - env: - SERVER_PORT: 3001 - SERVER_HOST: localhost - STARTUP_TIMEOUT: 30 - run: | - # Find the actual tarball name (version may vary) - TARBALL=$(ls mux-*.tgz | head -1) - PACKAGE_TARBALL="$TARBALL" ./scripts/smoke-test.sh - - - name: Upload server logs on failure - if: failure() - uses: actions/upload-artifact@v4 - with: - name: mux-server-smoke-test-logs - path: /tmp/tmp.*/server.log - if-no-files-found: warn - retention-days: 7 - - check-codex-comments: - name: Check Codex Comments - runs-on: ${{ github.repository_owner == 'coder' && 'depot-ubuntu-22.04-16' || 'ubuntu-latest' }} - if: github.event_name == 'pull_request' - steps: - - name: Checkout code - uses: actions/checkout@v4 - with: - fetch-depth: 0 # Required for git describe to find tags - - - name: Check for unresolved Codex comments - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: | - ./scripts/check_codex_comments.sh ${{ github.event.pull_request.number }} - -# Trigger CI run diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml new file mode 100644 index 0000000000..ea8fb2e73d --- /dev/null +++ b/.github/workflows/pr.yml @@ -0,0 +1,359 @@ +name: PR + +on: + pull_request: + branches: ["**"] + merge_group: + workflow_dispatch: + inputs: + test_filter: + description: 'Optional test filter (e.g., "workspace", "tests/file.test.ts", or "-t pattern")' + required: false + type: string + +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + +jobs: + # Detect what files changed to determine which jobs/tests to run + changes: + name: Detect Changes + runs-on: ubuntu-latest + outputs: + docs-only: ${{ steps.filter.outputs.docs == 'true' && steps.filter.outputs.src == 'false' && steps.filter.outputs.config == 'false' }} + browser-only: ${{ steps.filter.outputs.browser == 'true' && steps.filter.outputs.backend == 'false' && steps.filter.outputs.config == 'false' }} + steps: + - uses: actions/checkout@v4 + - uses: dorny/paths-filter@v3 + id: filter + with: + filters: | + docs: + - 'docs/**' + - '*.md' + - 'LICENSE' + - '.vscode/**' + src: + - 'src/**' + - 'tests/**' + - 'vscode/**' + browser: + - 'src/browser/**' + - 'src/styles/**' + - '**/*.stories.tsx' + - '.storybook/**' + backend: + - 'src/node/**' + - 'src/cli/**' + - 'src/desktop/**' + - 'src/common/**' + - 'tests/**' + - '!tests/e2e/**' + config: + - '.github/**' + - 'jest.config.cjs' + - 'babel.config.cjs' + - 'package.json' + - 'bun.lockb' + - 'tsconfig*.json' + - 'vite*.ts' + - 'Makefile' + - 'electron-builder.yml' + + static-check: + name: Static Checks + runs-on: ${{ github.repository_owner == 'coder' && 'depot-ubuntu-22.04-16' || 'ubuntu-latest' }} + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + - uses: ./.github/actions/setup-mux + - run: ./scripts/generate-version.sh + - uses: actions/cache@v4 + with: + path: ~/.local/bin/shfmt + key: ${{ runner.os }}-shfmt-latest + - name: Install shfmt + run: | + if [[ ! -f "$HOME/.local/bin/shfmt" ]] || ! "$HOME/.local/bin/shfmt" --version >/dev/null 2>&1; then + curl -sS https://webinstall.dev/shfmt | bash + fi + echo "$HOME/.local/bin" >> $GITHUB_PATH + - uses: cachix/install-nix-action@v27 + with: + extra_nix_config: | + experimental-features = nix-command flakes + - run: curl -LsSf https://astral.sh/uv/install.sh | sh + - run: echo "$HOME/.local/bin" >> $GITHUB_PATH + - run: make -j3 static-check + + test-unit: + name: Test / Unit + needs: [changes] + if: ${{ needs.changes.outputs.docs-only != 'true' }} + runs-on: ${{ github.repository_owner == 'coder' && 'depot-ubuntu-22.04-16' || 'ubuntu-latest' }} + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + - uses: ./.github/actions/setup-mux + - run: make build-main + - run: bun test --coverage --coverage-reporter=lcov ${{ github.event.inputs.test_filter || 'src' }} + - uses: codecov/codecov-action@v5 + with: + token: ${{ secrets.CODECOV_TOKEN }} + files: ./coverage/lcov.info + flags: unit-tests + fail_ci_if_error: false + + test-integration: + name: Test / Integration + needs: [changes] + if: ${{ needs.changes.outputs.docs-only != 'true' }} + timeout-minutes: 10 + runs-on: ${{ github.repository_owner == 'coder' && 'depot-ubuntu-22.04-16' || 'ubuntu-latest' }} + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + - uses: ./.github/actions/setup-mux + - run: make build-main + - name: Run integration tests + run: | + # Manual override + if [[ -n "${{ github.event.inputs.test_filter }}" ]]; then + TEST_INTEGRATION=1 bun x jest --coverage --maxWorkers=100% --silent ${{ github.event.inputs.test_filter }} + exit 0 + fi + + # Browser-only PRs skip IPC tests but run all other integration tests + if [[ "${{ needs.changes.outputs.browser-only }}" == "true" ]]; then + echo "Browser-only PR - skipping tests/ipc" + TEST_INTEGRATION=1 bun x jest --coverage --maxWorkers=100% --silent --testPathIgnorePatterns='tests/ipc' tests/ + exit 0 + fi + + # Default: run ALL integration tests (future-proof for new test directories) + TEST_INTEGRATION=1 bun x jest --coverage --maxWorkers=100% --silent tests/ + env: + OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} + ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }} + - uses: codecov/codecov-action@v5 + if: ${{ steps.test-filter.outputs.filter != '' }} + with: + token: ${{ secrets.CODECOV_TOKEN }} + files: ./coverage/lcov.info + flags: integration-tests + fail_ci_if_error: false + + test-storybook: + name: Test / Storybook + needs: [changes] + if: ${{ needs.changes.outputs.docs-only != 'true' && github.event.inputs.test_filter == '' }} + runs-on: ${{ github.repository_owner == 'coder' && 'depot-ubuntu-22.04-16' || 'ubuntu-latest' }} + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + - uses: ./.github/actions/setup-mux + - uses: ./.github/actions/setup-playwright + - run: make storybook-build + - run: | + bun x http-server storybook-static -p 6006 & + sleep 5 + - run: make test-storybook + + test-e2e: + name: Test / E2E (${{ matrix.os }}) + needs: [changes] + if: ${{ needs.changes.outputs.docs-only != 'true' && github.event.inputs.test_filter == '' }} + strategy: + fail-fast: false + matrix: + include: + - os: linux + runner: ${{ github.repository_owner == 'coder' && 'depot-ubuntu-22.04-16' || 'ubuntu-latest' }} + - os: macos + runner: ${{ github.repository_owner == 'coder' && 'depot-macos-latest' || 'macos-latest' }} + runs-on: ${{ matrix.runner }} + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + - uses: ./.github/actions/setup-mux + - name: Install xvfb + if: matrix.os == 'linux' + run: | + sudo apt-get update + sudo apt-get install -y xvfb + - uses: ./.github/actions/setup-playwright + - name: Run tests + if: matrix.os == 'linux' + run: xvfb-run -a make test-e2e + env: + ELECTRON_DISABLE_SANDBOX: 1 + - name: Run tests + if: matrix.os == 'macos' + run: make test-e2e PLAYWRIGHT_ARGS="tests/e2e/scenarios/windowLifecycle.spec.ts" + + smoke-server: + name: Smoke / Server + needs: [changes] + if: ${{ needs.changes.outputs.docs-only != 'true' }} + runs-on: ${{ github.repository_owner == 'coder' && 'depot-ubuntu-22.04-16' || 'ubuntu-latest' }} + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + - uses: ./.github/actions/setup-mux + - run: make build + - run: npm pack + - env: + SERVER_PORT: 3001 + SERVER_HOST: localhost + STARTUP_TIMEOUT: 30 + run: | + TARBALL=$(ls mux-*.tgz | head -1) + PACKAGE_TARBALL="$TARBALL" ./scripts/smoke-test.sh + - uses: actions/upload-artifact@v4 + if: failure() + with: + name: smoke-server-logs + path: /tmp/tmp.*/server.log + if-no-files-found: warn + retention-days: 7 + + smoke-docker: + name: Smoke / Docker + if: github.event_name == 'merge_group' + runs-on: ${{ github.repository_owner == 'coder' && 'depot-ubuntu-22.04-16' || 'ubuntu-latest' }} + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + - uses: docker/setup-buildx-action@v3 + - uses: docker/build-push-action@v6 + with: + context: . + load: true + tags: mux-server:test + cache-from: type=gha + cache-to: type=gha,mode=max + - name: Test container + run: | + docker run -d --name mux-test -p 3000:3000 mux-server:test + for i in {1..30}; do + curl -sf http://localhost:3000/health && break + echo "Waiting... ($i/30)" + sleep 1 + done + curl -sf http://localhost:3000/health | grep -q '"status":"ok"' + curl -sf http://localhost:3000/version | grep -q '"mode":"server"' + - if: failure() + run: docker logs mux-test + - if: always() + run: docker rm -f mux-test || true + + build-linux: + name: Build / Linux + needs: [changes] + if: ${{ needs.changes.outputs.docs-only != 'true' }} + runs-on: ${{ github.repository_owner == 'coder' && 'depot-ubuntu-22.04-16' || 'ubuntu-latest' }} + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + - uses: ./.github/actions/setup-mux + - run: bun run build + - run: make dist-linux + - uses: actions/upload-artifact@v4 + with: + name: build-linux + path: release/*.AppImage + retention-days: 30 + if-no-files-found: error + + build-macos: + name: Build / macOS + needs: [changes] + if: ${{ needs.changes.outputs.docs-only != 'true' }} + runs-on: ${{ github.repository_owner == 'coder' && 'depot-macos-15' || 'macos-latest' }} + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + - uses: ./.github/actions/setup-mux + - run: make dist-mac + - uses: actions/upload-artifact@v4 + with: + name: build-macos-x64 + path: release/*-x64.dmg + retention-days: 30 + if-no-files-found: error + - uses: actions/upload-artifact@v4 + with: + name: build-macos-arm64 + path: release/*-arm64.dmg + retention-days: 30 + if-no-files-found: error + + build-vscode: + name: Build / VS Code + needs: [changes] + if: ${{ needs.changes.outputs.docs-only != 'true' }} + runs-on: ${{ github.repository_owner == 'coder' && 'depot-ubuntu-22.04-16' || 'ubuntu-latest' }} + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + - uses: ./.github/actions/setup-mux + - uses: ./.github/actions/build-vscode-extension + - uses: actions/upload-artifact@v4 + with: + name: build-vscode + path: vscode/mux-*.vsix + retention-days: 30 + if-no-files-found: error + + codex-comments: + name: Codex Comments + if: github.event_name == 'pull_request' + runs-on: ${{ github.repository_owner == 'coder' && 'depot-ubuntu-22.04-16' || 'ubuntu-latest' }} + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + - env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: ./scripts/check_codex_comments.sh ${{ github.event.pull_request.number }} + + # Single required check - configure branch protection to require only this job + required: + name: Required + if: always() + needs: + - changes + - static-check + - test-unit + - test-integration + - test-storybook + - test-e2e + - smoke-server + - smoke-docker + - build-linux + - build-macos + - build-vscode + - codex-comments + runs-on: ubuntu-latest + steps: + - run: | + results="${{ join(needs.*.result, ' ') }}" + echo "Job results: $results" + for result in $results; do + if [[ "$result" == "failure" || "$result" == "cancelled" ]]; then + echo "❌ CI failed" + exit 1 + fi + done + echo "✅ All checks passed" diff --git a/docs/system-prompt.md b/docs/system-prompt.md index fb5bb1305c..3b7de1ba03 100644 --- a/docs/system-prompt.md +++ b/docs/system-prompt.md @@ -62,5 +62,4 @@ You are in a git worktree at ${workspacePath} } ``` - {/* END SYSTEM_PROMPT_DOCS */} diff --git a/tests/models/knownModels.test.ts b/src/common/constants/knownModels.test.ts similarity index 90% rename from tests/models/knownModels.test.ts rename to src/common/constants/knownModels.test.ts index c880e7a784..ad8f9882c9 100644 --- a/tests/models/knownModels.test.ts +++ b/src/common/constants/knownModels.test.ts @@ -39,9 +39,7 @@ describe("Known Models Integration", () => { const modelId = model.providerModelId; // xAI models are prefixed with "xai/" in models.json const lookupKey = model.provider === "xai" ? `xai/${modelId}` : modelId; - const modelData = - (modelsJson[lookupKey as keyof typeof modelsJson] as Record) ?? - (modelsExtra[modelId as keyof typeof modelsExtra] as unknown as Record); + const modelData = modelsJson[lookupKey as keyof typeof modelsJson] ?? modelsExtra[modelId]; expect(modelData).toBeDefined(); // Check that basic metadata fields exist (not all models have all fields) diff --git a/tests/integration/anthropic1MContext.test.ts b/tests/ipc/anthropic1MContext.test.ts similarity index 100% rename from tests/integration/anthropic1MContext.test.ts rename to tests/ipc/anthropic1MContext.test.ts diff --git a/tests/integration/anthropicCacheStrategy.test.ts b/tests/ipc/anthropicCacheStrategy.test.ts similarity index 100% rename from tests/integration/anthropicCacheStrategy.test.ts rename to tests/ipc/anthropicCacheStrategy.test.ts diff --git a/tests/integration/createWorkspace.test.ts b/tests/ipc/createWorkspace.test.ts similarity index 100% rename from tests/integration/createWorkspace.test.ts rename to tests/ipc/createWorkspace.test.ts diff --git a/tests/integration/doubleRegister.test.ts b/tests/ipc/doubleRegister.test.ts similarity index 100% rename from tests/integration/doubleRegister.test.ts rename to tests/ipc/doubleRegister.test.ts diff --git a/tests/integration/executeBash.test.ts b/tests/ipc/executeBash.test.ts similarity index 100% rename from tests/integration/executeBash.test.ts rename to tests/ipc/executeBash.test.ts diff --git a/tests/integration/forkWorkspace.test.ts b/tests/ipc/forkWorkspace.test.ts similarity index 100% rename from tests/integration/forkWorkspace.test.ts rename to tests/ipc/forkWorkspace.test.ts diff --git a/tests/integration/helpers.ts b/tests/ipc/helpers.ts similarity index 100% rename from tests/integration/helpers.ts rename to tests/ipc/helpers.ts diff --git a/tests/integration/initWorkspace.test.ts b/tests/ipc/initWorkspace.test.ts similarity index 100% rename from tests/integration/initWorkspace.test.ts rename to tests/ipc/initWorkspace.test.ts diff --git a/tests/integration/modelNotFound.test.ts b/tests/ipc/modelNotFound.test.ts similarity index 100% rename from tests/integration/modelNotFound.test.ts rename to tests/ipc/modelNotFound.test.ts diff --git a/tests/integration/ollama.test.ts b/tests/ipc/ollama.test.ts similarity index 100% rename from tests/integration/ollama.test.ts rename to tests/ipc/ollama.test.ts diff --git a/tests/integration/openai-web-search.test.ts b/tests/ipc/openai-web-search.test.ts similarity index 100% rename from tests/integration/openai-web-search.test.ts rename to tests/ipc/openai-web-search.test.ts diff --git a/tests/integration/orpcTestClient.ts b/tests/ipc/orpcTestClient.ts similarity index 100% rename from tests/integration/orpcTestClient.ts rename to tests/ipc/orpcTestClient.ts diff --git a/tests/integration/projectCreate.test.ts b/tests/ipc/projectCreate.test.ts similarity index 100% rename from tests/integration/projectCreate.test.ts rename to tests/ipc/projectCreate.test.ts diff --git a/tests/integration/projectRefactor.test.ts b/tests/ipc/projectRefactor.test.ts similarity index 100% rename from tests/integration/projectRefactor.test.ts rename to tests/ipc/projectRefactor.test.ts diff --git a/tests/integration/queuedMessages.test.ts b/tests/ipc/queuedMessages.test.ts similarity index 100% rename from tests/integration/queuedMessages.test.ts rename to tests/ipc/queuedMessages.test.ts diff --git a/tests/integration/removeWorkspace.test.ts b/tests/ipc/removeWorkspace.test.ts similarity index 100% rename from tests/integration/removeWorkspace.test.ts rename to tests/ipc/removeWorkspace.test.ts diff --git a/tests/integration/renameWorkspace.test.ts b/tests/ipc/renameWorkspace.test.ts similarity index 100% rename from tests/integration/renameWorkspace.test.ts rename to tests/ipc/renameWorkspace.test.ts diff --git a/tests/integration/resumeStream.test.ts b/tests/ipc/resumeStream.test.ts similarity index 100% rename from tests/integration/resumeStream.test.ts rename to tests/ipc/resumeStream.test.ts diff --git a/tests/integration/runtimeExecuteBash.test.ts b/tests/ipc/runtimeExecuteBash.test.ts similarity index 100% rename from tests/integration/runtimeExecuteBash.test.ts rename to tests/ipc/runtimeExecuteBash.test.ts diff --git a/tests/integration/runtimeFileEditing.test.ts b/tests/ipc/runtimeFileEditing.test.ts similarity index 100% rename from tests/integration/runtimeFileEditing.test.ts rename to tests/ipc/runtimeFileEditing.test.ts diff --git a/tests/integration/sendMessage.basic.test.ts b/tests/ipc/sendMessage.basic.test.ts similarity index 100% rename from tests/integration/sendMessage.basic.test.ts rename to tests/ipc/sendMessage.basic.test.ts diff --git a/tests/integration/sendMessage.context.test.ts b/tests/ipc/sendMessage.context.test.ts similarity index 100% rename from tests/integration/sendMessage.context.test.ts rename to tests/ipc/sendMessage.context.test.ts diff --git a/tests/integration/sendMessage.errors.test.ts b/tests/ipc/sendMessage.errors.test.ts similarity index 100% rename from tests/integration/sendMessage.errors.test.ts rename to tests/ipc/sendMessage.errors.test.ts diff --git a/tests/integration/sendMessage.heavy.test.ts b/tests/ipc/sendMessage.heavy.test.ts similarity index 100% rename from tests/integration/sendMessage.heavy.test.ts rename to tests/ipc/sendMessage.heavy.test.ts diff --git a/tests/integration/sendMessage.images.test.ts b/tests/ipc/sendMessage.images.test.ts similarity index 100% rename from tests/integration/sendMessage.images.test.ts rename to tests/ipc/sendMessage.images.test.ts diff --git a/tests/integration/sendMessage.reasoning.test.ts b/tests/ipc/sendMessage.reasoning.test.ts similarity index 100% rename from tests/integration/sendMessage.reasoning.test.ts rename to tests/ipc/sendMessage.reasoning.test.ts diff --git a/tests/integration/sendMessageTestHelpers.ts b/tests/ipc/sendMessageTestHelpers.ts similarity index 100% rename from tests/integration/sendMessageTestHelpers.ts rename to tests/ipc/sendMessageTestHelpers.ts diff --git a/tests/integration/setup.ts b/tests/ipc/setup.ts similarity index 100% rename from tests/integration/setup.ts rename to tests/ipc/setup.ts diff --git a/tests/integration/streamCollector.ts b/tests/ipc/streamCollector.ts similarity index 100% rename from tests/integration/streamCollector.ts rename to tests/ipc/streamCollector.ts diff --git a/tests/integration/streamErrorRecovery.test.ts b/tests/ipc/streamErrorRecovery.test.ts similarity index 100% rename from tests/integration/streamErrorRecovery.test.ts rename to tests/ipc/streamErrorRecovery.test.ts diff --git a/tests/integration/terminal.test.ts b/tests/ipc/terminal.test.ts similarity index 100% rename from tests/integration/terminal.test.ts rename to tests/ipc/terminal.test.ts diff --git a/tests/integration/truncate.test.ts b/tests/ipc/truncate.test.ts similarity index 100% rename from tests/integration/truncate.test.ts rename to tests/ipc/truncate.test.ts diff --git a/tests/integration/usageDelta.test.ts b/tests/ipc/usageDelta.test.ts similarity index 100% rename from tests/integration/usageDelta.test.ts rename to tests/ipc/usageDelta.test.ts diff --git a/tests/integration/websocketHistoryReplay.test.ts b/tests/ipc/websocketHistoryReplay.test.ts similarity index 100% rename from tests/integration/websocketHistoryReplay.test.ts rename to tests/ipc/websocketHistoryReplay.test.ts diff --git a/tests/integration/windowTitle.test.ts b/tests/ipc/windowTitle.test.ts similarity index 100% rename from tests/integration/windowTitle.test.ts rename to tests/ipc/windowTitle.test.ts diff --git a/tests/setup.ts b/tests/setup.ts index df6f47bc0e..c334234346 100644 --- a/tests/setup.ts +++ b/tests/setup.ts @@ -28,7 +28,7 @@ if (typeof globalThis.File === "undefined") { if (process.env.TEST_INTEGRATION === "1") { // Store promise globally to ensure it blocks subsequent test execution (globalThis as any).__muxPreloadPromise = (async () => { - const { preloadTestModules } = await import("./integration/setup"); + const { preloadTestModules } = await import("./ipc/setup"); await preloadTestModules(); })();