mirror of
https://github.com/zhukunpenglinyutong/jetbrains-cc-gui.git
synced 2026-11-04 15:43:49 +08:00
Replace the per-turn `codex exec` TypeScript SDK path with a persistent `codex app-server --listen stdio://` JSON-RPC connection managed by the Node daemon: Java -> DaemonBridge -> persistent CodexAppServerService -> native app-server, one initialized child per chat host with native thread/turn lifecycle. Node (ai-bridge): - Add app-server stdio client (handshake, request/reply registries, classified errors, uncertainty budget) and the operation service (session FIFO, frozen settings revisions, reverse interactions, item/plan/compaction projections, launch-config rebuild at idle). - Add persistent per-session service wrapper, CLI resolver with legacy dependency fallback, sanitized runtime environments, native history/ subagents/catalog readers, privacy journal, and ephemeral text requests for prompt enhancement, commit generation and session titles. - Remove the TypeScript SDK load path and JSONL re-read from live turns. Java: - Rewrite CodexSDKBridge on the provider facade: structured daemon routing with channel/epoch/runtime-generation gates, thread ownership registry, interaction registry with page tokens, native history reader with offline-only legacy fallback, and daemon lifecycle coordination. - Add interaction/data/workspace-diff handlers, file navigation helper, native file-change undo plan (patch reversal, rename baselines), and Codex history merger for restored sessions. - Route Codex runtime management to the shared CLI detection page; drop the Codex SDK dependency definition and install entries. - Wire send identity (clientMessageId), stream-end release on startup errors, and per-origin diff/undo receipt routing. Webview: - Add native plan state, compaction status, turn activity, session edit ledger, workspace diff dialog, patch/file-change cards, command presentation, desktop attachment envelope handling, and Codex command dispatch (/compact, /diff, /approvals, execute plan). - Align skill filtering with the native `enabled` field, complete the codexQuota locale block for all 10 languages, and keep cached normalization for high-volume message rendering. BREAKING CHANGE (internal): Codex approvals switch from boolean file IPC to structured bidirectional events carrying runtime/thread/turn/ item/RPC identity. Other providers keep their existing protocols. Approval requests now follow Codex native policy instead of treating every started tool as pending. Verified: Node 1142 tests (1139 passed / 3 platform skips), Java 1655 tests across 204 suites plus Checkstyle/JaCoCo, webview 2178 vitest tests and tsc, four-viewport Playwright suites, openspec strict validation (71 requirements / 392 scenarios), JDK21 buildPlugin.
159 lines
4.7 KiB
YAML
159 lines
4.7 KiB
YAML
name: Tests
|
|
|
|
# CI test coverage for every component of the plugin:
|
|
# - ai-bridge unit tests (node:test)
|
|
# - webview unit tests (vitest + tsc typecheck)
|
|
# - Java unit tests (Linux)
|
|
# - WSL integration tests (Windows + WSL)
|
|
# All jobs run in parallel and are intentionally independent of build.yml, so a
|
|
# test failure can never block the Build Plugin job.
|
|
on:
|
|
push:
|
|
branches: [ '**' ]
|
|
pull_request:
|
|
branches: [ '**' ]
|
|
|
|
jobs:
|
|
# ai-bridge tests use Node's built-in test runner (node:test). They are
|
|
# invoked from the repository root because api-config.test.js resolves modules
|
|
# via path.resolve('ai-bridge/...') relative to the working directory.
|
|
ai-bridge:
|
|
name: ai-bridge unit tests (${{ matrix.os }})
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
os: [ubuntu-latest, windows-latest]
|
|
runs-on: ${{ matrix.os }}
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v6
|
|
|
|
- name: Setup Node.js 22
|
|
uses: actions/setup-node@v6
|
|
with:
|
|
node-version: '22.12.0'
|
|
|
|
# The Codex runtime environment parses native config.toml via smol-toml,
|
|
# so the test import chain needs ai-bridge node_modules on a fresh checkout.
|
|
- name: Install ai-bridge dependencies
|
|
working-directory: ai-bridge
|
|
run: npm ci
|
|
|
|
- name: Run ai-bridge tests
|
|
run: node --test "ai-bridge/**/*.test.js" "ai-bridge/**/*.test.mjs"
|
|
|
|
# webview unit tests: vitest run plus a typecheck of the test sources.
|
|
# No build step is needed — the vitest suite operates against source, not dist.
|
|
webview:
|
|
name: webview unit tests
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v6
|
|
|
|
- name: Setup Node.js 22
|
|
uses: actions/setup-node@v6
|
|
with:
|
|
node-version: '22.12.0'
|
|
|
|
- name: Install dependencies
|
|
working-directory: webview
|
|
run: npm ci
|
|
|
|
- name: Generate version file
|
|
# src/version/version.ts is auto-generated from build.gradle by the
|
|
# prebuild script and is gitignored, so it is absent on a fresh
|
|
# checkout. Tests import it (e.g. WelcomeScreen.tsx), so generate it
|
|
# before running vitest.
|
|
working-directory: webview
|
|
run: npm run prebuild
|
|
|
|
- name: Run webview tests
|
|
working-directory: webview
|
|
run: npm run test
|
|
|
|
# Full Java unit-test suite on Linux. The NodeDetectorWslTest integration
|
|
# tests are Windows+WSL-gated (they Assume Windows+WSL) and are SKIPPED here;
|
|
# they run in the java-wsl job below so the WSL path behaviour is actually
|
|
# exercised.
|
|
java-linux:
|
|
name: Java unit tests (Linux)
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v6
|
|
|
|
- name: Setup JDK 21
|
|
uses: actions/setup-java@v5
|
|
with:
|
|
java-version: '21'
|
|
distribution: 'temurin'
|
|
|
|
- name: Setup Node.js 22
|
|
uses: actions/setup-node@v6
|
|
with:
|
|
node-version: '22.12.0'
|
|
|
|
- name: Setup Gradle
|
|
uses: gradle/actions/setup-gradle@v5
|
|
|
|
- name: Install webview dependencies
|
|
working-directory: webview
|
|
run: npm ci
|
|
|
|
- name: Install ai-bridge dependencies
|
|
working-directory: ai-bridge
|
|
run: npm ci
|
|
|
|
- name: Run tests
|
|
run: ./gradlew test
|
|
|
|
# Runs the Windows+WSL integration tests that the Linux job cannot exercise.
|
|
# Vampire/setup-wsl installs a real WSL distro so isWslPath /
|
|
# resolveWslHomeUncPath / resolveHomeForFileOps behave as on a developer's
|
|
# Windows+WSL machine. The tests still Assume WSL availability, so they
|
|
# self-skip if the distro fails to come up rather than producing false
|
|
# failures.
|
|
java-wsl:
|
|
name: WSL integration tests (Windows)
|
|
runs-on: windows-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v6
|
|
|
|
- name: Setup JDK 21
|
|
uses: actions/setup-java@v5
|
|
with:
|
|
java-version: '21'
|
|
distribution: 'temurin'
|
|
|
|
- name: Setup Node.js 22
|
|
uses: actions/setup-node@v6
|
|
with:
|
|
node-version: '22.12.0'
|
|
|
|
- name: Set up WSL
|
|
uses: Vampire/setup-wsl@v7
|
|
with:
|
|
distribution: Ubuntu-22.04
|
|
|
|
- name: Install Node.js inside WSL
|
|
shell: wsl-bash {0}
|
|
run: |
|
|
sudo apt-get update
|
|
sudo apt-get install -y nodejs
|
|
|
|
- name: Setup Gradle
|
|
uses: gradle/actions/setup-gradle@v5
|
|
|
|
- name: Install webview dependencies
|
|
working-directory: webview
|
|
run: npm ci
|
|
|
|
- name: Install ai-bridge dependencies
|
|
working-directory: ai-bridge
|
|
run: npm ci
|
|
|
|
- name: Run WSL integration tests
|
|
run: ./gradlew test --tests "com.github.claudecodegui.bridge.NodeDetectorWslTest"
|