Find a file
heunghingwan e56b286a54
fix(transcript): keep stream events from re-rendering unchanged messages (#1017)
## Problem

A DevTools performance trace captured on the deployed web UI during an
active streaming session (44 s recording) showed the renderer main
thread saturated by the backend events stream:

- 158 stream events, **23.2 s** of the 44 s spent inside the `onmessage`
→ `dispatchBatch` → projection → re-render chain (avg 147 ms/event, max
503 ms)
- one **10.6 s** long task draining a backlog of queued frames (1,597
nested JS calls) — the UI froze completely while it ran
- **10.9 s** of pure DOM mutation, 8.8 s of it inside lucide icon
components re-inserting SVG nodes that had not changed
- **2.3 s** of `JSON.stringify` comparing message parts of unchanged
messages

Every stream event re-projected the whole resident message window and
invalidated every mounted message row, not just the one being streamed
into.

## Root causes

1. **Record identity churn** — `hydrateMessages` built a brand-new
`MessageRecord` (and part map) for *every* message in the window on
*every* event, even when nothing changed. Replacing the objects notified
every Solid subscriber of every mounted `MessageBlock`.
2. **Fresh action-menu arrays** — message/tool action menus rebuilt
their item arrays with fresh JSX icon elements on each evaluation,
evaluated twice per render (`<For each>` + the `data-action-overflow`
boolean). `For` keys by reference, so every re-evaluation remounted
every button and icon.
3. **Per-frame reactive pass** — each stream frame ran its own full
`solidBatch` dispatch, so a busy main thread draining N queued frames
did N full passes in one task.
4. **Serializing to compare** — `havePartsChanged`/info comparison used
`JSON.stringify` per part per message per event.

## Changes

- `message-v2/instance-store.ts`: `hydrateMessages` now reuses the
resident record object whenever content, explicit timestamps,
role/status and prompt-display metadata are unchanged; a fully identical
snapshot returns before any store write, session-entry update or
session-revision bump. Comparisons use a new allocation-free structural
equality (`partDataEqual`) with early exit instead of `JSON.stringify`.
- `lib/event-transport.ts`: same-tick stream events are buffered FIFO
and flushed as one batch per microtask; buffered events flush
synchronously before error/disconnect reporting and on `disconnect()`,
so delivered events are never dropped. `serverEvents.dispatchBatch`
stays synchronous, so all existing tests and fixtures are unaffected.
- Action menus memoize their item arrays (`createMemo`): message-item,
tool-call (dual memo mirroring message-item), message-block (passed as
the `headerMenuItems` accessor), prompt-input, WorkspaceTree (per row),
instance-shell2. session-list and FilesPanel already used the equivalent
stable-array-with-lazy-getters pattern.

## Design note: rejected approach

A reference-anchored "skip projection when the SDK list is unchanged"
fast path was implemented and then withdrawn: the SDK reduce mutates
message rows in place through Solid `produce` (`text.text += delta`), so
list and row references stay stable across content changes and identity
can never prove a session unchanged (the replay tests caught this
immediately). Projections always run; record reuse inside
`hydrateMessages` keeps them cheap. This is recorded in AGENTS.md and in
a comment at the projection site to prevent reintroduction.

## Behavior compatibility

- Record `updatedAt` semantics: reuse only fires when an explicit
`updatedAt` is absent or equal, so timestamps never freeze.
- A content-identical forced refresh now *keeps* the resident
`messageInfo` reference instead of swapping it — matching the documented
"identical snapshot must not invalidate caches" invariant. One assertion
in `session-request-authority.test.ts` was updated from `notStrictEqual`
to `strictEqual` accordingly.
- `instance-store.test.ts` gains identity-reuse, reference-stable-parts
and replacement-on-change cases; `opencode-transcript-replay.test.ts`
gains a real-projection case proving a stream delta replaces only its
own record (bounded-window eviction aside); `event-transport.test.ts`
(new) covers coalescing, FIFO order and error/disconnect flush ordering.

## Validation

- UI unit suite: 1,618/1,618 pass; `tsc --noEmit` clean
- Browser: message-scroll 128/128, render-cost 17/17 (tool-call rows),
git-changes-scale + git-history 26/26 (WorkspaceTree/FileRowActions),
search-highlight 11 pass + 1 pre-existing skip
- Two `history-navigation` tests fail identically on a clean checkout
(verified via stash A/B) — pre-existing environment flakiness, not
caused by this change

---------

Co-authored-by: Pascal André <pascalandr@gmail.com>
2026-10-19 07:45:32 +02:00
.github feat(settings): compact Settings, unified notification routing and autosaving Missions preferences (#1014) 2026-10-19 01:23:35 +02:00
.opencode feat(automation): shared page engine with budgeted outlines, select and replacing type (#1015) 2026-10-19 07:38:34 +02:00
dev-docs feat(automation): shared page engine with budgeted outlines, select and replacing type (#1015) 2026-10-19 07:38:34 +02:00
docs docs(help): list Remote Control before direct access (#990) 2026-10-17 13:27:43 +02:00
examples/panel-extension fix(extensions): simplify management inside customization (#872) 2026-10-07 15:59:10 +02:00
images Move screenshots to correct folder 2025-11-21 21:59:58 +00:00
packages fix(transcript): keep stream events from re-rendering unchanged messages (#1017) 2026-10-19 07:45:32 +02:00
scripts feat(missions): coordinator hand-offs, task interrupts and native decision evidence (#1013) 2026-10-19 00:34:27 +02:00
.gitignore chore: remove historical reports and generated artifacts (#857) 2026-10-06 02:25:35 +02:00
.node-version chore(desktop): upgrade bundled Node to 24.20.0 LTS (#679) 2026-09-19 22:01:30 +02:00
AGENTS.md fix(transcript): keep stream events from re-rendering unchanged messages (#1017) 2026-10-19 07:45:32 +02:00
BUILD.md build: ship the Linux deb from Electron and the Windows installer without a ZIP (#955) 2026-10-14 16:45:49 +02:00
CONTRIBUTING.md docs(sidecars): document SideCars as trusted same-origin extensions (#1001) 2026-10-18 03:38:56 +02:00
LICENSE chore(license): add MIT license 2026-02-02 11:22:49 +00:00
package-lock.json chore(ui): upgrade virtua to 0.53.5 to fix near-bottom shrink over-correction (#991) 2026-10-17 16:10:05 +02:00
package.json docs(help): multilingual help site with in-app Help menu and palette entry (#859) 2026-10-14 22:44:56 +02:00
README.md docs(sidecars): document SideCars as trusted same-origin extensions (#1001) 2026-10-18 03:38:56 +02:00
THIRD_PARTY_NOTICES.md feat(missions): native project coordination, briefings and tracking (#866) 2026-10-11 14:55:49 +02:00

CodeNomad

The AI Coding Cockpit for OpenCode

CodeNomad is a desktop and browser workspace for OpenCode V2 — built for developers who work across projects, long conversations, and Git worktrees. It connects to OpenCode's shared background service, keeping your sessions accessible from CodeNomad and compatible terminal clients.

OpenCode gives you the engine. CodeNomad gives you the cockpit.

CodeNomad 0.20 workspace with project tabs, nested sessions, a conversation timeline, and the Status panel

The 0.20 interface, rendered with demonstration data. Download the latest stable release.

User help · Read the English guide on GitHub — multilingual help for current CodeNomad and OpenCode V2.


Features

  • 🚀 Projects and desktop windows — Keep multiple projects open, with per-window tabs, drafts, attachments, and view restoration.
  • 🧠 Sessions and full-history navigation — Browse nested sessions, fork conversations, search beyond loaded messages, and jump through long histories with a timeline and previews.
  • 🌳 Git worktrees — Create and select worktrees, move a session with its subsessions, and review Git changes without leaving the workspace.
  • 💬 Rich conversations — Markdown, code, diffs, tool-result images, configurable reasoning/tool visibility, and /btw for a temporary side question.
  • 📎 Files and attachments — Pick, paste, or drop device files; use @ references for project files and browse your workspace from the file panel.
  • 🌐 Remote access — Connect to a CodeNomad server from a desktop client or browser, with password authentication and HTTPS support. Or turn on Remote Control to pair a phone or another computer from anywhere through an OpenTunnel relay, without opening ports: TLS ends on your machine.
  • 🧩 Tools and previews — Monitor native background shells, manage MCP connections and Global/Project plugin activation, and open web tools as SideCars.
  • 🔎 Agent-driven browser previews — Let your agent open and inspect a visible web preview in Electron or Windows Tauri, without a Developer Mode switch.
  • 🎙️ Voice input and speech — Dictate prompts and listen to responses.
  • ⌨️ A workspace you can adapt — Command palette, notifications, customizable panels, independent light/dark palettes, and multiple interface languages.

Getting Started

🖥️ Desktop App

Available as both Electron and Tauri builds — choose based on your preference.

Download the archive or package for your platform from Releases.

Platform Electron Tauri
macOS ZIP, separate Intel and Apple Silicon builds ZIP, separate Intel and Apple Silicon builds
Windows ZIP (x64) Installer (x64)
Linux deb (x64) AppImage (x64)

The Linux builds are currently built and tested on Ubuntu 24.04. Compatibility with older distributions is not yet guaranteed. The Electron deb sets up Chromium's sandbox during installation and replaces a previously installed Tauri deb. The Tauri installer, macOS app and AppImage update themselves from within the app.

On Linux, from the download folder:

# Electron deb
sudo apt install ./CodeNomad-Electron-linux-x64-<version>.deb

# Tauri AppImage
chmod +x CodeNomad-Tauri-linux-x64-<version>.AppImage
./CodeNomad-Tauri-linux-x64-<version>.AppImage

Without FUSE (for example in a container), start the AppImage with --appimage-extract-and-run.

Desktop builds bundle Node.js and npm; you do not need to install Node.js separately. On first launch, select an existing compatible OpenCode executable or install OpenCode through the setup screen. You can manage the executable, updates, and service later in Preferences → OpenCode.

Open a project folder, connect your model provider, and start a session. Git must be available to the CodeNomad backend for repository and worktree features; see Requirements.

💻 CodeNomad Server

Run on your development machine and access it through a browser. Install Node.js/npm and OpenCode V2 on that host first; Node.js 24 LTS is the recommended runtime (see Requirements).

npx @neuralnomads/codenomad --password "your-password" --launch

The server binds to 127.0.0.1 by default. For remote access, add --host 0.0.0.0 and connect to the printed HTTPS address; see Server Documentation for binding and TLS configuration.

Authentication: Supply --password or CODENOMAD_SERVER_PASSWORD on each start, or use the UI's persistent password setup. auth.json is managed by CodeNomad; see Authentication.

Self-signed certificate: On first launch with HTTPS enabled (the default), your browser will show a "Your connection is not private" warning. This is expected — the server generates a local self-signed certificate automatically. Click Advanced → Proceed to localhost to continue. For local-only use without the warning, run with --https=false --http=true.

See Server Documentation for flags, TLS, auth, and remote access.

🧪 Dev Releases

Bleeding-edge builds from the dev branch:

npx @neuralnomads/codenomad-dev --password "your-password" --launch

OpenCode V2 and upgrading from 0.19.x

CodeNomad 0.20.0 requires OpenCode V2: 2.0.7 minimum, with 2.0.21 recommended and qualified for this release. OpenCode V1 and the former V2 beta protocol are not supported. The current requirements are maintained in runtime-support.ts.

  • One shared OpenCode service owns sessions and messages. Closing a CodeNomad tab, window, or backend leaves that service running. Desktop tabs, drafts, and layout are restored separately for each window.
  • Use an existing CLI or install from CodeNomad. Executables on PATH are preferred; the setup screen also supports a selected executable and a shared user npm installation. The former private CodeNomad OpenCode installation is no longer used.
  • Updating the CLI and restarting its service are separate actions. Use the explicit service controls in Preferences when you want the running daemon to use an updated executable.
  • Remote users should upgrade their CodeNomad server too. The 0.20 UI requires CodeNomad server 0.20.0 or later.

For a manual CLI installation, follow the OpenCode V2 installation guide. The npm package is @opencode/cli and the command is opencode.


SideCars

SideCars let you open web tools running on the CodeNomad server host inside CodeNomad as tabs. Start the service separately, then add it in Preferences → SideCars.

A SideCar runs inside CodeNomad with the same access as the application, so only add services you trust, and avoid ones that display content you do not control.

Session web previews are also available from the conversation toolbar. Agent-driven native browser automation is supported in Electron and Windows Tauri; other Tauri platforms use an iframe preview. See Browser Automation for platform details.

Configuration
  • Name: Display name used in CodeNomad
  • Port: Numeric port of the service on the server host, at 127.0.0.1:<port>
  • Protocol: Select HTTP or HTTPS to match the service
  • Base path: Derived from the name and displayed as /sidecars/:id
  • Prefix mode:
    • Preserve prefix forwards the full /sidecars/:id/... path upstream
    • Strip prefix removes /sidecars/:id before forwarding the request upstream
VSCode (OpenVSCode Server)

Run with Docker:

docker run -it --init -p 127.0.0.1:8000:3000 -v "${HOME}:${HOME}:cached" -e HOME=${HOME} gitpod/openvscode-server --server-base-path /sidecars/vscode

Add SideCar as:

  • Name: VSCode
  • Port: 8000
  • Protocol: HTTP
  • Base path: /sidecars/vscode
  • Prefix mode: Preserve prefix
Terminal (ttyd)

Run with:

ttyd --writable zsh

Add SideCar as:

  • Name: Terminal
  • Port: 7681
  • Protocol: HTTP
  • Base path: /sidecars/terminal
  • Prefix mode: Strip prefix

Requirements

  • OpenCode V2 — 2.0.7 minimum; 2.0.21 recommended for CodeNomad 0.20.0. Install/select it through desktop setup or provide a compatible CLI on the server host.
  • Git — a prerequisite for full functionality (repository identity, Git operations and worktrees). Git must be executable in the CodeNomad backend's PATH; it is not bundled with the desktop installers.
  • Node.js and npm — required for the standalone npm server and source builds, bundled with desktop releases. Use Node.js 24 LTS; development and release builds use the version in .node-version (currently 24.20.0).

On Windows, install Git for Windows with the option to use Git from the command line and third-party software. A per-user installation is sufficient and does not require administrator rights; install into a user-writable directory and make Git available in the user PATH. On macOS or Linux, follow the platform installation instructions. Fully quit and restart CodeNomad after installation so its backend inherits the updated PATH. For a remote server, install Git on the server host for the account running CodeNomad and restart that server process, not just the browser. A Git installation available only inside WSL does not satisfy the Windows backend's requirement.

Without Git, CodeNomad tolerates a degraded, directory-only mode. You can open a folder and talk to your agent, including asking it to help install Git. The backend supplies the agent with Git availability and backend platform context before prompts and custom commands; there is no blocking Git installation screen. Git operations and worktree management require Git. Session access is restricted to the explicitly opened physical folder; open another checkout separately to access its conversations. The agent's shell and the CodeNomad backend can run on different hosts, so installation help must target the backend account and environment. Git availability is rechecked on subsequent sends and the agent context is removed once it is available.


Development

CodeNomad is a monorepo built with:

Package Description
packages/server Core logic & CLI — workspaces, OpenCode proxy, API, auth, speech
packages/ui SolidJS frontend — reactive, fast, beautiful
packages/electron-app Desktop shell — process management, IPC, native dialogs
packages/tauri-app Tauri desktop shell — native windows, integration, and packaging

Quick Start

git clone --branch dev https://github.com/NeuralNomadsAI/CodeNomad.git
cd CodeNomad
npm ci --workspaces --include=optional
npm run dev

npm run dev starts the Electron development host. Use Node.js from .node-version, Git, and a compatible OpenCode V2 CLI. For Tauri, install the platform build prerequisites and run npm run dev:tauri. See CONTRIBUTING.md for the development and PR workflow.


Troubleshooting

macOS: "CodeNomad.app is damaged and can't be opened"

Gatekeeper flag due to missing notarization. Clear the quarantine attribute:

xattr -dr com.apple.quarantine /Applications/CodeNomad.app

On Intel Macs, also check System Settings → Privacy & Security on first launch.

Linux (Wayland + NVIDIA): Tauri App closes immediately

WebKitGTK DMA-BUF/GBM issue. Run with:

WEBKIT_DISABLE_DMABUF_RENDERER=1 ./CodeNomad-Tauri-linux-x64-<version>.AppImage

This applies to the Tauri WebKitGTK build. Electron uses Chromium and can be used as an alternative on the same machine.


Community

GitHub stars

CodeNomad star history

Built with ♥ by Neural Nomads · MIT License