Commit Graph
11 Commits
Author SHA1 Message Date
Gadfly 983705f5d0 feat(codex): migrate Codex runtime to persistent app-server
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.
2026-10-05 03:18:18 +08:00
zhukunpenglinyutong 14b5fdceb9 ci: guard main against PRs targeting the wrong base branch
Add a workflow that fails and comments on any PR targeting main unless
it is a maintainer release PR from a feature/* branch, plus a PR
template reminding contributors to target the active development
branch. The check is enforced as a required status check on main.
2026-09-15 16:37:35 +08:00
Gadfly 7b75df6df3 fix: correct provider runtime, usage and cross-platform regressions
Keep persistent Claude sessions consistent when runtime acquisition,
permission changes and background task results overlap. Correct relay quota
isolation, gate Codex auto review on verified SDK support, and restore native
Windows terminal execution with regression coverage on both operating systems.

Claude runtime and permissions:
- Serialize runtime acquisition for the same session or anonymous signature
  so concurrent requests share one runtime.
- Queue permission transitions, record the mode acknowledged by the SDK and
  prevent superseded callers or disposed runtimes from reverting newer state.
- Rebuild anonymous runtimes after bypass-mode changes within the same epoch.
- Use SDK task-notification provenance to ignore background results while
  accepting valid result-only user turns immediately; remove the obsolete
  idle backstop, timer hooks and output-presence heuristic.
- Preserve explicit abort errors during reader quiescence and allowlist
  read-only MCP tools by their complete names instead of action prefixes.

Relay usage:
- Replace the single-entry cache with a bounded, synchronized cache that
  copies payloads at its boundaries and handles expiry and clock rollback.
- Isolate quotas by vendor, canonical endpoint and credential digest, with
  model-specific keys for MiniMax; avoid retaining raw tokens in cache keys.
- Correct IPv6 loopback origins, vendor host matching, reset timestamps and
  empty capacity responses, with cache and parser regression tests.

Codex and webview:
- Require an affirmative SDK capability result before enabling native auto
  review, including the final send path for text and attachment requests.
- Normalize environment blocklist keys and legacy permission aliases without
  case-sensitive gaps.
- Constrain the model menu to the available viewport while keeping its action
  rows visible, and cover narrow and short layouts in browser tests.
- Repair stale test fixtures, TypeScript errors and missing hook inputs.

Windows execution and portable tests:
- Spawn Windows executables with intact argv and reuse the existing .cmd/.bat
  launcher; execute command strings through cmd with native flags instead of
  passing POSIX scripts or login-shell flags to cmd.exe.
- Preserve the Windows environment needed by native tools and verify literal
  arguments, actual failure exit codes and CLI paths containing spaces.
- Replace platform-specific path expectations and the Java /bin/sh fixture
  with portable assertions and temporary test files.
- Reuse isolated Claude login fixtures so unit tests do not read a developer's
  credentials, and run both .test.js and .test.mjs in Linux/Windows CI jobs.

Validation:
- ai-bridge on Linux (WSL Ubuntu, Node 22.12.0): 661 passed, no failures/skips.
- ai-bridge on Windows: 659 passed, 2 existing platform-only skips, no failures.
- Webview: 172 test files and 1,495 tests passed; app/test typechecks passed.
- Menu browser regressions: 20 tests passed across four viewports.
- Java: 1,288 passed and 5 skipped (1,293 total); checkstyleMain passed.
  A local Gradle init script selected freshly compiled test classes and
  bypassed instrumentTestCode because its asm-all download failed over TLS.
- CI YAML parsing and git diff --check passed. Generated reports, temporary
  runtimes and local configuration are excluded from this commit.
2026-09-05 12:36:07 +08:00
Gadfly 013b96ce6d ci: consolidate test workflows and upgrade setup-wsl to v7
Merge wsl-integration-tests.yml into a single tests.yml that runs
ai-bridge, webview, java (Linux), and WSL (Windows) jobs in parallel.
All jobs are independent of build.yml so test failures never block the
Build Plugin job.

Upgrade Vampire/setup-wsl from v3 to v7 to run on Node.js 24, resolving
the Node.js 20 deprecation warning ahead of the June 16, 2026 forced
migration.

All other actions already use their latest major versions (checkout@v6,
setup-java@v5, setup-node@v6, setup-gradle@v5).
2026-06-14 23:05:59 +08:00
Alfarish Fizikri 81890c0086 refactor: migrate to WslPathUtil for path handling and cleanup NodeDetector
- Replaced `NodeDetector` utilities with `WslPathUtil` for consistent WSL path handling.
- Simplified path transformations, validation, and directory resolution across the codebase.
- Refactored redundant utility methods and deprecated manually implemented logic.
- Added support for thread-safe initialization and improved test coverage for edge cases.
2026-06-06 20:26:10 +07:00
Gadfly d3bb84f64f chore: Update GitHub Actions and artifact handling
- Upgrade GitHub Actions versions and streamline artifact handling for direct zip uploads
2026-04-13 09:51:22 +08:00
Gadfly 2110e13d87 ci(build): build产物去除额外一层zip 2025-12-15 10:39:36 +08:00
zkpaiminmin e2df6b80a2 Revert "Merge pull request #28 from gadfly3173/feat/model-switch"
This reverts commit 1ff62218d3, reversing
changes made to 8151144d29.
2025-12-13 19:25:41 +08:00
Gadfly 968e6b203f feat: 在可能的情况下自动拉取远程模型列表 2025-12-13 16:31:46 +08:00
zkpaiminmin c74aaf4311 fix:修改打包问题&减少某些情况下的卡死问题 2025-12-13 11:36:51 +08:00
Gadfly 3d1a863f4b ci: build plugin
(cherry picked from commit ec9722f1aa2eefaccce4599e183b5a039be6ba77)
2025-12-12 23:25:29 +08:00