mirror of
https://github.com/NeuralNomadsAI/CodeNomad.git
synced 2026-07-10 00:14:27 +00:00
## 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
|
||
|---|---|---|
| .. | ||
| cloudflare | ||
| electron-app | ||
| opencode-plugin | ||
| server | ||
| tauri-app | ||
| ui | ||