From 8dd236e7a03b3cfe3cfb4a0d77b62ce112e4d418 Mon Sep 17 00:00:00 2001 From: Agando Date: Thu, 22 Oct 2026 01:23:47 +0200 Subject: fix(newos4): dashboard shows the real world model and stops dying after 10 s (v4.6.51) Two defects, both verified live before/after: 1. The World Model panel always said "Not synthesized yet". The page had a renderer for data.worldModel and _collectDashboardData() never set it -- the model was right there in WorldModelModule._model. Now collected and mapped to the renderer's exact keys (model has modules.loaded/skills.count/memory.nodes, the page reads modules/skills/memoryNodes), plus changesSinceLastSnapshot and the recent-error sample, with an honest "not synthesized" fallback. 2. The page discarded any payload older than 10 s and its own 5 s auto-refresh then showed "Cannot connect to newOS4". Stale payloads are now rendered with their age ("Data as of 1:20:14 AM - 3m ago"), labelled amber past 5 min. Also: the Refresh button wrote a localStorage key nobody read -> the terminal now listens for it and re-collects (page says "No terminal tab answered" when no terminal tab is open); storage events repaint instantly; the dead /api/dashboard fetch (404 on all three paths, 5 s stall) is gone; `dashboard --watch` / `--stop` re-collects every 5 s; header says the data is this browser's instance. Verified v4.6.51: panel rows "Synthesized 34s ago / v4.6.51 / 46-22 / 136-3 / 1 nodes 0 edges / OK / none recorded"; 130 s-old payload still renders with "- 3m ago" and no banner (previously "Cannot connect"); storage event moves the footer 13s -> 0s; watch timer advances the payload, --stop clears it; mobile 360/390 px all OK; 0 console errors. --- modules/core/module-aiassist.js | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) (limited to 'modules/core/module-aiassist.js') diff --git a/modules/core/module-aiassist.js b/modules/core/module-aiassist.js index a8c0ae1..abbe9ce 100644 --- a/modules/core/module-aiassist.js +++ b/modules/core/module-aiassist.js @@ -4632,6 +4632,37 @@ buildSystemPrompt() { predictorAccuracy: predictorAcc }; + // 2026-10-22: the panel had a renderer and no collector, so it always said + // "Not synthesized yet" while WorldModelModule._model was right there. + // Map the model shape (modules.loaded, skills.count, files.total, memory.nodes…) + // onto the keys the page reads (modules, skills, files, memoryNodes…). + try { + var wm = mm ? mm.modules['WorldModelModule'] : null; + var wmModel = wm && wm._model; + if (wmModel) { + data.worldModel = { + synthesized: wmModel.synthesized || null, + version: wmModel.version || '?', + modules: wmModel.modules ? wmModel.modules.loaded : null, + skills: wmModel.skills ? wmModel.skills.count : null, + files: wmModel.files ? wmModel.files.total : null, + agents: wmModel.agents ? wmModel.agents.agents : null, + memoryNodes: wmModel.memory ? wmModel.memory.nodes : null, + memoryEdges: wmModel.memory ? wmModel.memory.edges : null, + health: wmModel.system ? wmModel.system.health : null, + activeProjects: ((wmModel.projects && wmModel.projects.activeProjects) || []) + .map(function (p) { return p.name + ' (' + p.accesses + 'x)'; }), + recent: (wmModel.recent || []).slice(0, 5), + changes: (typeof wm._diffSincePrev === 'function') ? wm._diffSincePrev() : [], + errors: (typeof wm._errorSample === 'function') ? wm._errorSample() : [] + }; + } else { + data.worldModel = { missing: true }; + } + } catch (e) { + data.worldModel = { missing: true, error: e.message }; + } + data.timestamp = Date.now(); // Write to localStorage for the dashboard HTML page to read -- cgit v1.2.3