diff options
Diffstat (limited to 'modules/core/module-aiassist.js')
| -rw-r--r-- | modules/core/module-aiassist.js | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/modules/core/module-aiassist.js b/modules/core/module-aiassist.js index 628e68a..3326483 100644 --- a/modules/core/module-aiassist.js +++ b/modules/core/module-aiassist.js @@ -4641,12 +4641,13 @@ buildSystemPrompt() { } // System health - var totalErrors = 0; + var errCounts = { total: 0, debug: 0, latency: 0, log: 0 }; try { - var ds = mm ? mm.modules['DebugSupervisorModule'] : null; - if (ds && ds._errorDB) totalErrors += Object.keys(ds._errorDB.errors).length; - if (sm && sm._latencyLog) totalErrors += sm._latencyLog.filter(function(e) { return e.error; }).length; + if (this.terminal && typeof this.terminal.countErrors === 'function') { + errCounts = this.terminal.countErrors(); + } } catch (e) {} + var totalErrors = errCounts.total; var predictor = mm ? mm.modules['PredictorModule'] : null; var predictorAcc = 'n/a (no paired runs)'; if (predictor && predictor._accuracy && predictor._accuracy.total > 0) { @@ -4658,6 +4659,7 @@ buildSystemPrompt() { vfsSize: data.vfs ? data.vfs.size : '?', online: typeof navigator !== 'undefined' ? navigator.onLine : true, errors: totalErrors, + errorBreakdown: errCounts, predictorAccuracy: predictorAcc }; |