feat(opencode): migrate CodeNomad to native V2 - #647
Conversation
Replace the V1 SDK, custom plugin, and per-workspace runtimes with the pinned OpenCode V2 client and one shared service. Model workspaces through native locations and route sessions, messages, events, files, VCS, permissions, questions, providers, commands, and MCP directly through V2 APIs. Remove the legacy plugin and background-process layers, use native Shell and PTY support, preserve server-side Git mutations where V2 lacks parity, and update the UI, packaging, CI, architecture documentation, and translations for the new model. Add focused coverage for shared-service ownership, Windows and WSL startup, proxy boundaries, worktree event routing, native event normalization, provider authentication, voice instructions, and location-scoped requests. Server and UI typechecks pass; remaining security review items and the real opencode2 smoke test are documented in MIGRATION_V2.md and will be completed before the draft PR is marked ready.
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.
Treat the persisted V1 default command 'opencode' as 'opencode2' so restored and newly selected workspaces use the required V2 service instead of waiting for the obsolete binary to time out. Keep the folder selection view mounted while startup restore is active and feed it the existing loading state, preventing the renderer from appearing blank while saved workspaces are recreated. Cover the legacy binary setting and restore loading gate with regression tests. Server/UI typechecks, targeted restore tests, the UI production build, and a real lifecycle smoke from an 'opencode' configuration pass.
Load sessions from each logical root and worktree using the native V2 directory filter, preserve locally known sessions when a combined response may be incomplete, and resolve locationless events through their session IDs. This restores worktree sessions, prompt activity, and deletion updates without reintroducing the removed transport. Require the bundled OpenCode prerelease for shared-service discovery and surface structured prompt errors. Move Electron and Tauri restore state and election files under the V2 namespace, copying V1 state once without mutating or deleting the legacy files. Cover multi-directory loading, locationless event routing, version-constrained discovery, and cross-host state isolation. Validated UI, server, Electron, and Tauri tests and built the Tauri release executable and NSIS installer.
Restore reliable V2 catalogs, agent identifiers, cursor pagination, prompts, variants, attachments, forms, native event reconciliation, Yolo persistence, and location-aware PTY controls. Prevent completed control records from appearing as streaming placeholders and keep live output refreshing during sustained token streams. Harden the shared service and workspace proxy with explicit OPENCODE_DB isolation, launch-signature validation, traversal protection, WSL namespace translation, ownership-scoped routes, bounded SSE backpressure, reconnect recovery, and safe process-proof transfer and shutdown semantics. Align provider, VCS, LSP, update, documentation, and CI behavior with the experimental next-17353 contract. Validation includes server/UI/Electron typechecks, 252 workflow UI tests, focused server suites, production UI/server builds, 68 Tauri tests, and a real V2 workspace/session/prompt smoke.
Merge upstream dev into the OpenCode V2 foundation while preserving native V2 session, provider, proxy, PTY, and explicit database behavior. Resolve desktop workspace-open and provider visibility conflicts across Electron and Tauri, bound local API requests, refresh standalone dependency locks, and keep grouped integration preferences keyed by native provider IDs. Validated with desktop typechecks, 267 UI tests, 308 server tests, 122 Electron tests, 74 Tauri tests, packaged builds, and an exact OpenCode 0.0.0-next-17353 Tauri smoke covering prompt, reload, agent fallback, and PTY lifecycle.
|
Updated validation after commits 9a53e2f, e996196, and 04cb287. The V2 runtime now uses @opencode-ai/client, protocol, and schema 0.0.0-next-17444, accepts the discovered current opencode2 CLI instead of enforcing an exact runtime version, and uses ~/.local/share/opencode2/opencode.db. Targeted manager/service tests, server/UI typechecks, packaged resources, and the Tauri 0.19.0 release build passed. Real desktop smoke reused three existing sessions from the copied V2 database and received V2_EXISTING_SESSION_ONE_OK, V2_EXISTING_SESSION_TWO_OK, and V2_EXISTING_SESSION_THREE_OK. Windows V1 and V2 now use distinct WebView2 profiles; with both applications running, the final V2 build opened D:\CodeNomad and D:\openchamber sequentially without dialogs, toasts, CDP exceptions, or server errors. Nine native shutdown tests also passed. The PR remains open until V2 is out of beta. |
Force the V2 service to use the opencode2 database under the current user's data directory so parallel V1 launches cannot redirect it through shared environment settings. Keep the bare opencode and opencode2 commands out of custom binary history while preserving real executable paths, and document the parallel desktop smoke procedure. Existing history entries are intentionally left untouched for manual cleanup. The server manager test and typecheck passed, and the Tauri package built successfully before the final UI-only simplification. No additional compilation was run per request.
Update the experimental OpenCode client, protocol, and schema dependencies to the latest reviewed next release while removing the exact CLI version gate from shared-service discovery. This lets CodeNomad use current opencode2 releases instead of timing out solely because the runtime advanced. Refresh migration, contributor, architecture, and skill guidance to require release-note, documentation, declaration, and proxy-parity review on each upgrade. The isolated opencode2 database behavior is documented consistently. Validated with server and UI typechecks, 36 passing targeted service/workspace tests, a release Tauri build, and a packaged desktop smoke. The smoke opened D:\CodeNomad, reused three existing sessions, and received three distinct exact prompt responses from opencode2 next-17444.
Give the V2 desktop runtime its own WebView2 user-data folder so it cannot reuse V1 service workers, browser caches, or locked profile state. Preserve an explicitly supplied WEBVIEW2_USER_DATA_FOLDER for debugging and custom launches. Defer installation of the Windows session-end subclass until the main thread can provide a native window handle, preventing startup from aborting during slower WebView creation. Validated with nine shutdown tests, a release build, simultaneous V1/V2 WebView processes using distinct data folders, and sequential CodeNomad/openchamber workspace launches without UI or runtime exceptions.
Keep established conversations mounted while V2 performs authoritative message refreshes. Background loads no longer insert the initial loader or clear timeline segments, preventing the measured prompt displacement and timeline flicker during native streaming. Restore saved sessions directly before the expensive all-worktree session scan, while preserving every referenced draft, attachment, scroll, expansion, idle, and generation record. Make workspace readiness follow newer reconnect loads without leaking waits after cancellation, and exclude synthetic views from native session hydration. Harden question interruption races by rebinding requests when authoritative tool parts arrive late or replace optimistic parts, and clear inline question state immediately after reply or rejection. Isolate PTY loading reads from Solid effects to prevent recursive reload storms. Add focused regressions to the PR workflow. Validated with 223 standard UI tests, 58 browser-condition tests, full TypeScript checks, 307 server tests, 74 Rust tests, 28 Windows spawn tests, a production Tauri build, and real cold-start state restoration.
Apply OpenCode V2 text and reasoning delta events directly to the normalized message store so assistant responses appear as they are generated instead of waiting for periodic HTTP snapshots. Deduplicate replayed events, preserve ordinal part ordering, reconcile stale or superseded snapshots, settle terminal messages, retry failed terminal refreshes, and clear streaming state when sessions or workspaces are removed. This keeps snapshot refreshes as authoritative recovery without erasing visible streamed content or recreating removed stores. Add focused streaming regression coverage and extend native event tests for immediate text, reasoning, periodic refresh behavior, replay handling, deletion cleanup, and terminal reconciliation. Validated with 223 standard UI tests, 64 browser/integration tests, full workspace typechecks, a production Tauri build, and a live CDP smoke covering progressive rendering and reload restoration.
Align the V2 delta reducer with the live OpenCode contract, where many unique events append to the same message, content type, and ordinal. Keep one provisional part per source part instead of treating ordinals as fragment sequence numbers. Render the first fragment immediately, then coalesce subsequent store and Markdown updates to one 16 ms window. Flush pending content before terminal reconciliation, preserve authoritative snapshot IDs and error states, cancel timers on session or workspace cleanup, and retain bounded replay protection. Validated against a live 1,485-event response that streamed 100 lines and 6,387 characters continuously to completion. Added repeated-ordinal, timer, snapshot, tool-boundary, cleanup, terminal, and error regressions; all 223 standard UI tests, 72 browser/integration tests, and workspace typechecks pass.
Keep follow ownership tied to explicit user intent so Virtua measurement corrections cannot silently escape an actively followed response. Large key jumps now land immediately, while explicit timeline and top navigation cancel submit pinning without confusing programmatic movement for user scrolling. Rebuild timeline segments from cached V2 structural signatures instead of part-count and same-length replacement heuristics. This handles provisional-to-authoritative part replacement, type and renderability changes, terminal status updates, locale changes, duplicate part IDs, and the V2 time.completed contract without rebuilding streamed text on every token. Add follow-state, timeline projection, and duplicate-part regression coverage to the PR workflow. Validated with 264 standard UI tests, 72 browser/integration tests, full UI and Electron typechecks, production UI build, and live Tauri WebView navigation/follow scenarios.
Preserve the last authoritative non-empty tab snapshot through native shutdown, make shutdown capture terminal, and restore the exact saved active tab. Seed scroll snapshots before session selection and wait for usable Virtua measurements so project, tab, session, and anchor position survive A/B restarts. Render native runtime forms inline only when their active-session tool target is resolved, retain the floating fallback for unresolved requests, share form schema visibility and URL validation with provider auth, and remove the unused session form-list proxy route and obsolete V1 request wrapper. Return the native V2 session.active map without a legacy data envelope, avoid full-history refreshes for deltas already applied locally, and bound timeline projection refreshes during streaming. Coverage includes UI restoration, form targeting, proxy contracts, native streaming, and CI test registration. Validated with root typecheck, 529 UI tests, 305 passing server tests with 3 skips, 74 Tauri tests, 122 Electron native tests, production A/B builds, a no-seed native handoff, and runtime verification of the active-session proxy shape.
Attempt configured WSL host-to-service translation before treating POSIX paths as already service-native. This preserves real Windows behavior while allowing Linux CI to exercise Windows workspace ownership with temporary git worktrees. Remove the environment-dependent assertion that a bare opencode2 command resolves to a packaged executable. Deterministic shim coverage remains in buildServiceLaunchSpec and the Windows PATH/PATHEXT tests. Validated with full typecheck, 27 spawn tests, 9 workspace manager tests, and the complete server suite with 304 passing tests and 3 skips.
Stop deleting OPENCODE_DB from legacy CodeNomad environment preferences during settings layout migration. Environment variables now migrate uniformly without a database-specific exception. The OpenCode V2 service destination remains unchanged and continues to use ~/.local/share/opencode2/opencode.db through the launch-time service environment override. Validated with the settings migration test, root typecheck, the complete server suite, and git diff --check.
When a native V2 form resolves to a tool call, render it as the sole interactive surface and suppress the legacy QuestionToolBlock for that call. Legacy questions remain available when no native form is pending, while unresolved and cross-session forms continue to use the existing floating fallback. Improve the native form hierarchy with token-based panel and field surfaces, explicit required and focus states, consistent checkbox controls, square action buttons, and responsive stacked actions on narrow screens. Validated with UI typecheck, 530 UI tests, a production desktop build, git diff checks, and desktop/mobile inspection in the deployed WebView.
Render native V2 string option lists with up to four answers as visible radio cards, including each option description, so question-style forms retain the scannable V1 interaction. Lists with five or more answers continue to use a compact select control. Apply the same selected-card treatment to multiselect answers, preserve custom-value entry, validate required inline strings, and keep grouped controls accessibly labelled. Option styling lives in a focused component stylesheet and uses existing square-corner design tokens. Validated with UI typecheck, 531 UI tests, a production desktop build, git diff checks, and visual inspection in the deployed WebView.
Electron and Tauri can each publish a legacy running marker immediately before publishing their shared cross-host participant. On a simultaneous Windows startup, both hosts could observe that transient gap and yield ownership, leaving no primary. When legacy detection initially blocks a primary candidate, wait for one bounded 50ms participant grace period and reconcile once before yielding. Apply the same protocol on both Node and Rust hosts; genuine legacy clients still block ownership after the grace period. Validated with root typecheck, 50 repeated cross-host election runs, 122 Electron native tests, 74 Tauri tests, and git diff checks.
A session can mount from startup discovery before native workspace restoration seeds its saved scroll snapshot. The message stream previously marked that no-snapshot pass complete and ignored the authoritative seed when it arrived, leaving Virtua at the top despite a valid anchor. Track no-snapshot completion as provisional and permit exactly one later restore when the reactive seed appears. Normal completed restores remain terminal, and session changes reset the provisional authority. Validated with UI typecheck, 48 targeted restoration tests, 532 complete UI tests, and git diff checks.
The Tauri client-state tests exercise process-global file locks and invoke PowerShell/CIM for process identity. Running them concurrently on the shared Windows runner can starve those probes, causing both cross-host election and bounded registration timing assertions to fail together despite passing independently. Run the 74-test Windows Tauri suite with one test thread. Linux coverage remains parallel, and product-side participant reconciliation remains covered by repeated cross-host tests. Validated with the exact serial Windows cargo command: 74 passed, 0 failed.
The Tauri macOS ARM prebuild combines DOM and Node timer declarations, so injected and global setTimeout implementations can return either a numeric browser handle or a Node Timeout. The previous inferred alias accepted only the Node variant and failed server compilation on that matrix leg. Represent the manager timer handle as the actual portable union and avoid Array.prototype.at in a server test because the server TypeScript target predates ES2022. Validated with the complete server build, 304 passing server tests with 3 platform skips, 11 targeted workspace tests, and git diff checks.
|
PR builds are available as GitHub Actions artifacts: https://github.com/NeuralNomadsAI/CodeNomad/actions/runs/32124483864 Artifacts expire in 7 days.
|
Real question-backed V2 forms set custom=true. The long-option branch therefore bypassed the intended select and rendered a text input with a datalist, so the tested 4/5 threshold did not hold for actual native requests. Render every long option list as a select regardless of custom-value support, and preserve free-form answers in a separate custom input. Short lists remain visible cards. Validated against a live four-option V2 form, targeted form tests, the UI typecheck, 532 UI tests, and git diff checks.
OpenCode SDK location responses expose workspaceID, while generated request inputs require workspace. Passing a response LocationRef directly was structurally accepted by TypeScript but caused the generated client to omit the workspace selector from catalog requests. Centralize the output-to-request conversion and apply it to agent, provider, model, default-model, and command catalog calls. Internal session state continues using the SDK response shape. Validated with 21 targeted request-authority tests, the UI typecheck, 533 UI tests, and git diff checks.
Volatile V2 events previously refreshed every catalog, metadata, and filesystem domain. Even an agent or command update therefore caused unrelated API requests and cache invalidation, with a trailing full rerun when events overlapped. Map each native event to the state domains it can affect and merge pending domains in one coordinator. Reconnects retain a complete refresh, while agent, command, integration, metadata, filesystem, and VCS events now update only their relevant stores. Validated with 21 targeted invalidation and request-authority tests, the UI typecheck, 535 UI tests, and git diff checks.
The instance bridge duplicated every OpenCode event payload into a synthetic properties field because server-side auto-accept still consumed the V1-style envelope. This expanded the SSE contract and left UI deletion handling with legacy fallbacks. Move auto-accept and session deletion to native event.data, publish OpenCode events unchanged, type the shared stream as OpenCodeEvent, and guard PTY consumers before narrowing their event union. Internal CodeNomad worktree events remain separate. Validated with server and UI typechecks, 51 targeted server tests, 21 targeted UI tests, 304 passing server tests with 3 platform skips, 535 UI tests, and git diff checks.
Release admitted worktree mutations only when reply-from receives the upstream response or error, so downstream disconnects cannot let deletion overtake an OpenCode mutation. Deletion waits fail closed after a bounded timeout. Canonicalize workspace directories through the resolved Git worktree and use that identity while inventorying sessions, preventing dot, duplicate-separator, symlink, and junction aliases from bypassing the fence. Validated with 61 manager, proxy, route, and evacuation tests including delayed upstream, alias, rollback, and timeout cases, plus the server TypeScript check.
Reopen the serialized CLI lifecycle and restart the embedded server when client-state ownership release fails after shutdown. Restored windows remain functional while the next quit retries the dirty state drain. Validated with 73 client-state, lifecycle, and process-stop tests plus the Electron TypeScript check.
Keep restart serialized with shutdown while limiting the CLI stop phase to two seconds. A slow restart now fails without respawning and leaves the Windows session-end path time to flush renderer and native state. Validated with cargo fmt and all 121 Tauri tests on Windows.
Advance the retained output boundary past split UTF-16 surrogates and partial ANSI CSI sequences. Truncated shell output no longer begins with malformed Unicode or a literal escape fragment. Validated with four shell-store tests and the UI TypeScript check.
|
PR builds are available as GitHub Actions artifacts: https://github.com/NeuralNomadsAI/CodeNomad/actions/runs/32501000153 Artifacts expire in 7 days.
|
Track admitted proxy mutations through upstream response completion and key deletion fencing by the canonical physical worktree root. Nested paths, duplicate logical workspaces, symlink and junction aliases, WSL paths, and stale missing descendants now converge on the same identity while unresolved reparse points fail closed. Evacuate every session belonging to that identity before removal, refresh stale worktree caches, and bound mutation draining so deletion cannot hang indefinitely or overtake active upstream work. Document OpenCode's confirmed one-process architecture. Validated with all 299 server tests (297 passed, 2 skipped), focused Windows junction and WSL probes, server typecheck, and diff check.
Keep the four MiB display cap without retaining split UTF-16 surrogates or partial ANSI CSI, OSC, DCS, APC, and PM control strings. Handle ESC-backslash terminators and CAN/SUB cancellation so visible output is preserved. Validated with four shell-store tests, including Unicode and ANSI boundary probes, plus the UI typecheck.
|
PR builds are available as GitHub Actions artifacts: https://github.com/NeuralNomadsAI/CodeNomad/actions/runs/32505585098 Artifacts expire in 7 days.
|
Revalidate cached shared-service connections periodically and invalidate them after proxy authentication or network failures so a restarted daemon is rediscovered without relaunching one process per workspace. Validate instance routes before daemon discovery and keep the shared authorization lifecycle synchronized with the proxy. Add single-flight worktree discovery with a longer bounded cache and invalidate it after worktree mutations. Extend coverage for connection revalidation, explicit invalidation, and proxy 401 handling. Validation: server typecheck; full server test suite 298 passed, 2 skipped; targeted proxy and shared-service tests 40 passed. Real CodeNomad load reached 10 active parents and 71 active children before the shared OpenCode daemon restarted, so the 10x80 overlap remains an upstream load-limit finding rather than a passing result.
Keyed Show on session and message objects threw during batch updates, which cancelled the switch and left the transcript empty. Gate those branches on ids or booleans, unmount hidden session views, and keep assistant model metadata optional. Selecting a child with no resolved root now falls back to the session itself so the list click still activates.
A successful reply or cancel is now local authority. Sync and SSE cannot requeue that prompt unless the server still lists it. Failed mutations resync instead of leaving the queue stuck. Poll liveness every 30s while a session is working or a prompt is open, and include session plus form locations in the pending-request scan.
Home and Fin now fetch oldest or latest and swap the visible page. Older and newer pages do the same. Live events only land on the latest window so history stays still. A restored history cursor that returns no messages no longer marks the session loaded. Open retries latest, which was why transcripts went black after refresh. Stale Solid reads during that load are ignored. Tests cover window planning, replace-on-failure, and the empty-cursor retry.
The combobox used to seed and auto-select from leftover input. Search is now a plain field, so opening the picker no longer changes the current model. The agent shortcut opens the list instead of submitting Enter. Provider auth calls go through the active catalog location.
Read xAI usage from the provider API and keep OAuth quota refresh from inventing a selected model. The usage panel maps credits_balance onto the existing credits row.
|
PR builds are available as GitHub Actions artifacts: https://github.com/NeuralNomadsAI/CodeNomad/actions/runs/32651399173 Artifacts expire in 7 days.
|
Embed Google OAuth client secrets so Gemini and Antigravity refresh without extra env vars and merge retrieveUserQuota buckets with fetchAvailableModels. The window now correctly picks daily vs 5h, matching openchamber's vscode quotaProviders. Add the providers openchamber already serves but CodeNomad missed: command-code (whoami + billing/credits), crof, deepseek, neuralwatt, github-copilot-addon (premium-only) and claude via the same OAuth plugin openchamber uses (api.anthropic.com/api/oauth/usage with retry-after cooldown 5m-1h). All read from the OpenCode auth file and stay behind the same provider registry and cache. Update the provider registry test to cover the new ids and flip the claude assertion from NotConfigured to the plugin.
|
PR builds are available as GitHub Actions artifacts: https://github.com/NeuralNomadsAI/CodeNomad/actions/runs/32658357556 Artifacts expire in 7 days.
|
Replace the server and UI client pins with the npm beta dist-tag and regenerate both supported lockfiles from the current published channel. Update migration and architecture documentation so no specific beta build or obsolete next-channel wording is treated as CodeNomad's target. Resolve the CLI beta dist-tag from the npm registry before calculating update availability, while invoking package managers with @opencode-ai/cli@beta. Verify the installed CLI against the observed concrete version and accept a newer build when the channel advances during installation. Adapt UI event types to the current generated SessionStatusUpdated declaration. Cover channel-based commands, registry failures, stale installs, concurrent updates, and mid-update channel advancement; validate server/UI/Electron typechecks, server and UI suites, and the UI production build.
|
PR builds are available as GitHub Actions artifacts: https://github.com/NeuralNomadsAI/CodeNomad/actions/runs/32663673993 Artifacts expire in 7 days.
|
Prevent duplicate workspace ownership, bound concurrent creation and cleanup, and preserve canonical Windows and WSL identity while using the shared OpenCode V2 service. Keep session history directory-scoped for global projects, serialize native event projection, restore prompts and pending requests safely, expose interrupted generations, and remove unsupported direct Google credential handling. Make Electron and Tauri server resources reproducible from the root lockfile, retain the pinned beta SDK contract, and update CI and architecture documentation for the shared-service model. Validated with full UI, server, Electron, Rust, packaging, typecheck, Tauri build, and live prompt, permission, Form, compaction, and interruption smoke coverage.
|
PR builds are available as GitHub Actions artifacts: https://github.com/NeuralNomadsAI/CodeNomad/actions/runs/32686523959 Artifacts expire in 7 days.
|
Stop projecting the complete resident message window for every session.compaction.delta event. The SDK reducer still receives every chunk, while the visible compaction start and terminal ended or failed boundaries continue to refresh immediately. This removes repeated normalization, hydration, timeline invalidation, and message-block reconstruction that could monopolize the renderer and prevent prompt updates, tab changes, and session navigation during compaction. Add integration coverage proving intermediate deltas remain out of the UI store, are reduced exactly once and in order, and become visible at the next projection before the final terminal summary replaces them. Validated with UI typecheck, the 124-test browser matrix, focused OpenCode projection tests, UI and Tauri production builds, and git diff checks.
|
PR builds are available as GitHub Actions artifacts: https://github.com/NeuralNomadsAI/CodeNomad/actions/runs/32732568005 Artifacts expire in 7 days.
|
Remove the nested search-input chrome from the inline searchable model control. The outer selector already owns the border and padding, so the model field now matches adjacent sidebar controls without changing keyboard search behavior. Validated with the UI TypeScript check, production UI build, and git diff checks.
Keep the inline searchable model input transparent so the outer sidebar selector remains the single visual surface without restoring the nested padding or border. Validated with the UI TypeScript check and git diff checks.
|
PR builds are available as GitHub Actions artifacts: https://github.com/NeuralNomadsAI/CodeNomad/actions/runs/32736958022 Artifacts expire in 7 days.
|
Create a fresh logical workspace for every same-folder launch while preserving shared native location ownership, independent restore cancellation, bounded creation, and final-owner eviction. Treat aborted background session inventory as cancellation instead of a fatal sidebar error. Reset Virtua's index measurements when a 200-message resident page is replaced so bottom pinning targets the actual transcript end without remounting the follow controller. Refresh the V2 migration and comparison notes for the current session, worktree, provider quota, Shell, and packaging behavior. Coverage includes full server and focused UI matrices, server/UI typechecks, the UI production build, and regression tests for each failure.
|
PR builds are available as GitHub Actions artifacts: https://github.com/NeuralNomadsAI/CodeNomad/actions/runs/32741747776 Artifacts expire in 7 days.
|
OpenCode V2 Migration and Desktop Restructuring
Summary
This branch replaces CodeNomad's OpenCode V1 SDK, custom plugin, and per-workspace runtime architecture with the experimental native OpenCode V2 client and one shared OpenCode service. It intentionally ships no V1 runtime fallback.
The scope includes native location ownership, Forms and Shell resources, project-wide cursor pagination, bounded resident message windows, streaming reconciliation, duplicate-folder instances, multi-window Electron/Tauri behavior, content-addressed restore, worktree mutation fencing, and reproducible desktop packaging.
Full architecture and review notes:
MIGRATION_V2.mdLegacy Architecture Removed
packages/opencode-pluginpackage, packaging/setup hooks, desktop resources, environment plumbing, plugin POST/SSE routes, event bridge, and voice synchronization channel..codenomad/worktreeMap.jsonand the UI-side OpenCode workspace/worktree-client matching layer.shell.*listing, bounded output, and removal replace them.EventSource.@opencode-ai/sdkfrom server/UI and remove the V1 compatibility path.Native V2 Contract
@opencode-ai/client@betachannel from the integrity-pinned root lockfile while keeping the generated client contract explicit in both server and UI.opencode2CLI beta channel independently and accept compatible runtime versions after authenticated health, location, and API validation.SessionInfo.locationas the authority for workspaces, sessions, files, events, Git worktrees, Shells, and PTYs.@opencode-ai/client/solidcreateDatafor live reduction while retaining REST history and optimistic prompt admission.session.shell; expose backgroundshell.*resources separately from interactivepty.*terminals.Shared Service and Workspace Model
Sessions, Events, and Performance
globalprojects scoped to the selected workspace directory.Forms, Providers, Worktrees, and Security
Desktop, Restore, and Packaging
--new-windowis supplied.Notes