Skip to content

perf(tauri): Rust-native desktop event transport#242

Merged
shantur merged 22 commits into
NeuralNomadsAI:devfrom
Pagecran:pagec/rust-desktop-event-transport
Jun 8, 2026
Merged

perf(tauri): Rust-native desktop event transport#242
shantur merged 22 commits into
NeuralNomadsAI:devfrom
Pagecran:pagec/rust-desktop-event-transport

Conversation

@pascalandr

@pascalandr pascalandr commented Mar 22, 2026

Copy link
Copy Markdown
Contributor

Summary

  • switch the Tauri desktop runtime from the browser EventSource path to a native Rust desktop event transport while leaving browser and Electron unchanged
  • restore SSE heartbeat parity by parsing named event: frames and replying to codenomad.client.ping with an authenticated /api/client-connections/pong
  • add a Tauri-only settings toggle that lets the current device fall back to the browser EventSource transport without leaking that choice through shared config
  • remove the temporary benchmark harness from the shipped code now that the transport behavior has been validated

Benchmark

The temporary in-app benchmark harness used during validation has been removed from the final code, but the measured results are retained here for review context.

Real Tauri/WebView2 benchmark on Windows using the dedicated session:

  • workspace: D:\CodeNomad
  • session: ses_21feb15b3ffeLz3uRModK4KKnG

Short command:

  • node -e "for (let i = 1; i <= 400; i += 1) console.log('line ' + i)"

Results:

  • browser EventSource forced in Tauri:
    • timed out after 131479.7ms
    • sawWorking=false
    • reachedIdle=false
    • batchesReceived=84
    • eventsReceived=84
    • maxBatchSize=1
  • Rust-native transport:
    • completed in 1437.4ms
    • sawWorking=true
    • reachedIdle=true
    • batchesReceived=4
    • eventsReceived=45
    • maxBatchSize=27

Long heartbeat / stale-timeout validation:

  • command: powershell -NoProfile -Command Start-Sleep -Seconds 70
  • Rust-native transport:
    • completed in 71689.5ms
    • sawWorking=true
    • reachedIdle=true
    • batchesReceived=13
    • eventsReceived=72
    • maxBatchSize=25

Confirmed separately afterward: the native transport also behaves better on Linux.

Validation

  • cargo test named_ping_event_is_routed_to_ping_channel
  • cargo test session_cookie_is_attached_to_requests
  • cargo test --no-run
  • npx tsc --noEmit --pretty -p packages/ui/tsconfig.json
  • npx tsc --noEmit --pretty -p packages/server/tsconfig.json
  • manual Tauri/WebView2 benchmark on Windows
  • manual confirmation on Linux after the benchmark phase

Notes

  • this remains a Tauri-only transport; browser and Electron stay on the browser EventSource path
  • the Tauri fallback toggle is now genuinely device-local and restarts the local event stream immediately when changed
  • the long run validates heartbeat / stale-timeout robustness, not headline perf

@github-actions

Copy link
Copy Markdown

PR builds are available as GitHub Actions artifacts:

https://github.com/NeuralNomadsAI/CodeNomad/actions/runs/23398482721

Artifacts expire in 7 days.
Artifacts: (none found on this run)

@github-actions

Copy link
Copy Markdown

PR builds are available as GitHub Actions artifacts:

https://github.com/NeuralNomadsAI/CodeNomad/actions/runs/23398502150

Artifacts expire in 7 days.
Artifacts: (none found on this run)

@pascalandr pascalandr marked this pull request as draft March 22, 2026 08:38
@github-actions

Copy link
Copy Markdown

PR builds are available as GitHub Actions artifacts:

https://github.com/NeuralNomadsAI/CodeNomad/actions/runs/23399446411

Artifacts expire in 7 days.
Artifacts: (none found on this run)

@github-actions

Copy link
Copy Markdown

PR builds are available as GitHub Actions artifacts:

https://github.com/NeuralNomadsAI/CodeNomad/actions/runs/23401824896

Artifacts expire in 7 days.
Artifacts:

  • pr-242-a3e768c36a4a3a34df9c243e78bdf25e431c4d80-electron-linux
  • pr-242-a3e768c36a4a3a34df9c243e78bdf25e431c4d80-tauri-macos-arm64

@github-actions

Copy link
Copy Markdown

PR builds are available as GitHub Actions artifacts:

https://github.com/NeuralNomadsAI/CodeNomad/actions/runs/23402541285

Artifacts expire in 7 days.
Artifacts: (none found on this run)

@github-actions

Copy link
Copy Markdown

PR builds are available as GitHub Actions artifacts:

https://github.com/NeuralNomadsAI/CodeNomad/actions/runs/23410012218

Artifacts expire in 7 days.
Artifacts:

  • pr-242-aa0b3203b5910e5459cd1362b184d3f529ecd67e-electron-linux-rpm
  • pr-242-aa0b3203b5910e5459cd1362b184d3f529ecd67e-electron-linux

