@volter/supercode-teams 0.3.93 → 0.3.94
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/live-sessions.mjs +5 -0
- package/machine-records.mjs +6 -2
- package/package.json +1 -1
package/live-sessions.mjs
CHANGED
|
@@ -433,6 +433,11 @@ export class LiveSessions extends EventEmitter {
|
|
|
433
433
|
codexForget() {
|
|
434
434
|
if (!this.codexIndexRead && !this.codexKnown) return;
|
|
435
435
|
this.codexIndexRead = false; this.codexKnown = false; this.codexWaitedOut = false; this.startedAt = Date.now();
|
|
436
|
+
// what the ended serve said is not kept as what is true now: a Codex session that ended in the gap would be filed for
|
|
437
|
+
// a door it no longer has; until serve answers anew, a Codex session is not known yet (a send to it waits)
|
|
438
|
+
const had = this.codexRunning.size + this.codexPaneOf.size;
|
|
439
|
+
this.codexRunning.clear(); this.codexPaneOf = new Map();
|
|
440
|
+
if (had) this.#changed();
|
|
436
441
|
}
|
|
437
442
|
|
|
438
443
|
/** The session index's first answer is read: its Codex sessions' activity is followed next (even when it has none). */
|
package/machine-records.mjs
CHANGED
|
@@ -21,6 +21,8 @@ const MIN_READ_MS = 2000;
|
|
|
21
21
|
export const BEAT_MS = 15_000;
|
|
22
22
|
export const STALE_MS = 45_000;
|
|
23
23
|
const backoff = (previous) => Math.min(300_000, Math.max(2000, (previous || 1000) * 2));
|
|
24
|
+
/** How often a machine whose daemon is too old to serve records is asked again (its update is what answers it). */
|
|
25
|
+
const TOO_OLD_RETRY_MS = 600_000;
|
|
24
26
|
|
|
25
27
|
/**
|
|
26
28
|
* The producer: `readers[section](detail)` reads one section (async), `detail` naming what changed when the event knows
|
|
@@ -231,8 +233,10 @@ export class RecordHolder {
|
|
|
231
233
|
held.attempt = null;
|
|
232
234
|
Object.assign(held, { stream: null, state, since: Date.now(), why: String(why ?? 'the stream closed').slice(0, 300) });
|
|
233
235
|
try { stream?.close?.(); } catch { /* closing */ }
|
|
234
|
-
// opened again after a backoff, 2 s doubling to 5 min: an obligation of this machine, never a sweep
|
|
235
|
-
|
|
236
|
+
// opened again after a backoff, 2 s doubling to 5 min: an obligation of this machine, never a sweep. A daemon too
|
|
237
|
+
// old to serve records is asked again every TOO_OLD_RETRY_MS: only its update answers it (asked every 8-16 s, it
|
|
238
|
+
// filled the log)
|
|
239
|
+
held.backoff = state === 'too-old' ? TOO_OLD_RETRY_MS : backoff(held.backoff);
|
|
236
240
|
if (this.closed) return;
|
|
237
241
|
held.retry = setTimeout(() => { held.retry = null; if ((held.state === 'closed' || held.state === 'too-old') && !this.closed) this.subscribe(machine); }, held.backoff);
|
|
238
242
|
held.retry.unref?.();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@volter/supercode-teams",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.94",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "A machine daemon serving this machine's doors, and a local or remote Teams server for shared session discovery, OpenTelemetry ingestion and access to enrolled machines.",
|
|
6
6
|
"license": "MIT",
|