osborn 0.9.79 → 0.9.80
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.
- package/dist/index.js +30 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1361,6 +1361,36 @@ async function main() {
|
|
|
1361
1361
|
console.error('🧟 [ZOMBIE-WATCHDOG] poll error:', err instanceof Error ? err.message : err);
|
|
1362
1362
|
}
|
|
1363
1363
|
}, WATCHDOG_POLL_MS);
|
|
1364
|
+
// ── 0.9.80: Event-loss adopter (poll-based) ──
|
|
1365
|
+
// After a leave/rejoin cycle the same Room instance can stop delivering
|
|
1366
|
+
// ParticipantConnected entirely — observed 2026-07-28: the leave-room guard
|
|
1367
|
+
// saw "1 participant(s) still in room" while the agent sat at "Waiting for
|
|
1368
|
+
// user to connect" (state knew, events never fired; user stuck on
|
|
1369
|
+
// "Connecting..." forever). Same blind-spot family as the zombie watchdog:
|
|
1370
|
+
// never trust the event stream alone. Every 5s: participant present but no
|
|
1371
|
+
// voice session → re-emit ParticipantConnected (60s per-identity cooldown
|
|
1372
|
+
// so a slow in-flight session creation isn't double-fired).
|
|
1373
|
+
const adoptAttempts = new Map();
|
|
1374
|
+
setInterval(() => {
|
|
1375
|
+
try {
|
|
1376
|
+
if (livekitState.status !== 'connected')
|
|
1377
|
+
return;
|
|
1378
|
+
if (currentSession)
|
|
1379
|
+
return;
|
|
1380
|
+
const p = room.remoteParticipants.values().next().value;
|
|
1381
|
+
if (!p)
|
|
1382
|
+
return;
|
|
1383
|
+
const last = adoptAttempts.get(p.identity) ?? 0;
|
|
1384
|
+
if (Date.now() - last < 60_000)
|
|
1385
|
+
return;
|
|
1386
|
+
adoptAttempts.set(p.identity, Date.now());
|
|
1387
|
+
console.log(`📥 [ADOPT-POLL] ${p.identity} present with no session — re-emitting ParticipantConnected`);
|
|
1388
|
+
room.emit(RoomEvent.ParticipantConnected, p);
|
|
1389
|
+
}
|
|
1390
|
+
catch (err) {
|
|
1391
|
+
console.error('📥 [ADOPT-POLL] error:', err instanceof Error ? err.message : err);
|
|
1392
|
+
}
|
|
1393
|
+
}, 5_000);
|
|
1364
1394
|
/**
|
|
1365
1395
|
* Hard-kill the in-flight Claude SDK query AND the persistent subprocess.
|
|
1366
1396
|
*
|