@pascalandr pascalandr force-pushed the pagec/rust-desktop-event-transport branch from 5f572c2 to 4448dd0 Compare March 29, 2026 21:19
@pascalandr pascalandr changed the title perf(tauri): move desktop event transport and transcript batching native perf(tauri): native desktop event transport with fast assistant streaming Mar 29, 2026
@pascalandr pascalandr force-pushed the pagec/rust-desktop-event-transport branch 7 times, most recently from 74ec719 to 302e87f Compare April 4, 2026 12:11
@pascalandr pascalandr marked this pull request as ready for review April 4, 2026 12:21
@pascalandr

Copy link
Copy Markdown
Contributor Author

I’d be happy to get a critical review on whether this direction makes sense upstream.

@shantur

shantur commented Apr 9, 2026

Copy link
Copy Markdown
Collaborator

Hey @pascalandr ,

How does this Tauri specific change effect electron and server UI?

@shantur

shantur commented Apr 9, 2026

Copy link
Copy Markdown
Collaborator

@CodeNomadBot

I want you to perform the gatekeeper checks for latest PR state

check for regressions
check for better possible implementations
Be the PR gatekeeper
Be ruthless about code quality

@pascalandr

Copy link
Copy Markdown
Contributor Author

Hey @pascalandr ,

How does this Tauri specific change effect electron and server UI?

Only commit 1 is Tauri-specific.
Electron and the browser/server UI still use the existing browser EventSource path; they do not use the Rust transport.

Commit 2 is intentionally cross-host: it optimizes how streaming updates are applied/rendered in the UI, so it should benefits Tauri, Electron, and the browser path alike.

@shantur

shantur commented Apr 9, 2026

Copy link
Copy Markdown
Collaborator

Am I correct in understanding that each platform will be using their native EventSource path?

@pascalandr

Copy link
Copy Markdown
Contributor Author

In this PR:

  • Tauri switches to the nenw Rust-native transport
  • Electron and the browser/server UI keep the existing browser EventSource path

So only the Tauri transport changes here. The UI-side streaming optimizations are host-agnostic and sit below that transport choice.

@shantur

shantur commented Apr 9, 2026

Copy link
Copy Markdown
Collaborator

@pascalandr - I am sure this works well but the problem is I don't have experience with Rust / Tauri . I am more Java / Node person and the Tauri app is 100% maintained by AI and community. The only reason it came in because people wanted it so AI made it.

I can't maintain Tauri only features as I can't code review them and EventSource being a core part any changes on it I will be totally reliant on AI or community for it.
So from my point of view, I see these platform specific changes

  • Are they necessary to support the platform?
  • Are these platform specific features bringing something really valuable?
  • Can we live without these features and have less code to maintain?
  • What are the trade-offs to not use them?

Would you help me decide these please?

@pascalandr

Copy link
Copy Markdown
Contributor Author

I see but TBH, the Rust/Tauri transport is the part I cared about most, because I use the Tauri client all day long.
But I do not have solid benchmark data yet, so I would not say this is needed for Tauri support. It is an optimization, not a requirement.
Are you looking for a community maintainer for the Tauri app before accepting this kind of change?

@shantur

shantur commented Apr 10, 2026

Copy link
Copy Markdown
Collaborator

@CodeNomadBot

I want you to perform the gatekeeper checks for latest PR state

check for regressions
check for better possible implementations
Be the PR gatekeeper
Be ruthless about code quality

  • Also Read my comments and inform about possible knock-on effects on Electron and server.

@codenomadbot

codenomadbot Bot commented Apr 10, 2026

Copy link
Copy Markdown
Contributor

I reviewed the latest PR state as a gatekeeper review.

My understanding of the request: evaluate the current PR for regressions, better implementation options, and specifically call out any knock-on effects on Electron and the server/browser UI discussed in this thread.

Findings:

  1. High: the new transport abstraction drops browser-side SSE ping/pong handling, which will regress Electron and the server/browser UI.

    • packages/ui/src/lib/server-events.ts:42-58 now calls connectWorkspaceEvents(...) without supplying onPing.
    • packages/ui/src/lib/event-transport.ts:24-30 still supports onPing, but only if the caller passes it through.
    • packages/ui/src/lib/api-client.ts:426-455 shows the browser EventSource path still emits codenomad.client.ping events.
    • packages/server/src/server/routes/events.ts:50-53,81-87 and packages/server/src/clients/connection-manager.ts:89-95 show those pings must be answered or the server times the client out after 45s.
    • packages/server/src/plugins/voice-mode.ts:16-29 shows at least one user-visible feature that depends on this connection tracking.
    • Before this PR, server-events.ts answered the ping by calling sendClientConnectionPong(...); that behavior is gone.
    • Result: Electron and the browser/server UI will silently lose their tracked client connection every ~45s on the browser EventSource path. That is exactly the cross-host knock-on effect your thread was asking about.
  2. High: the Tauri reconnect path clears the active session target and never restores it unless the user changes tabs/sessions again.

    • packages/ui/src/lib/native/desktop-events.ts:138-149 calls desktop_events_stop whenever the JS-side connection disconnects.
    • packages/tauri-app/src-tauri/src/desktop_event_transport.rs:364-371 clears state.active_target inside stop().
    • packages/ui/src/lib/server-events.ts:74-89 disconnects the current transport on every reconnect cycle.
    • packages/ui/src/App.tsx:266-280 only sends desktop_events_set_active_session(...) when activeStreamTarget() changes, not after transport reconnect.
    • Result: after the first native transport reconnect, the Rust side forgets which session is active, so the active-session-specific fast path can silently degrade until the user manually changes selection again. For a performance PR, losing the optimization after the first reconnect is a real behavioral regression.

