- Browse keys its selected server by validated profile policy. Settings → Servers → Open selects the server in Browse in the active empty tab, or the first existing empty tab in strip order, creating one if needed. Browse applies the intent once host capabilities permit it. Reselecting the same policy in the active empty tab keeps its opening; origin, TLS and SSH changes dispose the browser and its work. Remote admission requires the enabled host preference (
multiBackend, on by default), compatible metadata, the registered client, its live attachment and its bound relay proof. - Native Preferences sends the immutable selection to its local opener. The host validates the Preferences sender and section; the target renderer rechecks the saved policy and flag. Open completes on that renderer's matching acknowledgement; a missing opener fails the request. Tauri allows at most 32 pending handoffs with a five-second timeout.
- Restoration creates fresh records from saved descriptors. A browser tab can reclaim a surviving exact ID and folder only when
document.wasDiscarded === trueand its snapshot is unmarked. Saved occurrences order tabs and scope their drafts and views. Remote restore and Retry require successful backend admission and the same saved installation identity; unavailable or different installations retain waiting tabs and drafts. - The remote stream's first inventory refresh follows admission. A stream-triggered refresh captures the opening's connection generation before waiting for admission and checks it before requesting or publishing inventory. If a subsequent inventory omits a remote record during startup hydration, its placeholder takes the existing tab's position and selection. Retry uses the retained snapshot, which combines live state with saved state still awaiting hydration.
openRemoteProjectcapturesWorkspaceCreationOwnershipfromcreateInstance.onCreationbefore dispatch. Each untransferred exit joins one bounded discard flight against its exact backend/client/attachment/request. The commit gate fences obsolete receipts; later explicit opening preserves replacement occurrences. After guarded selection transfers ownership to the tab, the release ACK keeps the original API and request identity.- A suspended occurrence retains its ordered, selectable placeholder and complete snapshot. Retry shares the backend inventory flight and revalidates metadata and attachment; Connect admits credentials or a fresh pairing link. Failed, skipped or superseded reads leave the previous snapshot. Uncertain creations stay parked for original-request reconciliation; closure revokes pending creation and hands saved drafts to the occurrence-scoped vault. Temporary-folder discard authority follows the current backend event attachment; record-only DELETEs explicitly retain the folder.
- Electron renderer reload carries the selected tab identity in per-window session storage until the next document mounts. It selects only an exact occurrence already in the native snapshot, including a waiting remote tab; the native snapshot owns the tabs and drafts.
- Profile removal confirms the counts of live and waiting tabs to close and recent projects to remove. It uses the shared tab-close path in the owning window, with the temporary-project choice and local-only detachment for ordinary tabs. The host forgets the connection and prunes that profile's recents with the saved profile write. Retargeting keeps its separate usage check. Names may change in place.
-
The Open badge joins a matching tab in this window. Otherwise the Open elsewhere dot reflects a published, ready record of the same folder and backend outside this window, using the existing backend inventory. Both lists use the same project identity; selecting a row opens an independent occurrence.
-
An empty tab presents Browse then Recent tabs in independently scrolling panels. Side-by-side panels have equal heights; stacked panels size to their own content within the space available. Temporary tab and Clone repository sit above the panels and target this computer. Browse counts places: this computer, saved servers and SideCars. New SideCar opens its registration in Settings. The server add field stays at the foot of Browse. Choosing a server opens its address field, folder list and connection controls in place; folder rows descend, Parent goes up, and Enter or the path arrow opens the folder. Recent tabs shows that server's shortcuts until Back restores the mixed list, with the count hidden while the server is unavailable. Browsing starts at the last known project path; a rejected directory offers Server root. Settings → Servers owns profile edits/removal and SSH.
-
The selected server's shortcuts combine its own recents with the host's successful opens for the exact profile policy, deduplicated by normalized folder. Successful opens are visible in the renderer while the history write settles. A row opening keeps its captured request across display refreshes for the same profile policy.
-
recent-projects.tsmerges local recents with metadata from successful explicit remote opens. Hoststate.ui.remoteProjectHistoryuses exact saved profile policy (ID, address, TLS verification and SSH target) plus the normalized workspace folder. The host folds list-shaped history at load and compacts after writes, retaining the newest 20 across profiles plus the latest for each active saved profile outside those 20. A successful open records the canonical folder and removes the requested alias; a retained row keeps its greatest access timestamp regardless of write order. Open and rename patch individual fields with owner Merge Patch. Remove deletes the keyed entry; stale name-only edits cannot recreate it, and reopening records it again. Retired targets disappear; offline targets retain their metadata. The mixed list also includes recently opened running SideCars. Choosing a row creates an occurrence. The separate Open action selects a matching tab, including a restore placeholder, and consumes the originating empty tab. In-flight Browse and recent operations are cancelled when their surface closes or their profile policy is retired.
-
Host Git probes report
git_requiredonly for an absent executable (ENOENT). Timeouts, killed processes, unsuccessful exits and invalid version output yieldgit_probe_unavailable(503, retryable); the availability advisory propagates uncertainty to its best-effort caller rather than publishing installation guidance. The probe retains its five-second deadline and rechecks on demand. -
Local previews share saved history, URL and viewport by session. The native host assigns each live preview to one window and tab. Remote preview resources and saved data remain occurrence-scoped; never import remote URLs into the local session browser cache.
-
Closing a project tab detaches it immediately and requests deletion of its logical workspace record with keepalive, reporting failures. Native close and quit block renderer input while saving eligible client state and give record release a separate, bounded wait. Quit sends releases while the local backend can still relay them. If quit is cancelled, the renderer restores the prepared tab order and selection, resumes input and capture, and reuses an exact record only when inventory confirms it after its DELETE settles. On non-persisted
pagehide, the document sends authenticated keepalive DELETEs unless release has already started. A browser first saves and marks its snapshot; if it cannot write the released mark (for example, when storage is full), it skips attached-record DELETEs and those records can remain on the server. Native reload flushes through the host before navigation. The first successful browser save after restoration clears the mark; back/forward cache keeps the live document and its records. Each window requests release of only its own occurrences; unreachable servers may retain records. OpenCode sessions continue in their native Locations. Whole-window release retains temporary folders and their registry entries; Keep and Discard belong to explicit tab close. -
Each project opening carries a request ID until its tab takes ownership. Native close preparation holds opening commits and captures the record IDs to release. A refused close resumes held commits; an approved close releases the captured records and sends keepalive cancellations for unattached creations by request ID. A departing renderer also cancels unattached creations on navigation. For a new Temporary launch, a server advertising combined cancellation and abandon abandons the allocated folder only if it is still empty and has no open records. With a server lacking that capability, the client cancels the creation and retains the folder. The backend fences cancellations that arrive before creation. Ordinary native close and quit allow five seconds for durable renderer capture and one second for best-effort release. Quit joins any in-progress window release without capturing that window again. Tauri delivers capture, cancellation and release to the exact webview label; its listeners register for that label. Release carries the prepare generation for cancellation after a reload and acknowledges its own generation.
-
Tauri decides which last local window keeps its state when admitting a close. Window-state removal runs off the event loop; Quit defers that window’s prepare until the removal settles, joining its release on success or preparing it on refusal.
-
Restorable workspace descriptors carry an optional versioned
viewStateenvelope.stores/tab-view-state.tsowns its runtime copy by instance UUID; capture writes each occurrence's envelope alongside its own descriptor, and hydration seeds it onto the restored UUID before selecting a conversation. Repeated hydration preserves local gestures. Runtime tab bindings keep views attached through reorder and partial restore; explicit removal clears only that occurrence, while backend unavailability preserves recovery state. The envelope carries per-session chat/preview modes, Mission reader/selection/expanded rows/disclosures, right-panel selection and Files mode. Session-owned browser URLs/history/viewport persist inopencode-session-browser-state-v1. Consumers readgetTabViewState, replace individual fields withupdateTabViewStateand reserveseedTabViewStatefor restoration; capture's optional accessor preserves unhydrated fallback state. Seeded Mission reader targets bind their instance references to the restored UUID. See the restore payload for its storage contract. -
Client-state initialization adopts bounded folder/session preview entries into matching saved descriptors. A project-wide URL belongs to the first matching descriptor with a saved conversation, in descriptor order. Imported occurrence browser entries merge by session, preferring the active descriptor; local-storage entries prefer their most recently written occurrence. Each tab keeps its foreground mode. Resource URLs publish before imported envelopes reduce to modes; unmatched folders remain eligible for migration and consumed entries retire after accepted publication. Restoration seeds data only; a preview consumer must explicitly open its saved URL. Session browser persistence shares a 4,000-character window budget, with 32 sessions and 32 credential-free HTTP(S) history entries per session; history trims before preview eviction.
-
Unsent drafts and attachments outlive their project tab in the window's memory (
stores/closed-workspace-drafts.ts).removeInstancehands them over just before clearing them, keyed by project identity (closedWorkspaceDraftKey: backend profile, server installation for remote projects, and thenormalizeWorkspacePathfolder), for every removal: user close, a close from another window, a backend stop or restart reconciliation. Temporary discards (drafts: "discard") keep nothing and purge the project's whole entry, drafts and attachments, because the folder is deleted. Aworkspace.stoppedevent withtemporaryRetainedkeeps drafts even while the folder is registered. Otherwise a stop with reasondeletedand a folder listed in the current connection'sworkspace.temporaryChangedsnapshot signals Discard: the server stops a discarded record before unregistering the folder, whereas Keep unregisters first. Until the current connection receives that registry snapshot, removal keeps drafts. Restoration-owned instances discarded byremoveRestoreCreatedInstanceFromUikeep nothing either (drafts: "skip"; restoration still holds what it seeded). Closing several occurrences of a folder merges them, the later close replacing a session's text and attachments together, including a session it emptied by typing, clearing or sending (draft/attachment authority with no content), which removes the older value. Folder fallback supersedes older shared bundles, parked or pending. An exact occurrence updates or clears only its own bundles, even when its latest copy is in the shared entry. Saved snapshots remain scoped to their own occurrence. A restoration claims clear marks only for its exact saved workspace ID and folder. The opening claims vault bundles after its own saved prompts are known. Text, files and clear marks take precedence only for the exact saved workspace ID in the same folder. A successful delivery transfers the bundle to the receiving occurrence; undelivered bundles remain with their original owner. A plain folder opening fills an empty, untouched bundle from shared content or an unambiguous delivered successor. The new-conversation draft applies immediately and session drafts wait for initial hydration and owned native reads. A confirmed deletion transfers the text and attachments through the startup recovery rule; an unresolved draft stays in the vault. Filling empty sessions can copy one occurrence's draft into an empty, untouched session of another occurrence of the folder; nothing is overwritten. A restore that fails, or whose tab closes before it finishes, puts back underneath only the sessions it could not apply and the user did not touch there. The vault keeps up to 16 projects and up to 16 returned exact occurrences per project, evicting the oldest entry first. Desktop and web restoration persist open tabs across reloads. -
Git is a full-functionality prerequisite, with directory-only degraded conversations when the backend cannot find Git. Only the explicitly opened physical folder is session authority in that mode; never infer sibling worktrees from native project IDs. Keep ancestor/descendant mutation identities covered by the deletion fence across Git availability changes. Inform agents through the owned native
codenomad.git-availabilityinstruction before prompts/custom commands, remove stale context after recovery, and keep this advisory separate from fail-closed environment synchronization. Do not add a blocking Git setup UI. Validate withscripts/test-git-degraded-native.mjsusing an isolated CLI/database and provider. -
Temporary instances (
workspaces/temporary-workspaces.ts, UIstores/temporary-instances.ts) are ordinary non-Git workspaces on CodeNomad-created direct children of<config>/temporary-workspaces. Registry membership (temporary-workspaces.json), not location, makes a folder temporary; Keep and Discard use the owning backend; Keep unregisters the folder and adds a named recent project. Discard deletes only registered children of that root, refuses running conversations and other open tabs of the folder, removes conversations deepest-first, closes the workspace before deleting the folder and keeps failed removals registered; such a folder is reachable only by browsing to it. Closing a temporary tab from the UI asks Keep/Discard/Cancel, except that an untouched one (no conversation, file or unsent draft) closes and is discarded silently (onlyIfEmpty: the server refuses withtemporary_has_conversations/temporary_not_empty, and any failure of that quiet discard returns the choice without an error). Before the server stops it, a visible temporary tab yields to its neighbour (or closes if alone) and a refusal restores it in place;workspace.stoppedlikewise closes the tab first and clears the instance in a microtask, because clearing a visible shell's state in the same update as its tab freezes the window. Same-minute names get a(n)suffix. Registry changes broadcastworkspace.temporaryChanged, which clears kept marks in every window. Open temporary tabs are saved and restored with the app state like any project tab (still marked temporary). Only the choice dialog overrides initial focus (to its last, non-destructive choice); confirms keep focus on Cancel. Refusals use stabletemporary_*codes localized by the client. Validate withscripts/test-temporary-workspaces-native.mjsagainst an isolated CLI. -
The tab-bar new-instance button follows the last tab outside
TabScroll. Dragged tabs stay visually within the strip (KeepDraggedTabInStrip); the drop slot uses the pointer's unbounded position (closestUnboundedCenter). Click, Cmd/Ctrl+N and the native File menu's New instance command each append and select a fresh empty tab. A long press, right-click, Alt+Down, Shift+F10 or Menu opens the anchoredNewInstanceLauncher: recent tabs with search and the Temporary action. Escape dismisses the launcher and returns focus to+when it still owns focus. Each empty tab owns its Browse and Recent views in memory. Restore previous state saves the empty slots and selected tab alongside project and SideCar slots; restored empty tabs start at Browse. A window with no tabs after restoration or closure selects an empty tab. Opening a folder or SideCar fills the originating empty tab's slot; the Open action joins a tab in its current slot. -
The clone dialog (
components/new-instance-dialogs.tsx) suggests the repository'sgit clonefolder name (lib/clone-destination.ts) inside a parent: the folder chosen with Browse, else the server-scopeduistatelastCloneParent(the folder above the last successful clone), else the folder above the most recent project. A destination the user types is kept as entered and sent unchanged; the server creates it.