diff options
Diffstat (limited to 'modules/core/module-world-model.js')
| -rw-r--r-- | modules/core/module-world-model.js | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/modules/core/module-world-model.js b/modules/core/module-world-model.js index 4e88f59..d48327b 100644 --- a/modules/core/module-world-model.js +++ b/modules/core/module-world-model.js @@ -257,10 +257,15 @@ class WorldModelModule { const sm = this.terminal?.moduleManager?.modules?.['ServerMonitorModule']; const ds = this.terminal?.moduleManager?.modules?.['DebugSupervisorModule']; const latencyDataPoints = sm?._latencyLog ? Object.keys(sm._latencyLog).length : 0; - const recentErrors = ds ? Object.keys(ds._errorDB?.errors || {}).length : 0; + // v4.6.59: same canonical counter as the `errors` command and the dashboard. + // Reading the debug DB alone made the world model disagree with both (packet ยง2). + const errInfo = (this.terminal && typeof this.terminal.countErrors === 'function') + ? this.terminal.countErrors() + : { total: ds ? Object.keys(ds._errorDB?.errors || {}).length : 0, debug: 0, latency: 0, log: 0 }; return { toolLatencyDataPoints: latencyDataPoints, - recentErrors: recentErrors, + recentErrors: errInfo.total, + errorsBySource: { debug: errInfo.debug, toolCalls: errInfo.latency, log: errInfo.log }, }; } catch (e) { console.warn('[WorldModel] Telemetry gather error:', e.message); |