Knock-on effects by host:

  • Commit 1 is still Tauri-only in intent, but it is not fully isolated operationally because the new shared transport abstraction in commit 2 regresses the browser EventSource path.
  • Electron and the server/browser UI do not take the Rust transport, but they do take the new connectWorkspaceEvents / ServerEvents path. So they are directly exposed to finding 1.
  • I did not find evidence that Electron/server pick up the Tauri-native batching/coalescing code itself. The cross-host risk is from the shared UI transport refactor, not from Rust code execution on those hosts.

Better implementation direction:

  • Preserve ping/pong at the abstraction boundary. Either keep the pong logic in ServerEvents, or make the browser transport implementation own ping replies so callers cannot accidentally omit them.
  • Split native transport teardown semantics into “temporary disconnect for reconnect” vs “full stop”, or keep active_target outside stop() so reconnects do not erase session targeting state.
  • Given the maintainer comments in this thread: this Tauri transport is an optimization, not a platform requirement, and it adds a large Tauri/Rust maintenance surface around a core event path. I would want hard benchmark evidence plus a simpler failure/reconnect story before accepting that maintenance cost upstream.

Validation notes:

  • I attempted cargo test --manifest-path packages/tauri-app/src-tauri/Cargo.toml desktop_event_transport, but it is blocked in this workspace by a missing packages/tauri-app/resources/server build resource.
  • I attempted UI typechecking, but the workspace does not currently have the UI/server dependencies installed, so that check is not meaningful here.

Gatekeeper verdict: not merge-ready. Both findings above are blocking regressions, and one of them hits Electron/server directly.

--
Yours,
CodeNomadBot

@shantur

shantur commented Apr 10, 2026

Copy link
Copy Markdown
Collaborator

I see but TBH, the Rust/Tauri transport is the part I cared about most, because I use the Tauri client all day long. But I do not have solid benchmark data yet, so I would not say this is needed for Tauri support. It is an optimization, not a requirement. Are you looking for a community maintainer for the Tauri app before accepting this kind of change?

As of now, I want to keep native ( Tauri / Electron ) features to the bare minimum as my current process is to implement features in web and server and expect them to run on both Electron / Tauri without any changes. This helps me a lot in ways

  1. I don't have to test multiple platforms.
  2. I dont have to worry changing one will break the other
  3. I can be fairly confident on the changes.

I will need some time to work out what needs to be done for cases like this.
Community maintainers are good to have but currently my work on CodeNomad is what I do in my free time and waiting on features to be tested on different platforms by different maintainers might prove a bit slow.
I would surely love to have maintainers come and join but for the core product, not per platform.

I hope you understand.

@pascalandr

Copy link
Copy Markdown
Contributor Author

When you says not have to test multiple "platforms" do you mean Tauri / Electron or Windows/linux/Macos ?

@shantur

shantur commented Apr 16, 2026

Copy link
Copy Markdown
Collaborator

@pascalandr - Sorry I missed your comment.

Multiple platforms = Tauri and Electron on different OSes ( Windows, MacOS and Linux )

@github-actions

Copy link
Copy Markdown

PR builds are available as GitHub Actions artifacts:

https://github.com/NeuralNomadsAI/CodeNomad/actions/runs/26031049985

Artifacts expire in 7 days.
Artifacts:

  • pr-242-27d7430c38bc3f07ec32b1454ab47e775ea6c567-tauri-macos
  • pr-242-27d7430c38bc3f07ec32b1454ab47e775ea6c567-tauri-linux
  • pr-242-27d7430c38bc3f07ec32b1454ab47e775ea6c567-tauri-macos-arm64
  • pr-242-27d7430c38bc3f07ec32b1454ab47e775ea6c567-tauri-windows
  • pr-242-27d7430c38bc3f07ec32b1454ab47e775ea6c567-electron-macos
  • pr-242-27d7430c38bc3f07ec32b1454ab47e775ea6c567-electron-windows
  • pr-242-27d7430c38bc3f07ec32b1454ab47e775ea6c567-electron-linux

