Repository navigation
chore: sync feat/multi-backend with dev - #1512
Conversation
…1484) Deleting one session scanned all resident instance messages through store proxies. Clearing a family repeated that scan for every member, and retained transcript measurement also paid proxy-trap costs across every field. Clear a session through its own messageIds index, retaining the whole-store fallback for missing session records. Walk raw store targets for incremental retention measurement and canonicalize every visited proxy/raw alias before identity deduplication, including display/global cache references. This keeps byte accounting unchanged and avoids falsely exceeding the retention cap. Add real-browser deletion scaling and cached-tool-output accounting regressions alongside the existing retention/LRU tests.
) Plain clicks on relative or absolute file links inside a conversation's worktree open the existing file reader instead of a dead external tab. Preserve loopback-preview routing, browser handling of modified clicks, and normal handling of links outside the worktree. Resolve against the session's own directory, matching worktree inventory by directory rather than a fallback root slug. Independently moved children and sessions absent from a populated inventory keep their own locations. Reject URL-shaped and escaping paths after decoding and normalization. Extract shared session-link routing and decoration, preserve author-supplied titles, refresh owned tooltips with locale changes, and document the behavior in all ten locales. Cover classification and real-component file/loopback routing, unmatched inventories and independently moved children.
…and shell results (#1491) OpenCode 2.3 runs every subagent in the background: the call returns at once (`metadata.status: "running"`) and the child reports to its parent through synthetic `<subagent sessionID state …>` messages, one per idle period, tagged `running` while background work remains. Runtime contracts on `latest` failed for every PR since 2.3.0 because two native fixtures assumed a foreground subagent, and the subagent card showed the model-facing "working in the background" instruction instead of the child's result. OpenCode 2.3.0 becomes the minimum and recommended runtime, so CodeNomad maintains a single subagent delivery model. Daemons below it are refused with `native_contract`. The client, schema and plugin pins move to 2.3.0 with the `effect` 4.1.0 they require; the lockfile is regenerated with the CI's npm so root overrides hold. Docs, the architecture skill, README, CONTRIBUTING and the install, OpenCode, server and troubleshooting help in ten languages state the new minimum. - Native fixtures (missions-trajectory, subagent-nesting) require the launch acknowledgement, an intermediate running report (metadata still `completed`), the final report and lasting quiescence without late wakes. Wayfinder and compare read briefs, run outputs and the judge artifact from the final report. - The subagent card shows the latest report delivered to that call (after its execution start, before the next continuation of the same child; a call continued before any report joins the next reporting period) with a running/completed/error indicator. One reference-only index per session revision serves every card; report bodies stay in the message store. - Code Mode's compact JSON object/array results are displayed indented within size and depth bounds, keeping Warnings/Logs; copy keeps the native text. - An interrupted shell call shows its output so far as output and only the notice under the error label, through an optional `getErrorText` hook. Five independent review passes closed listing-order, continuation, JSON depth, fixture timing, cache staleness, execution-start boundary, joined-period, retention and lockfile-override findings and ended with zero findings. CI on the exact head: 26 jobs passed, including runtime contracts at minimum and latest (2.3.0), OpenCode compatibility and native pruning on Windows, Ubuntu and macOS, four browser shards and all desktop builds. Locally: 30/30 native fixtures against an isolated 2.3.0 CLI, the full server suite under Node 24, and the pruning fixtures on the rebuilt bundle bytes; new unit and browser tests each fail without their change.
Manage each recognized OpenCode integration from its Status → Plugins row. Remove the separate per-integration sections and manual attachment picker; integrations attach conversations through their native first-use contract. Show catalogue names, package versions, integration-accent switches, conversation binding and application warnings. The chain button attaches to a compatible open document or detaches the captured conversation. Revoke pending enumeration and choices on navigation, invalidation, reconnect and disposal. Keep guarded application installation and one-shot native actions alongside existing package controls. Reads remain demand-driven and refresh on native events and reconnects. Explicit refresh also retries demanded bindings for the exact displayed conversation and Location. Preserve integration display and native actions for inherited, virtual and runtime-only plugins through an unambiguous runtime identity, separately from writable-source mutation authority. Keep revision checks, consent revocation and uncertain-outcome handling; never replay a mutation automatically. Update help and UI strings in ten locales, documentation and captures. Cover binding recovery, read-only origins, activation/removal scope and native-action guards through unit and real-panel browser regressions. Qualify the projected runtime identities with the isolated official daemon.
Opening a long session performed every initial Markdown highlight and expanded tool-body mount in the mounting task, blocking the main thread. Commit plain Markdown first and schedule one queued highlight per idle drain. The single-job limit covers async continuations whose parsing/highlighting cost is invisible to a synchronous drain's wall-clock budget. Preserve render request, disposal and cache-key fences. Mount default-expanded settled tool bodies two per frame. User expansion and running/error states release the wait immediately. Flush deferred mounts when explicit key navigation or element alignment begins so timeline settlement lands on final body layout, while ordinary session mounts keep batching. Cover the mechanisms with real-component mount and scheduling regressions; validate timeline placement, source copying, reveal, speech and session-link integration against current dev.
Plugin target discovery includes asynchronous filesystem work, so invocation order cannot identify which mutation reaches the identity lookup first. Await Global reaching its held lookup before launching Project and a second Global mutation; assert independent-scope progress and same-target serialization using completion receipts instead of polling. Exercise Mermaid initialization expiry through the real file-preview consumer. Deferred Markdown highlighting can remount a fence and admit a distinct initialization after the first expires, invalidating the old assertion's ownership assumption. Keep source fallback, late-import fencing and retry coverage without changing production behavior or increasing deadlines. Document the synchronization contracts. Deterministic adverse-order reproductions fail before the test fixes; removing the existing import fence or bypassing the mutation queue still fails the updated tests. Validation on Windows with Node 24.22.3: 30 complete runs of each file (1170 plugin tests and 240 Mermaid tests), 61 server neighbours, 14 browser neighbours, both typechecks and diff whitespace checks pass.
Build each preload independently with inline dependencies and explicit CJS output. Electron's sandboxed loader refuses shared helper requires, leaving local, Preferences and remote renderers without their application bridge and browser previews without the native prompt override. Keep sandbox, context isolation and page Node restrictions unchanged. Add a hidden real-Electron test that loads production dist/preload files, checks preload errors, prompt behavior and context-specific bridge fences. Run it under Xvfb in PR CI and document the build contract. This extracts only the pre-existing build fix, without remote-preview behavior changes. Reproduced red on dev 1a9b0f9 with four shared-helper errors; the hidden built renderer still renders home but is detected as web. Green after the fix and after the full server/Electron build. Validated 1 built-preload test, 7 native pretests, 340 native tests (10 skips), 2 menu tests, 3 build-order checks and all four workspace typechecks with Node 24.22.3 on Windows. Linux native execution is wired into PR CI; local macOS/Linux execution is not claimed.
…bar (#1503) Fixes the cut-off bottom of remote server windows on Linux reported in #1472 (the menu-overlap part needed native Wayland; the Missions part was #1474). ## Cause With Tauri's multi-webview mode, a window's own webview is a window child. The vendored runtime put window children in the `GtkFixed` preview overlay, sized to the window's inner size, which on GTK includes the menu bar. Remote windows keep the menu bar visible, so the page overflowed the bottom by the menu's height, and every resize reapplied that size. ## Fix `tauri-runtime-wry` keeps a webview that requests no bounds (the window's own) in the primary content box below the menu bar; browser previews (explicit bounds) keep using the `GtkFixed` overlay. The patch file is regenerated from the published crate; the patch chain reproduces the vendored `lib.rs` exactly. ## Validation New `src-tauri/examples/menu-layout-linux.rs` runs the real runtime with a visible menu bar: - previous runtime: fails on X11 and Wayland (page 540 px below a 27–29 px menu in a 540 px window); - fixed runtime: passes on X11 and Wayland (KDE session) initially, after maximizing, and after a child webview joins at its exact rectangle.
## Summary - Synchronize the plugin mutation test on Global's actual worktree identity lookup before launching Project and a second Global mutation. Assert that Project completes while the second Global remains queued; retain the existing five-second budget through the native test deadline. - Exercise Mermaid initialization expiry through the real file-preview consumer. Deferred Markdown highlighting can remount a fence and start another initialization, so a visible Markdown error cannot identify every subsequent attempt as the expired one. - Document both test ownership/synchronization rules. Production code, user-facing behavior, help and translations are unchanged. ## Red evidence Both failures were reproduced deterministically before changing their tests: - **Plugin controls:** delay the first connection acquisition until the competing mutation reaches the worktree identity lookup. The old "first lookup belongs to Global" assumption holds Project instead: `false !== true` after 5012 ms. - **Mermaid:** mount the fence as an initial Markdown render, hold its deferred idle highlight until the initialization error is visible, then release that highlight before releasing Tiny. Traces show the original initialization expiring at 10162 ms and a distinct initialization starting at 10197 ms; the latter creates the frame at 11186 ms. The old assertion fails with `1 !== 0`. The existing production late-import fence remains effective for the expired attempt. - The unmodified Mermaid timeout test also passed 30/30 ordinary targeted runs locally; this is an injected adverse scheduling reproduction, not a claim that the original CI failure reproduced naturally. Negative controls verify the updated tests still detect real regressions: - Remove only the production late-import fence from the browser-served module: the updated Mermaid test fails at the same late-iframe assertion (`1 !== 0`). - Bypass only the in-process plugin mutation queue: the updated test fails because the second Global mutation reaches the identity lookup too early (`3 !== 2`). ## Validation Windows, Node 24.22.3; no retries or timeout increases: - `plugin-controls.test.ts`: 30 complete runs, 1170/1170 tests passed. - `mermaid.test.ts`: 30 complete runs, 240/240 tests passed. - Server neighbours (`plugin-control-document`, `plugin-sources`, `desktop-plugin-managed`, plugin-controls HTTP route): 61/61 passed. - Browser neighbours (`markdown-latest-request`, `markdown-loopback-link`, `markdown-session-links`): 14/14 passed. - Server and UI typechecks passed. - `git diff --check` passed. The browser stress run owns one fixture daemon, runs files serially and shuts the daemon down through its authenticated cleanup API. No shared OpenCode service was changed or stopped.
) Coalesce event-driven scroll observations to one per animation frame while preserving synchronous gesture, resize and content observations. Cancel pending observations on deactivation, reset and disposal. Debounce transcript retention measurements to one trailing walk after a 500 ms quiet window, reducing repeated starts during deferred highlighting. Preserve abort-in-flight and stale-result fencing. Cancel the armed frame or timer when synchronously flushing tool-body mounts, so a subsequent queue cannot be drained by both an obsolete callback and its new frame. Add scheduler regressions and CI registration. Update the cache-lifetime test for delayed accounting, select only long-to-long samples for their timing bound, and retain a separate host-tolerant overall backstop.
Read the final three fixture arguments, following the existing remote recovery test. Electron retains --no-sandbox before the script path on Linux, so slice(2) treated the script as the profile directory and the scratch directory as the result file. Reproduced Ubuntu's EISDIR and zero child exit status after exposing its stderr; no additional GPU or sandbox flags are needed. Wait for child close to drain output and report exit code, signal and bounded stdout/stderr before reading the result. Explicitly propagate fixture failures through app.exit, remove the Linux no-display skip, and assert sandbox/contextIsolation/page Node settings for all four tested renderers. Document the distinction between the existing CI process-sandbox flag and renderer preload isolation. Node 24.22.3: test:preloads passes 1 test with zero skips on Windows and Ubuntu 24.04 under Xvfb. The historical shared-helper build still fails with all four preload errors on Ubuntu; a missing display fails with exit=1 and X11 stderr. Windows native tests pass 340 with 10 skips plus 7 pretests; all four workspace typechecks pass. Merged origin/dev separately to include the Mermaid late-iframe regression fix from #1502.
Recall prompt history and place its caret synchronously so a queued callback cannot steal focus or typing from a newer composer selection. Make readiness ownership fixtures observe complete request bytes, hold ACK consumption during replacement checks, and cancel refused plans explicitly. Admit both source-add config reads before advancing mocked deadlines, then join abandoned reads before checking durable state. Cover focus theft with two real browser composers and controlled timers. Validate the browser regression 20 times, 14 adjacent browser tests, 18 composer unit tests, UI/server typechecks, slow-I/O red-to-green checks, and 30 repetitions of both server test files. Keep production server behavior unchanged.
## Summary
- Fix a user-visible prompt-history focus race on `dev`: a delayed
callback could refocus the previous composer after the user selected
another field, redirecting subsequent typing. Recall now focuses and
places the caret synchronously.
- Synchronize readiness ownership tests on complete request bytes and
controlled ACK consumption, rather than filename visibility and a race
with the backend reader.
- Synchronize source-add tests on both admitted configuration reads and
their settlement; advance mocked deadlines instead of imposing a
real-time deadline on the healthy successor.
- Update code-adjacent composer/plugin testing conventions. No server
production behavior, UI copy, controls, or documented user steps change.
## Red-first evidence
- New real-browser regression with two production composers: freeze
timers after bootstrap, press ArrowUp, click the other composer, release
the pending callback, type. Original code leaves the selected composer
empty; fixed code retains the complete draft and updates history caret
placement immediately.
- Delay request writes by 100 ms: original readiness ownership test
fails with missing ACK (`ENOENT`); synchronized version passes.
- Delay configuration reads by 600 ms: original source-add test fails
with `PluginSourcesError: timeout` on the healthy successor;
controlled-clock version passes.
- `codenomad-servers/auth-status.test.ts` is absent from this dev-based
checkout and is not changed.
## Validation
Node 24.22.3, Windows; no retries or timeout increases:
- Browser focus regression: **20/20** runs passed.
- Adjacent browser regressions and fixture wiring: **14/14** tests
passed.
- Composer hook/key handling unit checks: **18/18** tests passed.
- UI and server TypeScript checks passed.
- Both affected server test files: **30/30** paired runs passed (**1,050
tests**, zero failures); **23 paired runs used the exact final files**.
- Full server glob: **3/3** runs passed at concurrency 4. Each: **4,421
tests**, **4,396 passed**, **25 skipped**, zero failures/cancellations.
Durations: 540.089 s / 408.017 s / 422.233 s.
```sh
node --import tsx --test --test-concurrency=4 "packages/server/src/**/*.test.ts"
node --import tsx --test tests/browser/composer-history-focus.test.ts
```
Independent UI review returned zero findings. Logs retained locally
under `C:/Users/Admin/AppData/Local/Temp/opencode/`:
`dev-flaky2-composer-{red,green*}.log`,
`dev-flaky2-composer-{adjacent,unit}.log`,
`flaky2-{red,green}-delayed-{write,source}.log`,
`flaky2-green-target-{1..30}.log`, `flaky2-green-full-{1..3}.log`.
## Residual risk
An exploratory mixed-development full run exposed an unrelated
synchronization failure in
`session-pruning/pending-snapshot.test.ts:240` (“Expected serial
presence reconciliation”). It is unchanged and passed all three final
full runs. That exploratory run also included an explicitly terminated
intermediate readiness-test process; it is not included in the clean
validation counts above.
Draft only; no merge requested.
## Summary
- Bundle each sandboxed Electron preload independently, inline its
dependencies and retain Electron as the sole external module.
- Load the actual production `dist/preload` files in hidden, sandboxed
Electron views; check preview prompt behavior, absence of
`preload-error`, local/Preferences/remote bridge fences and absence of
page Node access.
- Run the build-and-native regression in PR CI under Xvfb and document
the preload build contract.
## User impact and origin
The two-entry preload build emits `require("./_commonjsHelpers-*.cjs")`.
Electron's sandboxed preload loader refuses that relative require before
either preload can initialize.
Reproduced on `origin/dev` (`1a9b0f9e8`) with the built files:
`browser-prompt.js` fails, and `index.js` fails in local, Preferences
and remote contexts. `window.electronAPI` and the host/context markers
are absent in all three application contexts; the standard preview
prompt override is absent.
The production renderer still loads: a hidden real-Electron check
serving the built renderer displays the home screen, but reports
`host=web`. Native folder dialogs, renderer menu-action
subscriptions/titlebar menu calls, window controls, browser-target
registration and desktop client-state bridges are unavailable. A
Preferences-context renderer loads the ordinary home screen instead of
the Preferences component because its context marker is missing. Remote
windows also lose their restricted notification/microphone/recovery
bridge. Main-process menu construction and backend startup remain
independent; this is not a claim that every native menu item or all
backend functionality is broken.
The second entry was introduced by `185087344` (November 7) and
integrated into `dev` by `296af865a` / #1301 (November 8). The affected
configuration is present in the November 9 dev prereleases
(`v1.1.0-dev-20261109-*`) and remains in the tested dev baseline.
This is only the pre-existing Electron build fix, extracted from
`a6fd382d9`. Remote-preview policy/navigation changes are excluded.
Sandbox, context isolation and page Node restrictions stay unchanged.
Tauri has a separate build path and is untouched.
## Validation
- Node 24.22.3, Windows; all Electron windows hidden and unfocused.
- Red on the original build: 1 failed / 0 skipped, four shared-helper
loader errors; all three application bridges absent.
- `npm run test:preloads --workspace
@neuralnomads/codenomad-electron-app`: production build succeeds; 1
passed / 0 skipped; no preload errors; prompt returns the native answer
and all three application bridges retain their context fences.
- `npm run test:native --workspace
@neuralnomads/codenomad-electron-app`: 7 pretests passed; 340 native
tests passed, 10 skipped, 0 failed.
- `node --import tsx --test
packages/electron-app/electron/main/view-menu.test.ts`: 2 passed / 0
skipped.
- `node --test .github/scripts/binary-build-order.test.cjs`: 3 passed /
0 skipped.
- `npm run typecheck` and the server workspace typecheck: all four
workspace typechecks pass.
- `npm run build --workspace @neuralnomads/codenomad`, then `npm run
build --workspace @neuralnomads/codenomad-electron-app`: both pass,
including required packaged server/npm resources. The built-preload test
passes again against this full build (1 passed / 0 skipped).
UI behavior/source is unchanged; the UI CI suites were not rerun. Linux
execution is wired into PR CI; macOS/Linux local execution is not
claimed. Public-help/i18n updates are unnecessary for this repair of
existing behavior; no user-facing strings or documented workflows
change.
… waiting (#1507) ## Summary I make recurring Missions start without a technical activation dialog and distinguish confirmed waiting from completion (backlog item 18). I found that Start asked for both global and project `experimental.schedules` changes, could overwrite an explicit global OFF, and could reject the first Play when scheduling was already ON but lacked an activation receipt. Between passages, recurring entries could look completed or remain green indefinitely. ## User-visible changes - I prepare scheduling automatically on Start/Resume in the mission's project only, without writing global configuration. - I preserve every explicit `schedules: false` (global, project or inherited, including masked values) and environment OFF. Refusals identify the responsible layer, offer **Open scheduling settings** for an authorized editable file, and keep technical details behind the information button. `all_flags: false` is not treated as explicit scheduling OFF. - I release a refused activation request only when the server's `notApplied` proof exactly matches its `requestID` and `expectedRevision`, confirming no document mutation and no existing intent; after correcting the setting, a fresh explicit Start works. I retain genuinely uncertain requests, and recovery never starts Play automatically. - I keep the clicked action loading until the HTTP response arrives, with `aria-busy` and an accessible announcement. - I show confirmed waiting with the palette accent and a static neutral underline. Prepared entries have no underline; pause and interruption have distinct shapes; unconfirmed state is neutral. - I keep a new successful passage green until an attentive explicit selection or **Mark as read** acknowledges that exact passage, then restore waiting when scheduling remains active. Restored selection and a new result on an already selected row leave it unread. I apply the same rules to daily entries and unified scheduled documents. ## Approach and edge cases I resolve the native flag through `Flag.resolve` in the mission's Location, qualify the consumed private contract against OpenCode 2.3.0, and fail safely when it is unavailable. Already-ON scheduling produces a ready proof without configuration writes. I retain the original identity and digests of persisted two-target intentions, observe attempted effects, and never replay their global writes. I share a pure status projection and key read acknowledgements by `passageID` / `history[].id`, rather than a schedule-wide completion flag. Lost acknowledgements preserve the original request; explicit reconciliation does not silently restart Play. I retain revision, connection and ownership fences around activation and control feedback. ## Validation I rebased the six commits onto `dev` at `c8dae86ea` without conflicts; `git range-diff` confirmed all six patches unchanged. - I reran both server/UI typechecks successfully. - Before the review fixes, I reran the focused server activation/capability/flag/calendar/route/contract tests successfully. - Before the review fixes, I reran the ten Mission browser files after the rebase successfully. - I reran the help checks: **31/31 passed**, validating **28 pages × 10 languages**. - I verified [PR Build Validation run 43573451762](https://github.com/NeuralNomadsAI/CodeNomad/actions/runs/43573451762): **success** at `2e22de117d9fa2a809bc4d40bf8cb29f69d735b2`, including all four browser shards. I retain the preceding final-QA evidence that the start-intent file passed **9/9 five consecutive times**. - I verified the isolated native OpenCode 2.3.0 activation/settings qualification logs and the already-ON → Play → admitted-passage receipt. They cover project-only writes, unchanged global settings, explicit OFF/environment provenance, native flag precedence and lost acknowledgements. I include the corrections from the technical and UI/UX reviews. The shared low-contrast focus outline on Parchment remains outside this change. ## Documentation I update `docs/help/<locale>/missions.md` in all ten languages (`en`, `de`, `es`, `fr`, `he`, `ja`, `ne`, `ru`, `tr`, `zh-Hans`), along with `MISSIONS.md`, `MISSIONS_RECURRING.md`, `MISSIONS_NATIVE_CONTRACTS.md`, `OPENCODE_RUNTIME_SETUP.md`, `PLUGIN_CONTROLS.md` and `SETTINGS.md` under `dev-docs/`. ## Long files touched I flag these existing files for their size rather than expanding this change into unrelated refactoring (approximate lines): - `packages/server/src/api-types.ts`: 1,005 - `packages/server/src/opencode/missions-plugin.ts`: 1,058 - `packages/ui/src/lib/api-client.ts`: 1,010 - `packages/ui/src/components/instance/shell/right-panel/tabs/MissionControl.tsx`: 889 - `packages/ui/tests/browser/mission-control.test.ts`: 1,707 - `packages/ui/tests/browser/mission-schedule-list.test.ts`: 1,000
Bring the current dev fixes and OpenCode 2.3 compatibility into the multi-backend integration branch without enabling the opt-in feature. Include project-file links, deferred transcript rendering and measurements, Plugins-row integration management, prepared recurring activation, composer history focus, Linux Tauri layout and sandboxed preload qualification. Resolve shared UI paths by retaining backend-qualified routing, captured attachment authority, revocation fences and durable mutation identities alongside dev's new actions and timing limits. Keep a single self-contained preload fixture with the remote-preview security assertions and one CI hook. Consolidate area documentation and recompute the reviewed backend inventory. Adapt extracted consumer tests to the new progress/activation helpers and bound receipt signals. Synchronize transcript cache tests with mocked timers and the asynchronous accounting drain while preserving eviction/revocation assertions and production behavior. Validate with Node 24.22.3, workspace typechecks, CI UI/server commands, affected browser suites, built preloads on Windows and Linux/Xvfb, Electron native tests, locked Cargo tests, public help and the isolated OpenCode 2.3 Missions native trajectory. Detailed counts and platform-only skips are recorded in the integration PR.
…#1509) Follow-up to #1492 (merged): each integration's Plugins row now says in words where it stands, and acts when something can be done. ## State line Under the first line (name, version, switches, **…**), one state line shows the most important state only. Muted text informs, the theme accent marks a button, the existing warning colour marks an incompatibility; no colour is added. Long text is truncated on one line with the full text in its `title`. | Family | States, by priority | | --- | --- | | Native (e.g. Blender) | part missing → **Install in Blender** · outdated → **Update Blender** (both open the existing installation confirmation) · incompatible (warning, not clickable) · attached → chain icon + document, a click detaches (title **Detach the conversation**) · **Blender closed** · **Blender: no open document** · **No conversation displayed** · one compatible document → **Attach western_ia.blend** · several or not read yet → **Attach…** with the existing document choice | | Editor MCP (Affinity) | **Server detected** / **Server not found** | | API | **Connected** / **Disconnected** | | Not loaded | **Not loaded**, **Failed to load**, **Non-conforming**, **Not supported here**, **No answer** | The automatic attachment at the agent's first use is unchanged. The triangle indicator and the separate chain button are gone; `integrationStateLine` (`lib/integration-row-state.ts`) is a pure function with unit tests for every priority.   `integration-plugin-row.test.ts` writes one Blender row per state in light and dark (`integration-state-<state>-{light,dark}.png`) when `CODENOMAD_INTEGRATION_SCREENSHOTS` is set. ## Native tooltips Plugins rows used Kobalte tooltips whose skip delay opened every next tooltip instantly while the pointer crossed the list. Names, the state line, switches and row actions now use the native `title` like the rest of the app (~300 controls); a row's details also describe the row through `aria-describedby`, and controls keep their `aria-label`. The rule is recorded in `dev-docs/PLUGIN_CONTROLS.md` (Agent conventions). ## Deviations from #1492 - **Open documents are read while the row is shown** (with at least one offer, again after each integration event) so the line can name the document before any click. Attaching still reads them afresh, attaches the shown document only when it is still the only compatible one, and otherwise opens the choice. #1492 read them only on click. - **Reinstall in application…** in the row menu when no install or update is pending, the application open or closed. The Blender plugin rewrites the part when its files differ and answers "unchanged" otherwise. - **Detach moved to the state line**; the row menu now holds the connection line, **Documentation**, the application part's (re)installation, the package check, removal and refresh. - **Unloaded states** get their own short labels (table above). An unknown binding shows as not attached (attach is offered; a `busy` outcome is reported). - **Keyboard trade-off:** focusing a plugin name no longer opens a visual tooltip; its details reach screen readers as the row's description, and the state line's full text is its accessible name. ## Tests - Unit: state-line priorities, link, connection and offer choice, bindings store, integration stores and API, locales, server routes: 88 pass. - Browser (real right panel): `integration-plugin-row.test.ts` (each state's text, tone and colour in light and dark, truncation, attach/detach/choice, menu documentation and reinstall, native titles, attach-intent lifetime) with `plugin-controls` and `plugin-sources`: 71 pass. - `tsc` UI and server, `npm run test:help`: pass. Strings in all ten locales; help pages (English, then nine translations, quoting each locale's UI labels), dev-docs (`OPENCODE_INTEGRATIONS`, `PLUGIN_CONTROLS`) and documentation captures are updated.
…1515) Refs #1513 ## Why On mobile, an app switch or a screen lock makes the browser/PWA reload the page, and the web client restored nothing: back to the home page, project, conversation, reading position and unsent drafts lost. ## What changes - A plain browser tab keeps the existing V1 client snapshot in its own `sessionStorage` (`lib/web-session-client-state.ts`, selected by `lib/native/client-state.ts` for the web host). - Reloads and mobile page discards restore open projects, selected conversations, drafts and scroll positions; a new tab session starts on the home page. - Every tab is primary; **Restore previous state** applies to the tab and is remembered for it. A quota refusal fails only that save; Clear stays available. - The existing restore already rebinds workspaces the backend still lists and never creates one on the web; saved tabs now carry their record id, matched before the folder occurrence. Desktop windows are unchanged; desktop remote windows keep no client state. ## Validation - `client-state.test.ts`: reload restore, sessionStorage-only writes, remembered disabled switch, clear, quota refusal, unchanged no-sessionStorage fallback (35 pass). - Real browser against an isolated server: a full navigation restored the project tab, selected session and its draft, reused the single workspace record; a closed project stayed closed. - UI typecheck, `test:help`; help updated in ten locales (`mobile.md`).
… appending (#1519) ## Problem Every Global/Project plugin toggle appended an exact `id` or `-id` rule to the target configuration file (`appendPluginControlRule`). The file grew on each toggle: a user's `~/.config/opencode/opencode.json` had accumulated nine `"-neuralnomads.blender"`/`"neuralnomads.blender"` pairs, plus `ponytail` and `gpt6-long-context` pairs. Positive rules are not harmless. In OpenCode 2.3.0 every plugin string without `-` is one ordered **add** operation (`packages/core/src/config/plugin/source.ts`, `parse`: `if (!input.startsWith("-")) return { type: "add", target: input, options: {} }`). The supervisor treats it as an activation selector only when it matches a plugin ID already defined or loaded **earlier in the order**, or is `*`, `prefix.*` or `opencode.*`; otherwise it calls `modules.load`, i.e. it installs the target as a package (`packages/core/src/plugin/supervisor.ts`, lines 43–54 at `v2.3.0`). While the Blender package was reloading, the lone `neuralnomads.blender` rules were fetched from npm: `failed to load plugin target=neuralnomads.blender … 404 Not Found GET registry.npmjs.org/neuralnomads.blender`. ## Change A toggle now removes the target file's earlier **exact** rules for that plugin before writing: 1. **remove only**: re-enabling a plugin that is active without its rules (the `-id` entries go, no `id` is added), or disabling one a broader rule already disables; 2. else **remove, then append** the requested rule; 3. else the plain append, as today. The first candidate whose snapshot equals the snapshot appending would give is written: every control's effective state (no rule = enabled, as in OpenCode), the displayed Global/Project switches, and every source. So the effective state stays exactly what the append gave, including with `*`/`ns.*` selectors, rules in other files, Global and Project, CodeNomad-managed plugins and the managed **Re-enable** banner (same mutation). Never touched: broad selectors, other files, entries the snapshot reads as **source declarations** (a package named like its ID, e.g. `"same.id"`), and projections that are not no-op safe (`{env:}`/`{file:}` placeholders, watcher lag), which keep the plain append. A re-enable that would leave a lone positive ID read as a package (plugin absent from the runtime) also keeps the append, because the snapshots differ. `replacePluginControlRules` (`plugin-control-document.ts`) edits with `jsonc-parser`, re-verifies each deleted entry and checks the result parses to exactly the expected document: comments, other entries, ordering, indentation, CRLF and the BOM are kept. ## Tests - New/updated in `plugin-controls.test.ts` (fail on `dev`, pass here — 6 failures on `dev`): the user's accumulated pairs collapse and repeated toggles keep `[source, "ponytail"]`; a `-acme.*` prefix rule (append needed to enable, removal only to disable); a Global rule with a Project toggle; a source named like its ID; managed re-enable with an exact `-codenomad.automation` in Global and Project; the serialization test now ends without the disable/enable pair. - `plugin-control-document.test.ts`: replacement keeps comments/BOM/CRLF/tabs, removal-only, and refuses a changed entry. - Unchanged and passing: placeholders, watcher lag, virtual precedence, managed re-enable past `-*`, WSL document suite. - `tsc` server, `npm run test:help`. ## Docs `dev-docs/PLUGIN_CONTROLS.md` (V2 contract with the OpenCode references, Re-enable, mutation guarantees, tests) and the help's plugin section (`integrations.md`, English then nine translations): switches replace the plugin's earlier exact rules in their scope's file.
Bound the shared plugin-version chip to 16ch, allow it to shrink, and clip overflow with an ellipsis. Full git commit versions can no longer crowd the plugin name out of a narrow Plugins row. Keep the complete version text in the DOM and existing accessible details. Add a real-browser regression checking clipped width, visible name space and the full hash in the tooltip. Existing control, package and source suites pass.
Optimistic sends, session switch-back and virtual-row recycling can remount settled tool cards. Re-entering frame-batched mounting on every remount hid already visible bodies and subagent reports briefly. Record body release once per message/part identity in the session render cache. Warm remounts render immediately; cold mounts retain the original two-per-frame scheduling. Record all release paths and purge the set with message, session and instance cache lifecycle. Cover optimistic sends, reprojection, reasoning arrival, warm switch-back and scroll recycling through per-frame browser sampling, plus round-boundary data invariants. Preserve cold-mount performance, retention accounting and scope isolation.
… balance (#1521) fix(usage): show OpenCode Console counts as reported, with the credit balance The Usage panel treated OpenCode Console ranges as UTC calendar windows and built a local model of the free tier on top: a daily estimate with a next-UTC-midnight reset, an "Estimated" badge, and an "Exhausted" mark derived from native quota failures that forced the gauge to 100% until UTC midnight. Console's ranges are its own, so the reset times and the mark could contradict what Console reports. Free OpenCode models (`big-pickle`, `*-free`) now show one bar: the Console account's free-model request count for Console's `24h` range against the observed 800-request reference, with no reset time, plus the Console credit balance as `credits_balance` (shown with Provider credit balance). Paid Console readings label their ranges 24 hours, 7 days and 30 days and also carry the credit balance. Without a Console login the panel shows the generic Console connection message and Settings -> Providers. The backend drops the free-exhaustion observer and its quota-observer hook, the UTC day window, the `estimated` flag and `freeEstimate.exhausted`. The free usage cache keys by credential only. `parseOpenCodeConsoleBalance` is shared with the Go quota reader; the Console balance read is bounded to three seconds, and failures other than 401 omit the balance. The UI drops the midnight timer, the quota-failure refresh, the estimate/exhaustion rendering and five unused message keys in all ten locales. Validation: server usage, provider, route and provider-account suites pass, including a new route test for the free display (aggregate bar, credits, no reset) and updated Console request counts; UI provider-usage state/panel tests and the provider-usage browser suite pass, including a midnight test that makes no new read; server and UI typechecks, help tests and whitespace checks pass. Help (providers.md) and dev-docs/PROVIDER_ACCOUNTS.md are updated in all ten locales.
feat(ui): keep unsent drafts when a project tab closes Closing a project tab destroyed its unsent drafts and attachments, and reopening the folder created a new instance id, so they were unrecoverable even though the conversations survived in OpenCode (#1513). Removing a project instance now keeps its drafts and attachments in an in-memory, per-window vault keyed by backend id and normalized folder (16 projects, least recently closed evicted). Reopening the same project in that window restores them through the existing workspace prompt hydration: the new-conversation draft at once, session drafts after the initial session hydration, only for sessions that exist. The vault never writes into a session that already shows text or attachments or that the user typed, cleared or sent, so startup, web and reconnect restoration win in either order. When several occurrences of one folder close, the later close wins per session, and a session cleared or sent in the later one removes the older draft. A failed or interrupted restore returns only what it could not apply. Nothing persists across reloads. Discarded temporary workspaces keep nothing in any window: a deleted record still marked temporary when its stop event arrives counts as discarded (the server deletes the record before unregistering the folder; Keep unregisters first). Restore-created instances discarded by restoration itself are not vaulted. Validation: closed-workspace-drafts unit tests, each regression failing when its fix alone is reverted; store, hooks and prompt-input suites (1296 tests); browser closed-tab-drafts, project-tab-close and fixture-wiring tests; UI typecheck, help tests. dev-docs/PROJECTS.md and COMPOSER.md, and the help projects page in ten locales are updated.
Returning to the bottom of an already-latest streaming transcript should not reload its window. The authoritative read repeatedly conflicts with incoming events and can exhaust retries before the positioning callback ever runs. Make Latest a local jump when the latest window is already resident, settle at bottom and hand back to following. Preserve timeline-selection release and active-marker reveal, so subsequent navigation starts at the reading line rather than an old selected marker. History windows retain authoritative loading and the existing failure/retry path. Exempt the explicit bottom pin's settling frames from the long-reply hold; reevaluate the hold on subsequent content growth. Cover the streaming jump through real native event dispatch and retain gesture and timeline behavior.
…lti-backend-dev-3
Extract assistant agent/model display formatting and show metadata in reasoning-first rows and grouped reasoning headers without duplicating the visible label on their child cards. Preserve provider-qualified identities in reasoning tooltips even when different providers expose the same model display name. Keep friendly visible labels, variants and qualified fallbacks unchanged. Add formatter and real reasoning-component regressions for two providers sharing a model name, and register the formatter unit in CI. Co-authored-by: Pascal André <pascalandr@gmail.com>
…1525) fix(sidecars): let the host open SideCars to verified direct HTTPS origins (#1516) Since the direct-listener access alignment, SideCar content (/sidecars/) and SideCar WebSocket upgrades are host-only: the direct listener answers 404 to every non-loopback request, /api/meta reports localRequest false, and the UI hides Open SideCar and the picker. Deployments that reach CodeNomad through a self-hosted TLS reverse proxy (real domain, password sign-in, CODENOMAD_ALLOWED_ORIGINS) whose upstream hop is not loopback lost SideCars entirely, with no way to opt back in. User-visible behavior: Settings > SideCars ends with a host-only switch, "Open SideCars over HTTPS" (off by default, "i" tip linking to the SideCar help), stored as server.sidecarsOverDirectHttps in config.yaml. When it is on, a browser signed in through a verified direct HTTPS origin sees Open SideCar and the picker and can load SideCar pages and their WebSockets. Nothing else changes: password changes, token bootstrap, Remote Control management, remote windows/proxy, saved servers and the plugin bridge stay loopback-only; plain HTTP LAN pages, loopback-alias pages and Remote Control (tunnel) clients never gain SideCars through this setting; previews are unchanged. The switch is shown to local clients only. Approach: - remote-control/direct-https.ts is copied byte-for-byte from feat/multi-backend (same blob), so both branches share one trust model and merge cleanly. verifiedHttpsOrigins() keeps the https entries the direct listener already trusts for mutations (advertised local/remote URLs, reachable addresses, CODENOMAD_ALLOWED_ORIGINS) minus loopback and unspecified hosts; verifiedDirectHttpsOrigin() requires a mutation's own Origin, and for GET/HEAD/OPTIONS takes Origin, else the Referer origin, else https + Host. Ingress sockets never qualify. Its doc comment still describes the device pairing it serves on feat/multi-backend; the code is unchanged. - server/sidecar-direct-https.ts combines that rule with the setting (read per request; an unreadable configuration keeps SideCars host-only). http-server.ts applies it in exactly two places: the direct-listener host-only hook exempts /sidecars/ content paths only, and the SideCar upgrade handler admits the same request class before its unchanged Origin/Referer source policy and session check. Authentication, the direct source policy, SideCar cookie stripping and WebSocket checks are untouched. - /api/meta reports sidecarsAllowed: true for local requests and for opted-in verified direct HTTPS requests (the route is already authenticated). The UI gates Open SideCar and the picker on it; other host-only UI stays on localRequest. - settings/host-only-settings.ts lists server-owner keys that widen host-only access. Both config PATCH routes refuse with 403, inside the config lock, a non-local patch that would change one, including deleting the server owner or writing a non-true value over true; other server keys stay writable. Edge cases: Host fallback only applies to reads; a non-browser client that forges Host still needs a valid session, and Origin-less upgrades are still refused by the source policy (403). An https LAN listener's advertised address qualifies like a configured public origin. Encoded paths are judged as routed. With --dangerously-skip-auth the direct listener is already unauthenticated, so the opt-in adds no credential bypass. Validation: - New remote-control/direct-https.test.ts: the copied predicate unit test; every other host-only path (including an encoded one and bare /sidecars) stays 404 for a verified origin with the setting on; the /api/meta sidecarsAllowed matrix (local, verified via Host/Referer/Origin, http LAN, loopback alias, foreign, setting off) and 401 without a session; a paired Remote Control device gets 404 for SideCars and sidecarsAllowed false even with the tunnel origin listed in CODENOMAD_ALLOWED_ORIGINS. - sidecar-proxy.test.ts: setting off keeps 404 for every verified form; on, content loads through Host, Host:443, Referer and Origin and a POST with its own Origin, while http LAN, loopback alias, unlisted/suffix-spoofed origins, userinfo Host, forwarding headers, Origin null, Origin-less mutations and unauthenticated requests are refused; WebSocket upgrades: 101 for the verified Origin, 404 for http/loopback/foreign/null origins or setting off, 403 without Origin, 401 without a session. - settings.test.ts: non-local enable/disable/delete/non-boolean writes are refused on both routes with the stored value unchanged; local changes and non-local unrelated keys succeed. - Browser host-only-controls.test.ts adds a sidecarsAllowed non-local mode: Open SideCar and the picker appear, Connect server and Change password stay hidden, and the new switch renders for local clients only. - Negative controls (each mutation applied alone, tests rerun, file restored): reverting the HTTP gate exception, reverting the WebSocket exception, dropping origin verification, ignoring the setting, exempting every host-only path, dropping sidecarsAllowed from /api/meta, removing either settings-route guard, and reverting both UI gates to localRequest each make the corresponding tests fail. - Server suites (remote-control/*, direct-origin, direct-listener, sidecar-proxy, meta, settings, auth, sidecars, proxy-websocket, http-shutdown): 126/126. Server and UI typechecks, host-only-controls and remote-access-settings browser tests (17/17), npm run test:help (31/31) and git diff --check pass. help-url and preferences unit tests have two failures that also fail on the base commit without these changes. Docs: dev-docs/REMOTE_CONTROL.md (admission and validation), architecture.md (SideCar agent convention), SETTINGS.md (host-only server settings), and the browser-sidecars, remote-access and security help pages in all ten locales. Closes #1516
Integrate dev's browser-tab reload restoration, closed-project draft retention, integration state lines, plugin rules, Console usage and transcript fixes with the multi-backend branch. Keep the feature disabled by default and retain the shared cancellation flights and exact creation-settlement table. Reconcile saved workspace IDs only inside their backend/folder identity while preserving occurrence snapshots, unavailable-owner placeholders and explicit Retry. Browser restoration never creates missing records. Keep closed drafts and attachments in a backend-scoped vault; normal placeholder Close retains its snapshot, while successful Retry and obsolete Close callbacks cannot reintroduce it. Existing occurrence state and user edits take precedence. Preserve captured backend authority for integration reinstall, passive offers, named-document attach, detach and quota reads. Render the Console's reported counts without local midnight/reset policy. Recompute the typed backend inventory and document the combined current ownership rules. Add regressions for remote close/reopen, homonymous folders on other backends, placeholder ownership, same-ID replacement, web reload and shifted occurrences. Qualify with Node 24.22.3 typechecks, exact CI UI/server commands, affected browser suites, Electron preloads/native tests, help checks and an isolated OpenCode 2.3 native trajectory; full counts and skips are recorded in the PR.
The integration combines dev's OpenCode 2.3 minimum with feature-branch media fixtures still declaring 2.2.3. Runtime admission rejects fixture setup before its HTTP listeners are cleaned up, so the full server runner retains three media workers indefinitely. Use the shared minimum runtime constant for all nine positive fixture identities, preserving production admission and every media, ownership, ABA, cancellation and byte-bound assertion. Document the fixture convention. The affected route and fetch files pass all 27 tests without force-exit; pristine reference comparisons distinguish the integration-only failure.
…listening address (#1523) Remote Control and direct LAN access are off by default, but any user can turn them on from Settings. Organizations evaluating CodeNomad in private environments need a guarantee management can verify: nothing exposed outside the company network unless an administrator allows it, while colleagues may still reach a shared server over the intranet. Two environment variables, read by the backend from the environment it inherits (machine-wide values reach every desktop launch), set that policy: - CODENOMAD_REMOTE_CONTROL=disabled: no tunnel, no launch resume (the user's choice is kept), Start and pairing links refused with 403 and `code: "remote_control_disabled"`, no device authorized. Settings shows "Disabled by administrator" with an info tip linking to the help, hides Start, pairing and web previews, and keeps paired devices revocable. - CODENOMAD_LOCKED_HOST=<address>: the listening address, validated like --host, wins over --host, CLI_HOST and the desktop listening switch. The server reports `listeningLocked`; Remote Access settings show the actual address with the switch disabled and an info tip. Only an unset or exactly empty variable means no policy; any other value, whitespace-only included, refuses startup so a typo cannot leave things open. Two independent review passes (fail-open whitespace, locked caption, help wording) ended with zero P0–P2 findings; the reviewer also checked Windows mixed-case variable names, dotenv precedence and IPv6 captions. Tests cover option parsing, the manager, the routes, a real spawned server (--host 0.0.0.0 listens on 127.0.0.1, meta, Remote Control status, startup refusal of invalid values) and both settings cards in the browser. CI on the exact head: 23 test jobs passed; three macOS desktop builds were still queued for lack of runners. REMOTE_CONTROL.md and the Remote Control, Remote Access and server help in all ten languages describe the policy.
Integrate administrator Remote Control disable and listening-address lock, verified direct-HTTPS SideCar opt-in and assistant reasoning metadata while leaving multi-backend disabled by default. Preserve strict loopback-origin relay authority, origin-bound device pairing and private preview ownership. Administrator disable covers direct pairing, exchanges and authentication without permitting password fallback. Keep the ordinary listener's address lock separate from outbound profile transports, SSH forwards and the isolated loopback preview listener. Compose the SideCar opt-in with direct browser-device admission only for SideCar content. Retain host-only relay, memory and remote-preview management scope. Reject ordinary preview/SideCar proxy rebounds into this backend's control APIs or preview capability origins before HTTP, fallback or WebSocket dispatch, including with skipped local auth and a valid relay proof. Keep per-backend metadata fences and all ten locales. Add real transport composition regressions with ordinary preview/SideCar positives and zero-DNS/zero-upstream refusals; update current security contracts and the typed backend inventory. Full validation counts and known platform failures are recorded in the integration PR.
The verified direct-HTTPS SideCar opt-in adds the public sidecarsAllowed field to metadata. Keep the integration's exact field allowlist and secret-exclusion assertions, and assert the local fixture's permitted value explicitly.
|
Independent review of the merge resolutions: restore/drafts identity, web reload without auto-create, shared cancellation flight, owner routing, admin disable/lock, SideCar HTTPS scope and the single built-preload implementation all hold; 2,872 existing tests pass with no skips. One proxy-boundary gap was reproduced (a DNS alias to the backend listener is treated as local when authentication is disabled with --dangerously-skip-auth); it reproduces identically on dev and on feat/multi-backend, so it is not introduced here and is being fixed separately on dev. |
|
Merging before the current CI run finishes, at the maintainer's request: most jobs have been queued for runners for about an hour. Completed jobs on 515bdfc are green (including runtime-contracts latest against OpenCode 2.3.0); the previous full run on this branch was green; the last dev pass was validated locally (2,872 reviewed tests, full server glob 4,715 pass / 25 skip). Any later CI failure will be fixed in a follow-up PR. |
|
PR builds are available as GitHub Actions artifacts: https://github.com/NeuralNomadsAI/CodeNomad/actions/runs/43787956731 Artifacts expire according to the retention shown on the run.
|
Summary
Merge
origin/devintofeat/multi-backendthrough this integration branch. The multi-backend feature remains disabled by default; this PR does not activate it.Security-sensitive dev refresh
The final refresh merges dev
eabbb6fb8: #1523 (administrator Remote Control disable and listening lock), #1525 (verified direct-HTTPS SideCar opt-in) and #1487 (assistant metadata in reasoning). Published head:515bdfccaf479bc7fd8bffc69f55e25a97cbf220.remote-control/manager.tsremote-control/test-support/surface.tsremote-control/direct-https.test.tsserver/http-server.tsserver/routes/remote-control.tsremote-control/gate.ts/sidecars/*may use the verified direct-browser exception; ingress, backend relay, memory and remote preview authority retain their original refusals.remote-control-settings-section.tsxserver-meta.tsserver/routes/meta-contract.test.tssidecarsAllowed, assert its local value, and retain the closed key list and every secret-exclusion check.Policy decisions: the listening lock controls the ordinary application listener; relay APIs share it and keep their loopback-origin guard. Outbound profile transports, SSH forwards and the lazy isolated preview listener retain their private bindings/lifetimes. Local relay use never reopens administrator-disabled Remote Control. SideCars remain serving-backend/device-local, never the selected remote project's services. Dev's ordinary local-preview-over-RC feature remains available when the host enables it; remote-backend preview capabilities retain their exclusive origins.
The new composition regressions initially exposed six real rebounds (RC ordinary previews and direct-HTTPS SideCars rewriting Origin before reaching the relay/remote capabilities). The fix refuses these targets before dispatch, retaining existing caller/authority checks. 17/17 new security regressions pass, including real HTTP, WebSockets and Referer fallback, encoded control paths, valid current proofs, skipped local authentication, zero-DNS/zero-upstream negative controls, local-preview positives and all administrator-disable/listening-lock combinations.
Current refresh validation (Node 24.22.3):
Help builds 28 pages × 10 locales. The reviewed inventory adds the host-only SideCar HTTPS card and its existing local server-preference action: 1,063 UI sources, 238 backend-bearing files, 813 counted boundary/continuation identities. Prior accepted Windows process/probe failures remain separately documented below.
The first current full server run completed 4,740 cases: 4,714 pass, one failure, 25 skips. Its sole failure was the integration's closed metadata-field allowlist missing dev's additive
sidecarsAllowed. The test now includes that documented field and asserts its local permitted value; exact-key and secret-exclusion checks remain. The targeted metadata tests pass 3/3. The final full server rerun passes 4,715 cases, with zero failures/cancellations and 25 explicit skips; both server batches ran without any other task or test in parallel.Follow-up synchronization
The integration also merges the updated feature branch first, then dev: #1511 shared cancellation flights, #1524 verified direct-HTTPS browser pairing, #1526's corresponding inventory entry, and dev #1509, #1515, #1517, #1518, #1519, #1520, #1521 and #1522.
The old-commit server rerun is not completed, superseded at the coordinator's request; it is not evidence for this revision.
Follow-up product-logic resolutions
provider-usage-panel.tsx/provider-usage-state.ts: keep dev's Console-reported counts, optional credit balance and absence of locally computed midnight/reset/exhaustion policy, alongside the selected backend API, raw workspace ID, request cancellation and attachment/publication fences. Remove the obsolete clock injection from the state API and adapt its captured-authority regression.integration-host-installation.ts: combine dev's application reinstall support with captured backend consent, outcome, refresh and pending-owner fences.integration-row-binding.ts: keep dev's written state line, background open-document reads, named-document revalidation and explicit detach; retain exclusive captured mutation authority, and fence/reacquire background offer reads on attachment changes.plugin-row-actions.tsx: keep Documentation and install/update/reinstall actions, with backend-scoped deferred-action/removal guards. Reviewed external documentation links retain their independent lifetime.use-app-session-capture.ts: persist dev's workspace record ID alongside the feature branch's backend/folder/occurrence and complete placeholder state.use-app-session-restore.ts: retain backend admission, placeholders, explicit Retry and cancellation ownership; combine with web-tab session storage and record-ID rebinding. Web reload never auto-creates absent records, while unavailable remote owners keep their saved placeholders.app-session-reconciliation.ts: prefer a surviving saved record ID only inside its exact backend and normalized folder, then use occurrence matching without crossing owner scopes.client-state-partitions.ts: encode, validate and restore both backend identity and saved workspace ID through the partition graph.instances.ts: preserve fix: share one cancellation flight for stale remote creations (#1236) #1511's shared cancellation flight and feat: open saved server projects in ordinary tabs for #1236 #1504's settlement table unchanged. Add dev's closed-draft handoff and backend-scoped temporary-discard registry; suspension leaves occurrence state with its placeholder and returns only unapplied vault claims.closed-workspace-drafts.ts/remote-restore-tabs.ts: scope the bounded in-memory vault by backend plus normalized folder. Normal placeholder Close retains its snapshot; successful Retry and stale Close do not. Explicit occurrence restoration and user edits win over closed sibling data. A Close callback checks its exact placeholder object, preventing same-ID replacements from inheriting stale drafts or being removed.New regressions cover remote close/reopen with drafts and attachments, another server's homonym, local homonyms, suspended placeholders, unapplied claims, restored-occurrence precedence, same-ID placeholder replacement, web reload with shifted occurrences, unavailable remote Retry and backend-correct reopening.
Server-hang diagnosis and correction
The stalled server runner retained three children:
session-media-boundary.test.ts,session-media-ownership.test.tsandsession-media.test.ts. Their fake HTTP listeners remained open after fixture setup rejectedOpenCode 2.2.3withUnsupportedOpenCodeError, reasonnative_contract, required2.3.0. Process-tree, wait-state and socket snapshots were captured before stopping only that test tree.Diagnostic isolated results on unmodified sources:
fee7b6144origin/deve55af8e79origin/feat/multi-backend08a1b21cdThese diagnostic runs used an explicit timeout/force-exit to reveal fixture rejection rather than retain its listeners; they are not the full qualification. The feature fixtures' hardcoded runtime identity had not been reconciled with dev's OpenCode 2.3 minimum. Corrected all nine positive fixture identities across the three route files and
opencode/session-media-fetch.test.tsto useMINIMUM_OPENCODE_VERSION, matching existing dev fixture conventions. Production admission and every assertion remain unchanged. The four files then pass naturally: 27/27, no force-exit, failures or skips.Both pristine references were also rerun without force-exit or test-timeout overrides: dev's present file 1/1, feature's three files 17/17, natural exit 0 throughout. The two absent dev files are reported as absent, not skipped or passed.
Dev changes included
Product-logic resolutions
packages/ui/src/lib/api-client.tspackages/ui/src/components/mission-schedule-controls.tspackages/ui/src/components/mission-recurrence-list.tsxuntrackalongside backend helpers and retain revocation checks around returned results.packages/ui/src/components/markdown.tsxpackages/ui/src/components/markdown-session-links.tsprojectScopeinto helper; mounted owner metadata supplies availability and revoked attachments cannot route or publish stale errors.packages/ui/src/components/plugin-row-actions.tsxpackages/ui/src/components/integration-attachment.tsx→integration-row-binding.tspackages/electron-app/electron/preload/built-preloads.*packages/electron-app/package.jsonRegression-test adaptation
mission-backend-consumers.test.ts's extracted production scopes for dev's held-intent/progress helpers and bounded receipt signal; preserve routing/revocation assertions and add the enabled-without-ready-proof activation case.useSessionCache.test.tssynchronization to mocked timers plus the async-accounting drain: dev's measurement debounce is 500 ms and the retained 250 ms wait was too short. Production ownership logic and all assertions are preserved.scripts/backend-async-operations.jsonwith the existing typed scanner, review each changed access and updatedev-docs/architecture.mdclassifications for replacement integration/link consumers and configuration-file targeting. Tests remain unchanged.Initial validation
Node 24.22.3 throughout the final runs. Skips are reported separately.
--test-concurrency=4pretest:nativetest:nativecargo test --lockedbuild:help: 28 pages × 10 locales; all four native plugin builds pass.test-missions-native-trajectory.mjs, OpenCode 2.3.0: 10/10 gates, all checkpoints through terminal completion, exit 0. Covers genuine native family/parallelism, Wayfinder answers/provenance and distinct-model blind comparison. Uses deterministic providers, not a paid model or the shared service.test-electron-universal.cjs's explicit POSIX-host assertion on Windows, not a product assertion; it is not counted as passed.Follow-up validation
Node 24.22.3. Failures, cancelled cases and skips are reported separately.
--test-concurrency=4pretest:nativetest:native, final comparison runinjected local URL joins match the integration baseline character for character and exit naturally,spawnSync ...node.exe ETIMEDOUTafter 30,045.7426 ms, atlocal-route-joining.test.ts:47. The complete unchanged exact command passed on rerun.Electron pristine-reference comparison
The exact requested command,
npm run test:native --workspace @neuralnomads/codenomad-electron-app -- --test-concurrency=1, ran on dev, feature and the corrected integration one after another, after the server and every other suite had finished. Both reference trees came fromgit archive, with junctioned dependencies and unchanged source files. The same external read-only spawn probe was used for all three runs.e55af8e7908a1b21cd9f7d44876Every integration failure reproduces on at least one pristine base:
false !== truefalse !== trueOpenCode service start failedOpenCode service start failedOpenCode service start failedOpenCode service start failednull !== 0null !== 0null !== 0The implementation and test blobs of
native-service-start,process-stopandclient-state-processare identical on all three refs. Child diagnostics on feature and integration show no spawn-error event: the service-start children are still pending when the existing local five-second timer requestsSIGKILL, and exit withcode: null, signal: SIGKILL. For integration, those kill requests occur 8,740/8,746 ms after entering spawn (spawn itself returns at 3,724/3,734 ms). The stdin fixture is killed at 3,231 ms after entering spawn (518 ms after stdin-end) and exits withcode: null, signal: SIGKILL. These are reproduced pre-existing failures, not evidence of a new merge regression or a claimed global-load cause.Remaining server probe failures
The completed full server run's two failures are:
ENOENTopening the fixture'sgrandchild.pid,legacy-installation.test.ts:401.the default delay keeps the unknown result, actual0, expected1, line 461.The entire unchanged
legacy-installation.test.tswas then run separately, sequentially on pristine dev, pristine feature and the integration, all with Node 24.22.3:e55af8e7908a1b21cd9f7d44876All three reproduce the same names/messages:
ENOENTopeninggrandchild.pid, line 401.an expired unknown is re-probed, actual1, expected2, line 449.the explicit recheck spawns a fresh probe within the delay, actual1, expected2, line 464. The full-run line-461 variant was not reached in this isolated comparison.All 63 file/ref hash checks match their archived refs. The critical foreign-probe/installation/lock/binary production modules are identical on all three refs, and the merge's test file matches dev exactly. These pre-existing probe failures remain visible; no assertion, deadline or runtime-admission policy was relaxed to make the synchronization pass.
Exact Electron native failures before the reference comparison
Default concurrency: 335 pass, 2 fail, 6 cancelled/timeouts, 10 skip.
AssertionError: false !== trueError: OpenCode service start failedtest timed out after 20000mstest timed out after 5000mstest timed out after 10000mstest timed out after 45000mstest timed out after 45000mstest timed out after 45000msFour-file concurrency: 338 pass, 4 fail, 1 cancelled/timeout, 10 skip.
AssertionError: false !== trueError: OpenCode service start failedError: OpenCode service start failedAssertionError: null !== 0test timed out after 10000msSerial execution: 340 pass, 3 fail, 0 cancelled, 10 skip.
Error: OpenCode service start failedError: OpenCode service start failedAssertionError: null !== 0No load-related cause or integration-specific regression is inferred from these observations alone.
Scope
Draft integration PR only. No merge, release, feature activation, shared OpenCode restart or daemon modification.
File-size highlights (existing/merged files)
packages/server/src/api-types.ts~1,018 lines;packages/server/src/opencode/missions-plugin.ts~1,057.packages/server/src/server/routes/pending-requests.test.ts~1,025;packages/server/src/workspaces/instance-events.test.ts~1,018.packages/tauri-app/vendor/tauri-runtime-wry-2.12.3/src/lib.rs~5,453.packages/ui/src/components/instance/shell/right-panel/tabs/MissionControl.tsx~899;packages/ui/src/components/markdown.tsx~574.packages/ui/src/components/tool-call.tsx~999;packages/ui/src/components/tool-call/renderers/task.tsx~634.packages/ui/src/components/virtual-follow-behavior.ts~581;packages/ui/src/components/virtual-follow-list.tsx~1,500.packages/ui/src/lib/api-client.ts~1,067;packages/ui/src/stores/message-v2/instance-store.ts~1,557.packages/ui/src/lib/i18n/messages/{de,en,es,fr,he,ja,ne,ru,tr,zh-Hans}/settings.ts~828–842 each.packages/ui/tests/browser/mission-control.test.ts~1,707;packages/ui/tests/browser/mission-schedule-list.test.ts~1,061.scripts/test-missions-native-trajectory.mjs~528.packages/ui/src/stores/instances.ts~2,821;packages/ui/src/stores/client-state-partitions.ts~552.packages/server/src/opencode/plugin-controls.ts~995 and its test ~1,017;packages/server/src/server/http-server.ts~2,607.packages/ui/src/components/message-block.tsx~1,789;packages/ui/src/components/message-section.tsx~1,907.packages/ui/tests/browser/message-scroll.test.ts~2,473;packages/ui/tests/browser/provider-usage.test.ts~1,194.packages/server/src/server/http-server.ts~2,653;packages/server/src/index.ts~787;packages/server/src/api-types.ts~1,026.packages/ui/src/components/folder-selection-view.tsx~879;packages/ui/src/components/message-block.tsx~1,788;packages/ui/src/components/message-item.tsx~848;packages/ui/src/stores/preferences.tsx~1,896; localesettings.tsfiles ~825–839 each.