perf(tauri): Rust-native desktop event transport#242
Conversation
|
PR builds are available as GitHub Actions artifacts: https://github.com/NeuralNomadsAI/CodeNomad/actions/runs/23398482721 Artifacts expire in 7 days. |
|
PR builds are available as GitHub Actions artifacts: https://github.com/NeuralNomadsAI/CodeNomad/actions/runs/23398502150 Artifacts expire in 7 days. |
|
PR builds are available as GitHub Actions artifacts: https://github.com/NeuralNomadsAI/CodeNomad/actions/runs/23399446411 Artifacts expire in 7 days. |
|
PR builds are available as GitHub Actions artifacts: https://github.com/NeuralNomadsAI/CodeNomad/actions/runs/23401824896 Artifacts expire in 7 days.
|
|
PR builds are available as GitHub Actions artifacts: https://github.com/NeuralNomadsAI/CodeNomad/actions/runs/23402541285 Artifacts expire in 7 days. |
|
PR builds are available as GitHub Actions artifacts: https://github.com/NeuralNomadsAI/CodeNomad/actions/runs/23410012218 Artifacts expire in 7 days.
|
5f572c2 to
4448dd0
Compare
74ec719 to
302e87f
Compare
|
I’d be happy to get a critical review on whether this direction makes sense upstream. |
|
Hey @pascalandr , How does this Tauri specific change effect electron and server UI? |
|
I want you to perform the gatekeeper checks for latest PR state check for regressions |
Only commit 1 is Tauri-specific. 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. |
|
Am I correct in understanding that each platform will be using their native EventSource path? |
|
In this PR:
So only the Tauri transport changes here. The UI-side streaming optimizations are host-agnostic and sit below that transport choice. |
|
@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.
Would you help me decide these please? |
|
I see but TBH, the Rust/Tauri transport is the part I cared about most, because I use the Tauri client all day long. |
|
I want you to perform the gatekeeper checks for latest PR state check for regressions
|
|
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:
Knock-on effects by host:
Better implementation direction:
Validation notes:
Gatekeeper verdict: not merge-ready. Both findings above are blocking regressions, and one of them hits Electron/server directly. -- |
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
I will need some time to work out what needs to be done for cases like this. I hope you understand. |
|
When you says not have to test multiple "platforms" do you mean Tauri / Electron or Windows/linux/Macos ? |
|
@pascalandr - Sorry I missed your comment. Multiple platforms = Tauri and Electron on different OSes ( Windows, MacOS and Linux ) |
|
PR builds are available as GitHub Actions artifacts: https://github.com/NeuralNomadsAI/CodeNomad/actions/runs/26031049985 Artifacts expire in 7 days.
|
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.
|
PR builds are available as GitHub Actions artifacts: https://github.com/NeuralNomadsAI/CodeNomad/actions/runs/27046140287 Artifacts expire in 7 days.
|
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.
|
PR builds are available as GitHub Actions artifacts: https://github.com/NeuralNomadsAI/CodeNomad/actions/runs/27059209589 Artifacts expire in 7 days.
|
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.
|
PR builds are available as GitHub Actions artifacts: https://github.com/NeuralNomadsAI/CodeNomad/actions/runs/27063308174 Artifacts expire in 7 days.
|
|
PR builds are available as GitHub Actions artifacts: https://github.com/NeuralNomadsAI/CodeNomad/actions/runs/27073608700 Artifacts expire in 7 days.
|
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.
|
@shantur |
|
PR builds are available as GitHub Actions artifacts: https://github.com/NeuralNomadsAI/CodeNomad/actions/runs/27092927407 Artifacts expire in 7 days.
|
|
PR builds are available as GitHub Actions artifacts: https://github.com/NeuralNomadsAI/CodeNomad/actions/runs/27098053394 Artifacts expire in 7 days.
|
|
PR builds are available as GitHub Actions artifacts: https://github.com/NeuralNomadsAI/CodeNomad/actions/runs/27109634163 Artifacts expire in 7 days.
|
|
Potential integration issue with remote Tauri windows.
if (runtimeEnv.host === "tauri" && nativeDesktopTransportEnabled) {That seems too broad because remote/proxy windows are also Tauri-hosted, but they are explicitly marked with 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 |
|
@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.
yes good catch ! |
|
Final PR check |
|
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:
Non-blocking polish note:
Validation attempted in this workspace:
Final verdict: No objection to merge from this final review, subject to normal CI/build checks passing in the fully provisioned environment. -- |
|
Thanks for the patience @pascalandr |
|
PR builds are available as GitHub Actions artifacts: https://github.com/NeuralNomadsAI/CodeNomad/actions/runs/27153763615 Artifacts expire in 7 days.
|
…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”
Summary
EventSourcepath to a native Rust desktop event transport while leaving browser and Electron unchangedevent:frames and replying tocodenomad.client.pingwith an authenticated/api/client-connections/pongEventSourcetransport without leaking that choice through shared configBenchmark
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:
D:\CodeNomadses_21feb15b3ffeLz3uRModK4KKnGShort command:
node -e "for (let i = 1; i <= 400; i += 1) console.log('line ' + i)"Results:
EventSourceforced in Tauri:131479.7mssawWorking=falsereachedIdle=falsebatchesReceived=84eventsReceived=84maxBatchSize=11437.4mssawWorking=truereachedIdle=truebatchesReceived=4eventsReceived=45maxBatchSize=27Long heartbeat / stale-timeout validation:
powershell -NoProfile -Command Start-Sleep -Seconds 7071689.5mssawWorking=truereachedIdle=truebatchesReceived=13eventsReceived=72maxBatchSize=25Confirmed separately afterward: the native transport also behaves better on Linux.
Validation
cargo test named_ping_event_is_routed_to_ping_channelcargo test session_cookie_is_attached_to_requestscargo test --no-runnpx tsc --noEmit --pretty -p packages/ui/tsconfig.jsonnpx tsc --noEmit --pretty -p packages/server/tsconfig.jsonNotes
EventSourcepath