Fix the current upstream/dev baseline type mismatches exposed during the integrated PR batch validation. Align the session SDK imports with the v2 surface and narrow the git status workspace payload typing so the merged batch typechecks cleanly without changing feature behavior.
Merge current upstream/dev into pagec/rust-desktop-event-transport to clear PR NeuralNomadsAI#242 conflicts. The conflict resolution preserves the recent-folder/project-name launch flow from upstream while keeping the native Tauri event transport wiring, and retains the SDK v2 session type/diff compatibility already validated in the integrated Pagec_tauri branch. Validation: git diff --check and npm run typecheck --workspace @codenomad/ui.
@github-actions

github-actions Bot commented Jun 6, 2026

Copy link
Copy Markdown

PR builds are available as GitHub Actions artifacts:

https://github.com/NeuralNomadsAI/CodeNomad/actions/runs/27046140287

Artifacts expire in 7 days.
Artifacts:

  • pr-242-b2d1c924c05afb0daced3b5ede7002149ae22eaa-tauri-macos
  • pr-242-b2d1c924c05afb0daced3b5ede7002149ae22eaa-tauri-linux
  • pr-242-b2d1c924c05afb0daced3b5ede7002149ae22eaa-tauri-windows
  • pr-242-b2d1c924c05afb0daced3b5ede7002149ae22eaa-electron-macos
  • pr-242-b2d1c924c05afb0daced3b5ede7002149ae22eaa-tauri-macos-arm64
  • pr-242-b2d1c924c05afb0daced3b5ede7002149ae22eaa-electron-windows
  • pr-242-b2d1c924c05afb0daced3b5ede7002149ae22eaa-electron-linux

Prioritize packaged server entrypoint candidates before the workspace fallback in production desktop launches, compare native event transport starts without the generated connection id, and percent-encode unsafe cookie-value bytes before building Cookie headers.

Adds focused Rust coverage for production candidate ordering, idempotent transport starts with fresh connection ids, material stream changes, and Cookie header delimiter/control-byte encoding. Validated with the Tauri Rust test suite.
@github-actions

github-actions Bot commented Jun 6, 2026

Copy link
Copy Markdown

PR builds are available as GitHub Actions artifacts:

https://github.com/NeuralNomadsAI/CodeNomad/actions/runs/27059209589

Artifacts expire in 7 days.
Artifacts:

  • pr-242-1f79720ca99c4564a381937638cb63170e051af4-tauri-macos
  • pr-242-1f79720ca99c4564a381937638cb63170e051af4-electron-macos
  • pr-242-1f79720ca99c4564a381937638cb63170e051af4-tauri-linux
  • pr-242-1f79720ca99c4564a381937638cb63170e051af4-tauri-windows
  • pr-242-1f79720ca99c4564a381937638cb63170e051af4-tauri-macos-arm64
  • pr-242-1f79720ca99c4564a381937638cb63170e051af4-electron-windows
  • pr-242-1f79720ca99c4564a381937638cb63170e051af4-electron-linux

Ensure native desktop terminal status handling raises onError only once per terminal sequence, including stopped events after terminal failures.

Trim leading fragment markers from CODENOMAD_UI_LAUNCH_QUERY before appending launch query values, and add focused TypeScript and Rust tests for the regressions.
@github-actions

github-actions Bot commented Jun 6, 2026

Copy link
Copy Markdown

PR builds are available as GitHub Actions artifacts:

https://github.com/NeuralNomadsAI/CodeNomad/actions/runs/27063308174

Artifacts expire in 7 days.
Artifacts:

  • pr-242-30076576e83c77087447eee5c3d5e2c822abf192-electron-macos
  • pr-242-30076576e83c77087447eee5c3d5e2c822abf192-tauri-macos
  • pr-242-30076576e83c77087447eee5c3d5e2c822abf192-tauri-windows
  • pr-242-30076576e83c77087447eee5c3d5e2c822abf192-tauri-linux
  • pr-242-30076576e83c77087447eee5c3d5e2c822abf192-tauri-macos-arm64
  • pr-242-30076576e83c77087447eee5c3d5e2c822abf192-electron-windows
  • pr-242-30076576e83c77087447eee5c3d5e2c822abf192-electron-linux

@github-actions

github-actions Bot commented Jun 6, 2026

Copy link
Copy Markdown

PR builds are available as GitHub Actions artifacts:

https://github.com/NeuralNomadsAI/CodeNomad/actions/runs/27073608700

Artifacts expire in 7 days.
Artifacts:

  • pr-242-4878fe8893e8abff3a4be8b3345bcc9266c15b08-tauri-macos-arm64
  • pr-242-4878fe8893e8abff3a4be8b3345bcc9266c15b08-electron-macos
  • pr-242-4878fe8893e8abff3a4be8b3345bcc9266c15b08-tauri-linux
  • pr-242-4878fe8893e8abff3a4be8b3345bcc9266c15b08-tauri-macos
  • pr-242-4878fe8893e8abff3a4be8b3345bcc9266c15b08-tauri-windows
  • pr-242-4878fe8893e8abff3a4be8b3345bcc9266c15b08-electron-windows
  • pr-242-4878fe8893e8abff3a4be8b3345bcc9266c15b08-electron-linux

Refresh the PR242 native desktop event transport branch onto the current upstream/dev head in a clean isolated worktree and keep the existing Tauri-only native transport behavior intact. Preserve the browser and Electron EventSource path while taking upstream's session list, permission, and question transport updates.

Resolve the only textual merge conflict in packages/ui/src/stores/session-api.ts by keeping the branch's SnapshotFileDiff import compatibility and upstream's newer V2 session pagination/session metadata flow. Keep the merged SDK 1.16.0 dependency bump from upstream/dev so the updated V2 event and session types validate correctly.

Validation in the isolated worktree covered git diff --check, UI typecheck, UI build, tauri prebuild, and the tauri Rust test suite. nomadworks_validate was attempted but still fails with the known tool-side undefined-object error.
@pascalandr

pascalandr commented Jun 7, 2026

Copy link
Copy Markdown
Contributor Author

@shantur
ready to merge

#242 (comment)

@github-actions

github-actions Bot commented Jun 7, 2026

Copy link
Copy Markdown

PR builds are available as GitHub Actions artifacts:

https://github.com/NeuralNomadsAI/CodeNomad/actions/runs/27092927407

Artifacts expire in 7 days.
Artifacts:

  • pr-242-fc62ce21d9132953690e1ea6cdf7a40d966c9d42-tauri-macos
  • pr-242-fc62ce21d9132953690e1ea6cdf7a40d966c9d42-electron-macos
  • pr-242-fc62ce21d9132953690e1ea6cdf7a40d966c9d42-tauri-linux
  • pr-242-fc62ce21d9132953690e1ea6cdf7a40d966c9d42-tauri-windows
  • pr-242-fc62ce21d9132953690e1ea6cdf7a40d966c9d42-tauri-macos-arm64
  • pr-242-fc62ce21d9132953690e1ea6cdf7a40d966c9d42-electron-windows
  • pr-242-fc62ce21d9132953690e1ea6cdf7a40d966c9d42-electron-linux

@github-actions

github-actions Bot commented Jun 7, 2026

Copy link
Copy Markdown

PR builds are available as GitHub Actions artifacts:

https://github.com/NeuralNomadsAI/CodeNomad/actions/runs/27098053394

Artifacts expire in 7 days.
Artifacts:

  • pr-242-998d515efe5bbdf021d0682a4c75fc428a457fe6-tauri-macos
  • pr-242-998d515efe5bbdf021d0682a4c75fc428a457fe6-tauri-linux
  • pr-242-998d515efe5bbdf021d0682a4c75fc428a457fe6-tauri-macos-arm64
  • pr-242-998d515efe5bbdf021d0682a4c75fc428a457fe6-electron-macos
  • pr-242-998d515efe5bbdf021d0682a4c75fc428a457fe6-tauri-windows
  • pr-242-998d515efe5bbdf021d0682a4c75fc428a457fe6-electron-windows
  • pr-242-998d515efe5bbdf021d0682a4c75fc428a457fe6-electron-linux

@github-actions

github-actions Bot commented Jun 8, 2026

Copy link
Copy Markdown

PR builds are available as GitHub Actions artifacts:

https://github.com/NeuralNomadsAI/CodeNomad/actions/runs/27109634163

Artifacts expire in 7 days.
Artifacts:

  • pr-242-503d86f65492e61240f4dcd060d07da0dac97cef-tauri-macos
  • pr-242-503d86f65492e61240f4dcd060d07da0dac97cef-tauri-linux
  • pr-242-503d86f65492e61240f4dcd060d07da0dac97cef-tauri-windows
  • pr-242-503d86f65492e61240f4dcd060d07da0dac97cef-electron-macos
  • pr-242-503d86f65492e61240f4dcd060d07da0dac97cef-tauri-macos-arm64
  • pr-242-503d86f65492e61240f4dcd060d07da0dac97cef-electron-windows
  • pr-242-503d86f65492e61240f4dcd060d07da0dac97cef-electron-linux

@shantur

shantur commented Jun 8, 2026

Copy link
Copy Markdown
Collaborator

Potential integration issue with remote Tauri windows.

connectWorkspaceEvents currently enables the native transport whenever runtimeEnv.host === "tauri" and the local preference is enabled:

