emrg: gui — restore window.emrg.init() wiring (fix v0.2.81 GUI disconnect) + drop batch0Notice badge - #1036
Conversation
…nect) + drop batch0Notice badge (rant 2026-08-27T10:53:38)
argszero
left a comment
There was a problem hiding this comment.
✅ LGTM 1/3 — cycle 2026-08-27T11:23:45. Independent re-verification: head unchanged (85d350f), CI run 33035821650 green (test + test-windows), MERGEABLE/CLEAN. Fixes the v0.2.81 GUI disconnect (rant 2026-08-27T10:53:38): restores window.emrg.init() wiring in DaemonBridgeProvider via InitResult + applyInit (connected only when config_exists && api_key_configured), drops the batch0Notice migration badge + orphan i18n keys. Renderer vitest 444 (+3 init-fusion tests), tsc clean, build OK, doc-count guard 4/4.
how2how2how2-arch
commented
Aug 27, 2026
I tested this PR (checked out
One note (not blocking): the This closes a real v0.2.81 regression — thanks for the fast fix. |
argszero
left a comment
There was a problem hiding this comment.
✅ LGTM 2/3 — cycle 2026-08-27T11:30:45. Independent re-verification: head unchanged (85d350f), CI run 33035821650 green (test + test-windows), MERGEABLE/CLEAN. Init-wiring fix confirmed sound (InitResult + applyInit merged into store, connected only when config_exists && api_key_configured); guarded by the new #1037 boot-contract test so future refactors cannot silently drop renderer init. No new feedback since 1/3 (112344).
…+1 Shell=442, +3 init tests → 445)
argszero
commented
Aug 27, 2026
Maintainer push: resolved the Agent.md renderer count conflict after #1035 merged (Shell 23→24). Merged master and bumped the documented count to 445 (442 base + 3 new init tests: daemonBridge 12→14, DaemonBridgeProvider 6→7). Renderer vitest verified at 445 on the merged tree. CI will re-run via the synchronize event. |
argszero
left a comment
There was a problem hiding this comment.
✅ LGTM 3/3 — cycle 2026-08-27T11:55:49. Independent re-verification at current head 7c350d2: head matches CI run 33036815238 (test + test-windows both pass, MERGEABLE/CLEAN). Re-read the full diff: DaemonBridgeProvider now calls window.emrg.init() on mount and applyInit merges the result into the bridge store; connected is gated on config_exists && api_key_configured — a faithful port of the vanilla boot semantics in app.js. Graceful degradation is correct (no window.emrg / init rejection → connected stays false, banner shown, no crash). This restores the renderer init obligation that Batch 5 dropped, closing the v0.2.81 disconnect (rant 2026-08-27T10:53:38). Additional robustness: the #1037 static boot-contract guard now protects the main.js/preload side so future refactors cannot silently drop renderer init. No new feedback since 1/3 (112344) and 2/3 (113045).
Uh oh!
There was an error while loading. Please reload this page.
… boot-contract; renderer stays 445 from argszero#1036)
…v0.2.81 regression point) (#1042) Static-guard the renderer side of the boot chain (DaemonBridgeProvider must call window.emrg.init() on mount and fuse the result via bridge.applyInit, and App.tsx must mount the provider). v0.2.81 disconnected because the React migration dropped the init() call; #1036 added runtime coverage, this adds cheap static pinning so the regression point turns red even if the runtime test is removed or the mount path is bypassed. GUI tests 92 -> 93, Agent.md synced. Co-authored-by: argszero <argszero@gmail.com>
Summary
Fixes the v0.2.81 GUI disconnect bug (rant 2026-08-27T10:53:38): the React migration (Batch 5) dropped the
window.emrg.init()call, so the GUI main process never connected to the daemon.Root cause
app.jsboot()calledwindow.emrg.init()and used the return value to initialize config/sessions/open_sessions/model/connected.DaemonBridgeProvideronly subscribed towindow.emrg.onEventand wiredsendMessage— it never calledwindow.emrg.init().main.js'sensureConnected()(the only path to the daemon websocket) is only triggered fromemrg:init(line 296),saveSettings(903), andscheduleReconnect(1170). With no init call,ensureConnected()never ran → GUI never established the daemon connection →status {connected:true}was never broadcast → the UI stayed permanently disconnected.batch0Notice"migration in progress" badge remained in the Shell header.Changes
lib/daemonBridge.ts— addInitResulttype,init?()toDaemonBridgeDeps.emrg, andapplyInit()on the bridge.applyInitmergesconnected(true only whenconfig_exists && api_key_configured),serverId,model,evolutionCount,currentVersion,sessions, andopenSessionsinto the store (matching vanilla boot semantics).components/DaemonBridgeProvider.tsx— callwindow.emrg.init()on mount andapplyInitthe result; degraded-path fallback (env withoutwindow.emrg) returns{}and keepsconnected=false.components/Shell.tsx— remove thebatch0Noticemigration badge (no longer renders it).lib/i18n.tsx— drop the now-unusedshell.batch0Notice/shell.placeholderkeys.daemonBridge.test.ts(+2),DaemonBridgeProvider.test.tsx(+1),App.test.tsx(assert badge gone).Verification
tsc --noEmit: cleanvite build: success (renderer/dist)init)Ships in the next release (v0.2.82).