mirror of
https://github.com/NeuralNomadsAI/CodeNomad.git
synced 2026-08-21 14:23:26 +00:00
fix(opencode): harden the shared V2 runtime
Remove the duplicate Tauri native event transport and use the server EventSource stream consistently across web, Electron, and Tauri clients. Align the generated client and required opencode2 CLI on next-17353. Restrict workspace proxying to the required V2 API surface, enforce session and directory ownership, validate local file URIs, strip routing headers, and tighten provider, Yolo, worktree, and session event state handling. Protect the shared service lifecycle with private registration state, process-identity leases, safe ownership transfer, bounded shutdown, Windows executable resolution, and WSL namespace-aware PID verification. Unknown wrappers now fail closed rather than leaving an unowned service. Validated with server and UI typechecks, 433 UI tests, focused server lifecycle and proxy suites, 67 Rust tests, server and UI builds, and a real next-17353 service lifecycle smoke test.
This commit is contained in:
parent
07f29d08d5
commit
c66aac7967
70 changed files with 2817 additions and 2708 deletions
|
|
@ -15,7 +15,7 @@ description: |
|
|||
|
||||
## Native OpenCode V2 Baseline
|
||||
|
||||
- The only OpenCode client dependency is exact version `@opencode-ai/client@0.0.0-next-17288` in server and UI.
|
||||
- The only OpenCode client dependency is exact version `@opencode-ai/client@0.0.0-next-17353` in server and UI.
|
||||
- Do not use `@opencode-ai/sdk`, `@opencode-ai/sdk/v2/client`, or `createOpencodeClient()`.
|
||||
- There is no `packages/opencode-plugin/`. Do not restore plugin tools, plugin routes, or plugin packaging.
|
||||
- The server owns one shared OpenCode service through `OpenCodeSharedService` and upstream `Service.ensure`; workspaces are native OpenCode `Location`/directory scopes, not separate OpenCode processes.
|
||||
|
|
@ -56,7 +56,7 @@ description: |
|
|||
|
||||
| Avoid | Use |
|
||||
|---|---|
|
||||
| `@opencode-ai/sdk` | `@opencode-ai/client@0.0.0-next-17288` |
|
||||
| `@opencode-ai/sdk` | `@opencode-ai/client@0.0.0-next-17353` |
|
||||
| One `opencode serve` per workspace | One `Service.ensure` shared service |
|
||||
| Per-worktree clients/processes | Root proxy client plus native location/directory inputs |
|
||||
| Reintroducing `packages/opencode-plugin` | Native OpenCode Shell/instructions |
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ The server calls `Service.ensure` once through `packages/server/src/workspaces/o
|
|||
|
||||
| Owner | Responsibilities | Main paths |
|
||||
|---|---|---|
|
||||
| OpenCode V2 | Sessions, messages, permissions/questions, files, native Shell and instructions | `@opencode-ai/client@0.0.0-next-17288` |
|
||||
| OpenCode V2 | Sessions, messages, permissions/questions, files, native Shell and instructions | `@opencode-ai/client@0.0.0-next-17353` |
|
||||
| CodeNomad server | Shared service lifecycle, locations, proxy authorization, Git mutations, Yolo, auth, storage, speech, SSE multiplexing | `packages/server/src/` |
|
||||
| CodeNomad UI | Generated Promise clients, state reconciliation, interaction and rendering | `packages/ui/src/` |
|
||||
| Desktop hosts | Start CodeNomad and provide native OS integration | `packages/electron-app/`, `packages/tauri-app/` |
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
## Package
|
||||
|
||||
CodeNomad pins `@opencode-ai/client@0.0.0-next-17288` exactly in both `packages/server/package.json` and `packages/ui/package.json`.
|
||||
CodeNomad pins `@opencode-ai/client@0.0.0-next-17353` exactly in both `packages/server/package.json` and `packages/ui/package.json`.
|
||||
|
||||
- Promise client: `import { OpenCode } from "@opencode-ai/client"`
|
||||
- Service lifecycle: `import { Service } from "@opencode-ai/client/service"`
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
## Contract
|
||||
|
||||
- Version is pinned to `@opencode-ai/client@0.0.0-next-17288`; update server and UI together.
|
||||
- Version is pinned to `@opencode-ai/client@0.0.0-next-17353`; update server, UI, and the required `opencode2` CLI together.
|
||||
- The package root is the generated zero-Effect Promise client. Use installed declarations, not old SDK examples.
|
||||
- Native routes are `/api/*`; CodeNomad exposes them only through the authorized `/workspaces/:id/instance` proxy.
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue