feat(v2): manage session families across worktrees - #649
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.
Use the shared OpenCode V2 service to inventory complete project session families and move them through the native session.move API. Serialize project operations, verify authoritative locations, and roll back only transaction-owned moves when failures occur. Make worktree deletion transactional by evacuating inactive session families before Git removal. Strict NUL-delimited inventory checks, HEAD revalidation, physical-root workspace reservations, nested workspace projection, and cache invalidation prevent stale or in-use worktrees from being removed. Cover cursor pagination, family resolution, rollback, deletion evacuation, nested logical roots, exact Git slug resolution, and workspace creation races. Validated with server typecheck and the full 237-test server suite.
Treat SessionInfo.location as the authoritative worktree assignment, load every project-scoped cursor page, and project complete session families for search, filtering, and activity/name/worktree sorting. Family moves now run through the server transaction and refresh from OpenCode instead of mutating local paths optimistically. Show localized root and linked-worktree badges, preserve complete ancestry during filters, refresh worktrees and sessions after deletion, and apply the complete authoritative session.moved payload. Expose the desktop file-manager action only for local paths with keyboard support. Add coverage for project query construction, path normalization, family projection, native move events, request authority, serialized family moves, and deletion refresh; register the new runnable tests in CI. Validated with UI typecheck, 35 affected CI-mode tests, and production builds.
Add desktop-only Electron and Tauri commands for revealing local worktree directories. Reuse the existing renderer token, origin, frame, and generation authority instead of introducing a separate bridge. Reject relative, control, network, device, and non-directory targets before opening. Canonicalize inputs, require exact NUL-delimited Git inventory membership, constrain logical subdirectories beneath registered worktrees, and repeat authorization and inventory checks to narrow races. Keep Electron and Tauri behavior aligned with targeted parser, validation, authorization, containment, and revalidation tests. Validated with Electron typecheck and 124/124 native tests plus cargo check and 87/87 Rust tests.
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.
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.
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.
|
PR builds are available as GitHub Actions artifacts: https://github.com/NeuralNomadsAI/CodeNomad/actions/runs/33829149790 Artifacts expire in 7 days.
|
|
PR builds are available as GitHub Actions artifacts: https://github.com/NeuralNomadsAI/CodeNomad/actions/runs/33867196957 Artifacts expire in 7 days.
|
Bring the merged binary compatibility, startup shell, Tauri window capture, and Linux automation registry fixes into this PR without changing its feature scope. Resolve the automation test overlap by retaining per-test registry isolation and the upstream temporary-root assertion. Windows and Linux registry variables are restored, and WSL discovery is disabled only inside isolated test fixtures so tests cannot touch the real desktop registry. Validation: all eight automation plugin tests pass; server and UI TypeScript checks pass; git diff --check passes. This conflict-resolution commit is not a final native-release gatekeeper approval.
|
PR builds are available as GitHub Actions artifacts: https://github.com/NeuralNomadsAI/CodeNomad/actions/runs/34060295665 Artifacts expire in 7 days.
|
Integrate dev at 81d536f, including the empty-history, transcript stability, shell startup, localization, and server diagnostics changes, while keeping the audited V2 migration scope and the @opencode-ai/client beta-18999 lock resolution. Resolve the session conflicts by retaining cursor-only pagination and complete native metadata, recognizing the source workspace when duplicate views share a moved location, and reconciling genuine cross-location moves from native inventory instead of speculative projection transfers. Ignore controlled worktree selector echoes only when the family root already matches the target service directory, while preserving the transactional server-side family move, fencing, verification, refresh, and rollback path. Keep both dev's fork, undo, empty-page, and restored-session regressions and PR NeuralNomadsAI#649's exhaustive session authority coverage. Validation: UI and Electron typechecks; 343 runnable UI tests; 185 restore integration tests; 430 server tests with 2 platform skips; 198 Electron native tests with 4 platform skips; 160 Tauri tests; 24 Chromium tests; desktop resource invariants; UI production build; and git diff checks.
Merge dev@81d536f6 into PR NeuralNomadsAI#648 while preserving the 64 MiB transcript LRU, 200-message replaceable windows, committed pagination results, and multi-consumer cancellation. Combine the empty older-page handling and staged native undo from the current V2 baseline with the bounded paging flow. Track the window identity installed by a successful load so the request keeps authority long enough to return its committed result, while stale loads remain fenced. Keep the newer rendering, shell startup, diagnostics, Turkish localization, and browser regression coverage from dev without taking commits from PR NeuralNomadsAI#649. The final PR file set remains unchanged at 78 paths. Validated with UI, Electron, and server typechecks; 117 targeted browser-conditioned store/action tests; the full 412-test server suite (410 pass, 2 platform skips); 189 Electron native tests; 24 Chromium rendering tests; 160 Tauri Windows tests; desktop packaging invariants; and OpenCode compatibility tests. Audited published @opencode-ai/client beta-19271 against beta-19157 without finding a required dependency update for this PR.
|
PR builds are available as GitHub Actions artifacts: https://github.com/NeuralNomadsAI/CodeNomad/actions/runs/34413448312 Artifacts expire in 7 days.
|
Merge the latest dev baseline into the worktree-session changes without rewriting the branch history. Resolve the session API overlap by retaining complete project and migrated-directory inventories while preserving cursor-only native continuations. Update OpenCode worktree refreshes to the current location-based client contract. This keeps create/delete reconciliation compatible with the refreshed beta client and avoids forwarding the removed projectID input. Validated with UI and server typechecks, 125 changed server tests, 103 changed UI tests, and the focused worktree route and session inventory suites.
|
PR builds are available as GitHub Actions artifacts: https://github.com/NeuralNomadsAI/CodeNomad/actions/runs/34486376356 Artifacts expire in 7 days.
|
Integrate dev aa51cbb and preserve NeuralNomadsAI#695's guarded proxy, legacy location identity and exact destination validation. Keep project-wide inventory and family transactions, worktree mutation/deletion reservations and NeuralNomadsAI#687's union of migrated global descendants. Do not restore permissive opaque cursor forwarding or obsolete workspace query parameters at the proxy boundary. Route forward moves and rollbacks through moveSessionToLocation, carry full legacy identities through the internal location context, and use the modern project-scoped worktree refresh contract with narrow legacy translation. Reject same-project destination redirection before mutations. Adapt shell/PTY blocker checks, retain both workspace-manager suites and fix the RPC event fixture's native owner identity and timeout cleanup. Add a synthetic native family fixture to the existing private-daemon location test: verify complete-family moves, refresh, evacuation failure and exact rollback against official 2.0.3 and 2.0.5, without touching user storage or the shared daemon. Server suite: 523 passed/2 skipped, followed by the final 20 family regressions including the added destination refusal. UI stores: 449 passed. Electron native: 194 passed/4 skipped on rerun (initial Windows process-identity timing assertion failed). Server/UI/Electron typechecks pass.
Refresh against dev aa51cbbPublished head: merge(dev): adapt worktree families to shared V2 location compatibility Integrate dev aa51cbb and preserve #695's guarded proxy, legacy location Route forward moves and rollbacks through moveSessionToLocation, carry full Add a synthetic native family fixture to the existing private-daemon location Validation above is local execution evidence. CI on this published head and the explicitly untested interactive/platform scenarios remain separate. No PR was merged. Refactor signals: |
|
PR builds are available as GitHub Actions artifacts: https://github.com/NeuralNomadsAI/CodeNomad/actions/runs/35158888620 Artifacts expire in 7 days.
|
Qualify OpenCode's generic recommendation to move a session into its primary worktree with a native codenomad.session-placement instruction. Creating or using a checkout is not an implicit request to reorganize a CodeNomad conversation; explicit reattachment remains supported and native location remains authoritative. Extract named session instruction synchronization into a focused module shared by prompt, slash-command and session-shell admission. Reapply placement context for new and existing sessions before submission, preserve unrelated entries and voice-mode synchronization, and propagate setup failures through the existing action failure path. Do not embed an initial directory or cache successful writes only in the browser. Document native project, location, tool workdir and CodeNomad workspace semantics, including location-scoped service implications and the boundary between model guidance and runtime enforcement. Record the observed Windows case-sensitive native session-list discrepancy separately from the instruction fix. Validated 139 focused UI tests covering instruction ordering and failures, optimistic sends, queued payloads, request authority, native moves, restored sessions and worktree families. UI typecheck, production UI build and git diff --check pass.
User-chosen conversation placement — cad0ae3Included in this PR because native worktree movement and CodeNomad conversation organization need one explicit user-intent contract.
The upstream move recommendation is injected by the core runtime ( Analysis and source references: Validation: 139 focused UI tests passed, including delayed setup failures, voice-mode coexistence, existing-session repair, request authority, native move reconciliation, restoration and worktree families. UI typecheck, production UI build and |
|
PR builds are available as GitHub Actions artifacts: https://github.com/NeuralNomadsAI/CodeNomad/actions/runs/35206704446 Artifacts expire in 7 days.
|
… V2 (#697) ## Summary Follow-up to #695: restore connections to OpenCode 2.0.7, whose authenticated service metadata endpoint is `/api/info`. Built directly on current `dev` (`aa51cbb9`). - Probe `/api/status`, then `/api/health`, then `/api/info`, advancing **only on HTTP 404**. - Preserve credentials, the absolute deadline, bounded/validated responses, and reject redirects. - Record the discovered route and adapt the pinned client's `GET server.status()` call to `/api/info`. - Preserve OpenAPI contract negotiation for unknown releases; no 2.0.7 special case or new minimum version. **OpenCode 2.0.0 remains supported by the existing health path.** Its real isolated daemon passes the connection and native location regression fixture with this change. This PR contains only the service discovery/transport fix and its tests/docs. Worktree catalogue performance/cache changes remain in #649 and are not dependencies of this fix. ## Evidence Comparing all 132 generated-client HTTP method/path pairs against the installed 2.0.7 OpenAPI schema found 131 unchanged pairs and the status/info difference fixed here. Experimental routes were already covered by #695; no additional experimental-route migration is needed. ## Validation - [x] 44 focused host/WSL lifecycle, shared-service, transport and negotiation tests - [x] Server TypeScript check - [x] Real isolated OpenCode **2.0.0**: production health discovery, canonical `client.server.status()`, legacy location identity, Forms, Shell/PTY scoping, SSE, foreign cursor/session refusal and exact move rollback - [x] Real isolated OpenCode **2.0.7**: production info discovery, canonical `client.server.status()`, modern worktree location and obsolete-selector rejection - [x] Staged whitespace check Native fixtures use dedicated temporary databases/configuration and do not target the shared user daemon. These checks establish discovery and targeted contract behavior, not an exhaustive certification of all runtime features. Signed commit: `16d10fcd`.
Integrate the independently reviewed server.info discovery and canonical status transport fixes from dev so PR649 builds on their signed regression coverage. Keep worktree catalogue, session projection and selector changes scoped to this branch.
Use OpenCode worktree discovery, creation and removal while scoping membership to the physical local Git common directory. Keep stable opaque identifiers separate from branch labels, create under the main checkout's .codenomad/worktrees from the selected revision, and attach named branches without overriding Git's checked-out guards. Project complete native session families into the local repository scope and refresh placement after native agent moves. Keep selector actions accessible, remove redundant chrome, hide root badges, and explain create-and-use and agent placement semantics across all locales. Preserve family fences, authoritative verification, rollback, metadata and cursor-only continuation. Recover large-repository loading with bounded Git annotation concurrency, shared in-flight catalogues and snapshot-aware negative ownership caching. Prevent stale native VCS rows or superseded status requests from replacing the selected checkout's local Git inventory. Validate native policy and family transactions on isolated official 2.0.0 and 2.0.7 runtimes, targeted server/UI suites, real-component selector browser tests, typechecks and production builds. Exercise installed Windows Tauri creation, badges, Git checkout targeting and actual agent session_move on disposable sessions in the real repository; record restart evidence and the observed refresh-wait limitation.
|
Follow-up in 3921ba0: the worktree filter now matches the displayed conversation's own native directory, consistently with its badge. Descendant locations/activity do not override the parent's placement; text-search ancestry and complete families under matching roots are preserved. Added mixed-location/activity regressions (14 session-tree tests pass), with UI typecheck/build passing. The reported installed-app case was checked: hidden under the root-folder filter, visible under its own worktree and All worktrees, without closing the conversation. |
|
PR builds are available as GitHub Actions artifacts: https://github.com/NeuralNomadsAI/CodeNomad/actions/runs/35273181305 Artifacts expire in 7 days.
|
1 similar comment
|
PR builds are available as GitHub Actions artifacts: https://github.com/NeuralNomadsAI/CodeNomad/actions/runs/35273181305 Artifacts expire in 7 days.
|
|
Follow-up in 56a1c4c: search/filter mode now uses flat, independent session results, superseding the root-only worktree filter in 3921ba0. A localized Show subsessions switch (off by default) lets matching children appear without their parents. Text/worktree filters, activity/name/worktree sorting, badges and bulk selection use each result itself. Closing search restores normal hierarchy. Native search results no longer require ancestor hydration to render. Validation: UI typecheck/build; 14 session-tree and 65 request-authority tests; real-component browser coverage for the toggle, sorts, combined filters, independent badges/selection, orphan results and hierarchy restoration. Rebuilt UI loaded in the installed Windows Tauri renderer: an existing child in D:\CodeNomad appeared alone under Workspace while its parent remained in pr649-final; toggling it off or filtering the parent checkout hid it, and closing search restored the hierarchy without changing session locations. A first 30-second search wait expired; the repeat completed within the extended 90-second bound. Search still traverses the local worktree catalogue, so this does not establish a latency guarantee. No merge performed. |
## Summary Follow-up to merged #649. Search/filter mode now displays independent, flat session results. A localized **Show subsessions** switch (off by default) includes matching children without requiring their parents. Each result uses its own native worktree, activity timestamp, name, badge and selection identity. Closing search restores normal hierarchy. Native search results no longer hydrate ancestors just to render a child. Request-authority/deletion fences remain covered, and unqueried flat filters exhaust normal pagination. This supersedes the temporary root-only filter adjustment published on the former PR branch after #649 merged. ## Validation - UI typecheck and production build passed. - 14 session-tree and 65 request-authority cases passed. - Real Solid/browser regression passed: toggle, activity/name/worktree sorts, combined text/directory filters, child badges, bulk selection, navigation, missing parents, and hierarchy restoration. - Rebuilt UI loaded in installed Windows Tauri: an existing child in D:\CodeNomad appeared alone under Workspace while its parent remained in pr649-final. Disabling subsessions or selecting the parent checkout hid it; closing search restored hierarchy and kept the current conversation active. No native locations changed. - One 30-second desktop search wait expired; the repeat completed within the extended 90-second bound. Search still traverses the local worktree catalogue; no latency guarantee is claimed. - Follow-up commit tree exactly matches the tested tree on the original worktree branch; it is based directly on the #649 squash merge in dev. ## Maintenance note Existing touched oversized files: session-list.tsx (~1022 lines), session-api.ts (~1732), session-state.ts (~1307), session-request-authority.test.ts (~2016). No size-only refactor included.
Summary
Manage complete session families across the opened local repository's native OpenCode worktrees. This supersedes #642 with the V2 implementation and addresses #319.
worktree.refresh/list/create/remove; CodeNomad supplies the default directory, named-branch policy, local repository scope and verified family transactions.SessionInfo.location.directory. Durable metadata is preserved, but oldworktreeSlugmetadata does not override native placement..codenomad/worktreesparent. Uncommitted edits stay in the source checkout. External registered worktrees remain discoverable.Current base and native contract
This branch includes merged
dev@e47e01c6, including #697's separately reviewed discovery/status compatibility fix. UI/server pin@opencode/client@2.0.4; the independently managed daemon has no exact-version startup gate.Deletion safety
Recovery and Git-panel corrections
Validation on the real repository exposed serial enumeration of 162 worktrees and concurrent ownership misses launching overlapping inventories. Git annotations now run with bounded concurrency, pending catalogue reads are shared, and negative ownership results are snapshot-cached. A regression exercises 40 concurrent misses.
The Git panel now treats its complete local staged/unstaged inventory as authoritative instead of resurrecting native-only stale rows. It also rechecks the selected worktree/request after waiting for native VCS status.
Validation
Latest integration validation:
session_movereflected in both badges.pr649-final.git diff --check.An immediate post-restart desktop run exceeded a 30-second refresh-button wait; the subsequent completed run passed. These checks validate the workflows, not a startup latency bound or exhaustive compatibility of every OpenCode payload.
Earlier branch validation also covered Electron/Tauri native actions, packaging and desktop parity; those results remain in the PR's historical validation comments. Detailed contract and latest evidence:
dev-docs/WORKTREE_SESSION_PLACEMENT.md.Residual limit
OpenCode and Git expose no shared snapshot/CAS transaction. CodeNomad narrows races with reservations, locks, fences and repeated authoritative checks; unrelated processes can still mutate state outside those controls.