osborn 0.9.261 โ†’ 0.9.262

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -241,6 +241,13 @@ export declare class ClaudeLLM extends llm.LLM {
241
241
  * Call this when starting a new session
242
242
  */
243
243
  clearCheckpoints(): void;
244
+ /**
245
+ * MEMORY-LEAK HUNT (0.9.262): sizes of every long-lived internal structure,
246
+ * logged by the periodic [MEM] probe in index.ts. Over a long heavy session,
247
+ * whichever counter climbs in lockstep with heapUsed is the retainer behind
248
+ * the heap-OOM crashes (11x since 2026-10-02). Read-only โ€” no behavior change.
249
+ */
250
+ getMemDebug(): Record<string, number>;
244
251
  /**
245
252
  * Check if checkpoints are available
246
253
  */
@@ -1437,6 +1437,24 @@ export class ClaudeLLM extends llm.LLM {
1437
1437
  this.#latestCheckpoint = null;
1438
1438
  console.log('๐Ÿงน Checkpoints cleared');
1439
1439
  }
1440
+ /**
1441
+ * MEMORY-LEAK HUNT (0.9.262): sizes of every long-lived internal structure,
1442
+ * logged by the periodic [MEM] probe in index.ts. Over a long heavy session,
1443
+ * whichever counter climbs in lockstep with heapUsed is the retainer behind
1444
+ * the heap-OOM crashes (11x since 2026-10-02). Read-only โ€” no behavior change.
1445
+ */
1446
+ getMemDebug() {
1447
+ return {
1448
+ checkpoints: this.#checkpoints.length,
1449
+ tasksById: this.#tasksById.size,
1450
+ taskIdByToolUse: this.#taskIdByToolUse.size,
1451
+ toolUseByAgentId: this.#toolUseByAgentId.size,
1452
+ typeByAgentId: this.#typeByAgentId.size,
1453
+ dispatchedFor: this.#dispatchedFor.size,
1454
+ busListeners: this.#eventEmitter.eventNames()
1455
+ .reduce((n, e) => n + this.#eventEmitter.listenerCount(e), 0),
1456
+ };
1457
+ }
1440
1458
  /**
1441
1459
  * Check if checkpoints are available
1442
1460
  */
package/dist/index.js CHANGED
@@ -2351,6 +2351,26 @@ async function main() {
2351
2351
  warmStats.reattachHits++;
2352
2352
  return llm;
2353
2353
  };
2354
+ // โ”€โ”€ MEM PROBE (leak hunt, 0.9.262) โ”€โ”€
2355
+ // The heap-OOM crashes (11x since 2026-10-02) exceed what the known small
2356
+ // leaks can retain โ€” something holds LARGE message content in the main heap.
2357
+ // Every 2 min, log heapUsed alongside the size of every suspect structure;
2358
+ // over one heavy session, whichever counter climbs in lockstep with heapUsed
2359
+ // is the retainer. heapUsed is the series that matters for the V8 limit
2360
+ // (external/arrayBuffers โ€” LiveKit audio โ€” do NOT count toward it).
2361
+ setInterval(() => {
2362
+ try {
2363
+ const m = process.memoryUsage();
2364
+ const mb = (b) => Math.round((b || 0) / 1048576);
2365
+ const s = currentLLM?.getMemDebug?.() ?? {};
2366
+ const chatCtxItems = currentAgent?.chatCtx?.items?.length ?? -1;
2367
+ const structs = Object.entries(s).map(([k, v]) => `${k}=${v}`).join(' ');
2368
+ console.log(`๐Ÿง  [MEM] heapUsed=${mb(m.heapUsed)}MB heapTotal=${mb(m.heapTotal)}MB rss=${mb(m.rss)}MB ` +
2369
+ `external=${mb(m.external)}MB arrayBuffers=${mb(m.arrayBuffers)}MB ` +
2370
+ `chatCtxItems=${chatCtxItems} slots=${slots.size} warm=${warmLLM ? 1 : 0} ${structs}`);
2371
+ }
2372
+ catch { /* probe must never break the agent */ }
2373
+ }, 120_000).unref();
2354
2374
  // โ”€โ”€ 0.9.83: Zombie-presence watchdog + event-loss adopter DELETED โ”€โ”€
2355
2375
  // Both poll-based layers existed solely to compensate for Room-reuse damage:
2356
2376
  // โ€ข zombie-watchdog: RoomEvent callbacks stopped firing after a leave/rejoin
@@ -65,6 +65,7 @@ export declare class PipelineDirectLLM extends llm.LLM {
65
65
  setAgents(a: any): void;
66
66
  setTurbo(on: boolean): void;
67
67
  prewarmResume(): void;
68
+ getMemDebug(): Record<string, number>;
68
69
  interruptAgent(): Promise<boolean>;
69
70
  abortAgent(): void;
70
71
  rewindAgent(checkpointId?: string): Promise<boolean>;
@@ -115,6 +115,8 @@ export class PipelineDirectLLM extends llm.LLM {
115
115
  // CLICK-TIME OVERLAP (0.9.258): start the resume replay early so it overlaps
116
116
  // the connect handshake. Proxied to the inner ClaudeLLM.
117
117
  prewarmResume() { this.#claudeLLM.prewarmResume(); }
118
+ // MEM probe (leak hunt, 0.9.262) โ€” proxied to the inner ClaudeLLM.
119
+ getMemDebug() { return this.#claudeLLM.getMemDebug(); }
118
120
  // Agent control โ€” proxied to ClaudeLLM for fast brain access
119
121
  async interruptAgent() { return this.#claudeLLM.interruptQuery(); }
120
122
  abortAgent() { this.#claudeLLM.abortQuery(); }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "osborn",
3
- "version": "0.9.261",
3
+ "version": "0.9.262",
4
4
  "description": "Voice AI coding assistant - local agent that connects to Osborn frontend",
5
5
  "type": "module",
6
6
  "bin": {