Commit 570ef34
authored
Startup speed, event filtering, log hygiene & reliability (#272)
* Startup speed + event filtering + memory leak fixes
- Parallelize persona initialization: batched 6-concurrent (18-36s → 3-6s)
- Parallelize PersonaUser.initialize(): genome sync, rate limiter, corpus load run concurrently
- EventsDaemonBrowser: filter-first DOM dispatch (only events with registered interest)
- Events.subscribe(): registers DOM interest automatically in browser
- BaseWidget/BaseContentWidget: register DOM interest for event dispatchers
- WidgetEventServiceBrowser: track and cleanup document listeners on disconnect
- ResponseCorrelator: periodic cleanup timer (60s sweep) + destroy() on disconnect
- JTAGClient.disconnect(): calls correlator.destroy() to stop orphaned timers
* significant logging reliabiilty and speed improvements
* UserEntityCache + reduced monitoring: eliminate 515 ORM timeouts
- UserEntityCache: in-memory TTL cache for UserEntity reads, 60s expiry
- CallerDetector: use cached reads instead of raw ORM.read per command
- SessionDaemonServer: getUserById uses cached UserEntity reads
- UserDaemonServer: monitoring loop 5s→30s, populates cache on query
- Combined with Round 1 (LogBatcher, EventRateLimiter, ORM race guards),
total errors eliminated: ~2,200 → 0 per session
* Health check exponential backoff + log throttling for failing providers
AdapterHealthMonitor: per-adapter backoff (base × 2^failures, 5min ceiling)
so unhealthy providers don't spam checks every 30s but still recover.
BaseOpenAICompatibleAdapter: throttle insufficient_funds/rate_limited logs
to once per 5 minutes per status instead of every API call.
* Log hygiene: eliminate 87% of npm-start.log noise (7596 → 936 lines)
- Remove 45+ debug console.error calls left from session identity investigation
- Raise ORM SLOW thresholds 50ms/100ms → 1000ms (5689 → 192 lines)
- Exclude fire-and-forget log/write-batch from TimingHarness slow logging
- Remove per-init console.logs: DatabaseHandleRegistry, ResourceManager,
AIAudioInjector TTS subscribe, AIGenerateServerCommand
- Steady-state log growth: continuous → 0 lines/30s
* Remove EntityScroller debug logging that spams browser console
Every entity update event was logging two console.log calls per entity,
flooding the browser console with update notifications.1 parent 21dc801 commit 570ef34
File tree
36 files changed
+569
-235
lines changed- src
- commands/ai/generate/server
- daemons
- ai-provider-daemon
- server
- data-daemon
- server
- events-daemon
- browser
- session-daemon/server
- user-daemon/server
- system
- core
- client
- server
- logging
- user/server
- modules
- voice/server
- widgets
- browser/services
- workers/continuum-core/src/modules
36 files changed
+569
-235
lines changedLines changed: 1 addition & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
41 | | - | |
42 | 41 | | |
43 | 42 | | |
44 | 43 | | |
| |||
57 | 56 | | |
58 | 57 | | |
59 | 58 | | |
60 | | - | |
61 | 59 | | |
62 | 60 | | |
63 | 61 | | |
| |||
134 | 132 | | |
135 | 133 | | |
136 | 134 | | |
137 | | - | |
138 | 135 | | |
139 | 136 | | |
140 | 137 | | |
| |||
143 | 140 | | |
144 | 141 | | |
145 | 142 | | |
146 | | - | |
147 | 143 | | |
148 | 144 | | |
149 | 145 | | |
| |||
156 | 152 | | |
157 | 153 | | |
158 | 154 | | |
159 | | - | |
160 | 155 | | |
161 | | - | |
162 | | - | |
163 | | - | |
164 | | - | |
165 | | - | |
| 156 | + | |
166 | 157 | | |
167 | | - | |
168 | 158 | | |
169 | 159 | | |
170 | 160 | | |
| |||
Lines changed: 29 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
173 | 173 | | |
174 | 174 | | |
175 | 175 | | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
176 | 195 | | |
177 | 196 | | |
178 | 197 | | |
| |||
188 | 207 | | |
189 | 208 | | |
190 | 209 | | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
191 | 213 | | |
192 | | - | |
| 214 | + | |
193 | 215 | | |
194 | 216 | | |
195 | 217 | | |
| |||
211 | 233 | | |
212 | 234 | | |
213 | 235 | | |
214 | | - | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
215 | 242 | | |
216 | 243 | | |
217 | 244 | | |
| |||
Lines changed: 11 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
151 | 151 | | |
152 | 152 | | |
153 | 153 | | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
154 | 158 | | |
155 | 159 | | |
156 | 160 | | |
| |||
731 | 735 | | |
732 | 736 | | |
733 | 737 | | |
734 | | - | |
| 738 | + | |
| 739 | + | |
| 740 | + | |
| 741 | + | |
| 742 | + | |
| 743 | + | |
| 744 | + | |
735 | 745 | | |
736 | 746 | | |
737 | 747 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
161 | 161 | | |
162 | 162 | | |
163 | 163 | | |
164 | | - | |
165 | 164 | | |
166 | 165 | | |
167 | 166 | | |
| |||
218 | 217 | | |
219 | 218 | | |
220 | 219 | | |
221 | | - | |
222 | 220 | | |
223 | 221 | | |
224 | 222 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
143 | 143 | | |
144 | 144 | | |
145 | 145 | | |
146 | | - | |
147 | 146 | | |
148 | 147 | | |
149 | 148 | | |
| |||
223 | 222 | | |
224 | 223 | | |
225 | 224 | | |
226 | | - | |
227 | | - | |
| 225 | + | |
| 226 | + | |
228 | 227 | | |
229 | 228 | | |
230 | 229 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
84 | 84 | | |
85 | 85 | | |
86 | 86 | | |
87 | | - | |
88 | | - | |
| 87 | + | |
| 88 | + | |
89 | 89 | | |
90 | 90 | | |
91 | 91 | | |
| |||
Lines changed: 59 additions & 21 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
35 | 42 | | |
36 | 43 | | |
37 | 44 | | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | 45 | | |
45 | 46 | | |
46 | 47 | | |
| |||
56 | 57 | | |
57 | 58 | | |
58 | 59 | | |
59 | | - | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
60 | 63 | | |
61 | | - | |
62 | | - | |
63 | | - | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
64 | 70 | | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
69 | 82 | | |
70 | | - | |
71 | | - | |
72 | | - | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
73 | 86 | | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
74 | 105 | | |
75 | | - | |
76 | | - | |
| 106 | + | |
77 | 107 | | |
78 | 108 | | |
79 | | - | |
80 | | - | |
| 109 | + | |
81 | 110 | | |
82 | 111 | | |
83 | 112 | | |
84 | 113 | | |
85 | 114 | | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
86 | 124 | | |
87 | 125 | | |
88 | 126 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | | - | |
21 | | - | |
22 | | - | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| |||
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
43 | | - | |
| 43 | + | |
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
| |||
63 | 63 | | |
64 | 64 | | |
65 | 65 | | |
66 | | - | |
| 66 | + | |
67 | 67 | | |
68 | 68 | | |
69 | 69 | | |
| |||
75 | 75 | | |
76 | 76 | | |
77 | 77 | | |
78 | | - | |
| 78 | + | |
79 | 79 | | |
80 | 80 | | |
81 | 81 | | |
| |||
0 commit comments