if (runtimeEnv.host === "tauri" && nativeDesktopTransportEnabled) {

That seems too broad because remote/proxy windows are also Tauri-hosted, but they are explicitly marked with window.__CODENOMAD_WINDOW_CONTEXT__ = "remote". The native Tauri command builds its stream config from the local CliProcessManager, so a remote window should not try to use desktop_events_start for its event stream.

I think this should be gated to the local desktop window only, e.g.:

if (
  runtimeEnv.host === "tauri" &&
  runtimeEnv.windowContext === "local" &&
  nativeDesktopTransportEnabled
) {

Even if current Tauri capabilities cause remote windows to fail the invoke and fall back to browser EventSource, relying on that failure path makes the behavior ambiguous and can add noisy startup/reconnect behavior. A local-window gate makes the intended routing explicit: native Rust transport for the local main desktop window, browser EventSource for remote windows.

@shantur

shantur commented Jun 8, 2026

Copy link
Copy Markdown
Collaborator

@pascalandr - Does it make sense?

Merge latest upstream/dev into PR NeuralNomadsAI#242 and resolve the remaining conflicts without broadening the desktop event transport feature. The native Rust transport now requires a Tauri host, a local window context, and the enabled preference; remote Tauri windows fall back to browser EventSource instead of invoking desktop_events_start. The server-events conflict also preserves upstream pong retry behavior while keeping the PR's transport abstraction. Validation: git diff --check and npm run typecheck --workspace @codenomad/ui.
@pascalandr

Copy link
Copy Markdown
Contributor Author

@pascalandr - Does it make sense?

yes good catch !

@shantur

shantur commented Jun 8, 2026

Copy link
Copy Markdown
Collaborator

@CodeNomadBot

Final PR check

@codenomadbot

codenomadbot Bot commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

I performed the final PR check for #242.

My understanding of the request: do a last merge-gate pass on the current branch, with special attention to the recently identified remote Tauri window routing issue and the broader multi-platform maintainability concerns from the earlier reviews.

Findings:

No blocking findings in the current PR state.

Final checks:

  • The remote Tauri window issue is addressed. packages/ui/src/lib/event-transport.ts:45-49 now requires runtimeEnv.windowContext === "local" before attempting the native Rust transport, and packages/ui/src/lib/event-transport.ts:60-61 explicitly forces remote Tauri windows to browser EventSource.
  • The Tauri window-context split is explicit on the native side: the main window receives window.__CODENOMAD_WINDOW_CONTEXT__ = 'local', while remote windows are created with REMOTE_WINDOW_CONTEXT_SCRIPT in packages/tauri-app/src-tauri/src/main.rs:341-347.
  • Browser and Electron remain on the existing browser EventSource path; the native path is still Tauri-only and now local-window-only.
  • The device-local fallback remains localStorage-backed and does not flow through shared config: packages/ui/src/lib/desktop-event-transport-preference.ts:3-24 plus packages/ui/src/stores/preferences.tsx:395-397,446-460.
  • The previous stale async connect failure issue remains fixed. packages/ui/src/lib/server-events.ts:86-94 still ignores stale failed connects before scheduling reconnect.
  • Heartbeat/auth parity remains intact in the Rust path: named ping frames are separated in packages/tauri-app/src-tauri/src/desktop_event_transport/stream.rs, and pong requests still use the cookie-attaching request path in packages/tauri-app/src-tauri/src/desktop_event_transport/transport.rs.
  • The benchmark/debug harness is not present in shipped changed source. I found no remaining references to perf242, transport-bench, perf-log, forceBrowserEvents, perf242-force-browser-events, or __TRANSPORT_TYPE.

Non-blocking polish note:

  • packages/ui/src/lib/settings/behavior-registry.ts:285-298 still registers the Tauri native transport toggle for any Tauri-hosted window, including remote Tauri windows. Since the actual transport selector now ignores the native path for remote windows, this is no longer a correctness issue, but hiding that setting behind a local-window check too would avoid presenting a no-op control in remote windows.

Validation attempted in this workspace:

  • cargo test --manifest-path packages/tauri-app/src-tauri/Cargo.toml named_ping_event_is_routed_to_ping_channel and session_cookie_is_attached_to_requests are still blocked before tests run because Tauri config points frontendDist at missing resources/ui-loading.
  • npm run typecheck --workspace @codenomad/ui is still blocked by missing installed UI dependencies/types, including solid-js, @opencode-ai/sdk, Tauri plugin types, and Node test types.
  • npm run typecheck --workspace @neuralnomads/codenomad is still blocked by missing @types/node.

Final verdict:

No objection to merge from this final review, subject to normal CI/build checks passing in the fully provisioned environment.

--
Yours,
CodeNomadBot

@shantur shantur merged commit d29dbf7 into NeuralNomadsAI:dev Jun 8, 2026
11 checks passed
@shantur

shantur commented Jun 8, 2026

Copy link
Copy Markdown
Collaborator

Thanks for the patience @pascalandr

@github-actions

github-actions Bot commented Jun 8, 2026

Copy link
Copy Markdown

PR builds are available as GitHub Actions artifacts:

https://github.com/NeuralNomadsAI/CodeNomad/actions/runs/27153763615

Artifacts expire in 7 days.
Artifacts:

  • pr-242-df1948c6b5da7a594ccb5bd1918f057c8760f011-tauri-macos
  • pr-242-df1948c6b5da7a594ccb5bd1918f057c8760f011-tauri-linux
  • pr-242-df1948c6b5da7a594ccb5bd1918f057c8760f011-tauri-windows
  • pr-242-df1948c6b5da7a594ccb5bd1918f057c8760f011-tauri-macos-arm64
  • pr-242-df1948c6b5da7a594ccb5bd1918f057c8760f011-electron-macos
  • pr-242-df1948c6b5da7a594ccb5bd1918f057c8760f011-electron-windows
  • pr-242-df1948c6b5da7a594ccb5bd1918f057c8760f011-electron-linux

shantur added a commit that referenced this pull request Jun 8, 2026
…ions, safer settings, more languages and smoother desktop performance (#534)

## Thanks for contributions

- [@pascalandr](https://github.com/pascalandr):
[#242](#242),
[#340](#340),
[#357](#357),
[#406](#406),
[#407](#407),
[#458](#458),
[#472](#472),
[#501](#501),
[#513](#513),
[#528](#528),
[#531](#531)
- [@OfflinePing](https://github.com/OfflinePing):
[#413](#413),
[#497](#497),
[#498](#498),
[#499](#499)
- [@omercnet](https://github.com/omercnet):
[#459](#459),
[#466](#466),
[#512](#512)
- [@VooDisss](https://github.com/VooDisss):
[#493](#493),
[#511](#511)
- [@JDis03](https://github.com/JDis03):
[#481](#481),
[#519](#519)
- [@bluelovers](https://github.com/bluelovers):
[#278](#278),
[#284](#284)
- [@aayurt](https://github.com/aayurt):
[#523](#523)
- [@MusiCode1](https://github.com/MusiCode1):
[#388](#388)
- [@jollyxenon](https://github.com/jollyxenon):
[#439](#439)

## Highlights

- **Provider setup is easier from the model selector**: Manage provider
authentication directly from the place where you choose models, with
provider settings scoped to the current CodeNomad instance.
- **Settings are more useful and transparent**: A new Info section shows
version, runtime, and diagnostic details, and a new global config editor
makes it easier to inspect and update CodeNomad/OpenCode configuration
without leaving the app.
- **Sessions load faster and are easier to find**: Session history now
supports progressive loading, server-side search, and stronger workspace
scoping, making large workspaces feel much more responsive.
- **Workspace names are customizable**: Give workspaces friendlier names
so multi-project and multi-instance setups are easier to recognize.
- **Desktop event handling is faster and more reliable**: Tauri desktop
builds now use a Rust-native event transport for better performance and
fewer moving parts during live session updates.
- **More languages are available**: German and Nepali localization
support was added, and Hebrew translation coverage was improved.

## What’s Improved

- **Better chat readability**: Pasted text can collapse in chat history,
session titles now appear in the header bar, and message timing metrics
make it easier to understand how long responses take.
- **More flexible composer experience**: The session composer can now be
resized, making long prompts and detailed instructions easier to work
with.
- **Safer environment variable editing**: Environment variable values
are hidden and password-style inputs are masked, reducing the chance of
exposing sensitive values on screen.
- **Better permission feedback**: Permission requests now show clearer
rejection feedback, and YOLO mode behavior is shared more consistently
across related session flows.
- **More helpful notifications and logs**: Toast notification history
and server log access were improved so important events are easier to
revisit after they disappear.
- **Cleaner status panels**: Status panel sections can now collapse,
making dense side-panel information easier to scan.
- **Smaller desktop packages**: Electron package size was reduced,
making downloads and installs lighter.

## Fixes

- **More reliable live updates**: SSE pong retry logic and message-load
retry handling were tightened to avoid connection issues and runaway
retry loops.
- **Smoother scrolling while sessions stream**: Virtual
follow/autoscroll behavior is more stable, so active conversations
should jump around less while new content arrives.
- **Better OpenCode SDK compatibility**: CodeNomad now supports OpenCode
SDK 1.16 runtime APIs.
- **More reliable worktree behavior**: Worktree mappings now live in
session metadata, and OpenCode calls are routed through workspaces more
consistently.
- **Better draft prompt handling**: Draft prompt command sessions are
supported more reliably, and switching focus between tabs no longer
accidentally clears prompts.
- **Improved mobile usability**: Instance and project tabs remain
tappable while the session drawer is open, and the folder home screen
behaves better on small mobile viewports.
- **Improved Linux browser launching**: Linux browser launch detection
now checks more common browser candidates.
- **Better plugin handling**: Plugin base URLs work better with host
binding, and tuple-style plugin metadata is supported.
- **Markdown rendering polish**: Horizontal rules now render correctly
in markdown content.
- **Simpler session diff UI**: The session diff right-drawer flow was
removed to reduce UI complexity and avoid confusing side-panel behavior.

## Docs

- **Contributor architecture guide added**: A CodeNomad architecture
guide skill was added to help contributors understand the project
structure and key integration patterns.
- **Quick-start guidance improved**: Authentication requirements and
self-signed certificate warnings were added to the quick-start docs.
- **Release automation documented**: Winget release automation docs and
workflow support were added.

### Contributors

- [@shantur](https://github.com/shantur)
- [@pascalandr](https://github.com/pascalandr)
- [@OfflinePing](https://github.com/OfflinePing)
- [@omercnet](https://github.com/omercnet)
- [@JDis03](https://github.com/JDis03)
- [@VooDisss](https://github.com/VooDisss)
- [@bluelovers](https://github.com/bluelovers)
- [@aayurt](https://github.com/aayurt)
- [@MusiCode1](https://github.com/MusiCode1)
- [@jollyxenon](https://github.com/jollyxenon)

**Full Changelog**:
[v0.16.0...v0.17.0](v0.16.0...v0.17.0)

## Merged Pull Requests

### [@shantur](https://github.com/shantur)

- PR [#446](#446)
“fix(ui): support draft prompt command sessions”
- PR [#452](#452)
“fix(ui): keep home actions visible on short viewports”
- PR [#453](#453)
“Reduce Electron package size”
- PR [#476](#476)
“feat(ui): add instance-scoped provider manager from model selector”
- PR [#477](#477) “Add
global config file editor”
- PR [#514](#514)
“Migrate worktree mappings to session metadata”
- PR [#521](#521)
“fix(worktrees): route OpenCode calls through workspaces”
- PR [#522](#522)
“feat(ui): support custom workspace names”
- PR [#526](#526)
“Support OpenCode SDK 1.16 runtime APIs”
- PR [#529](#529)
“fix(ui): stop message load retry loop”
- PR [#532](#532)
“fix(ui): remove session diff right drawer flow”

### [@pascalandr](https://github.com/pascalandr)

- PR [#242](#242)
“perf(tauri): Rust-native desktop event transport”
- PR [#340](#340)
“feat(ui): show the session title in the header bar”
- PR [#357](#357)
“feat(ui): add message timing metrics”
- PR [#406](#406)
“fix(ui): stabilize virtual follow autoscroll”
- PR [#407](#407)
“feat(ui): collapse pasted text in chat history”
- PR [#458](#458)
“fix(ui): allow status panel sections to collapse”
- PR [#472](#472)
“revert: remove tracked NomadWorks repo state”
- PR [#501](#501)
“fix(ui): support tuple plugin metadata”
- PR [#513](#513)
“chore: TASK-075 automate Winget updates on release”
- PR [#528](#528)
“fix(ui): scope primary agent selector to selectable agents”
- PR [#531](#531)
“revert: remove tracked NomadWorks task artifacts”

### [@OfflinePing](https://github.com/OfflinePing)

- PR [#413](#413)
“feat(settings): add Info section with version, runtime, and
diagnostics”
- PR [#497](#497) “Share
YOLO mode across session families”
- PR [#498](#498)
“fix(ui): render markdown horizontal rules”
- PR [#499](#499) “Add
reject feedback to permission UI”

### [@omercnet](https://github.com/omercnet)

- PR [#459](#459)
“fix(mobile): tappable instance/project tab bar while session drawer is
open”
- PR [#466](#466) “ci:
increase comment-pr-artifacts polling timeout”
- PR [#512](#512) “fix:
handle plugin base URL for host binding”

### [@VooDisss](https://github.com/VooDisss)

- PR [#493](#493) “feat:
add CodeNomad architecture guide skill for contributors”
- PR [#511](#511)
“feat(sessions): progressive loading, server-side search, and workspace
scoping”

### [@JDis03](https://github.com/JDis03)

- PR [#481](#481) “docs:
add auth requirement and self-signed cert warning to quick-start”
- PR [#519](#519)
“fix(ui): add retry logic to SSE pong to improve connection resilience”

### [@bluelovers](https://github.com/bluelovers)

- PR [#278](#278)
“feat(ui): Toast Notification History & Server Logs Enhancements”
- PR [#284](#284)
“fix(ui): hide environment variable values and mask inputs as password”

### [@aayurt](https://github.com/aayurt)

- PR [#523](#523) “Add
German and Nepali Localizations”

### [@MusiCode1](https://github.com/MusiCode1)

- PR [#388](#388)
“Update Hebrew translation coverage”

### [@jollyxenon](https://github.com/jollyxenon)

- PR [#439](#439)
“feat(ui): add resizable session composer”
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants