thinkpool-pair 0.7.89 → 0.7.91
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/bridge.mjs +1 -1
- package/event-id.mjs +13 -3
- package/package.json +1 -1
package/bridge.mjs
CHANGED
|
@@ -579,7 +579,7 @@ const announce = () =>
|
|
|
579
579
|
// the chosen label instead of defaulting to Normal / unnamed. `spawned` (set
|
|
580
580
|
// when an agent Dispatched this lane via spawn_terminal) lets the client keep
|
|
581
581
|
// it OUT of the top tab strip and show it only in the Ensemble menu.
|
|
582
|
-
...[...sessions.entries()].map(([id, s]) => ({ id, cmd: s.cmd, kind: 'structured', alive: true, commands: s.commands, mode: s.mode || undefined, name: termNames[id] || undefined, ...(s.spawnedBy ? { spawned: true } : {}) })),
|
|
582
|
+
...[...sessions.entries()].map(([id, s]) => ({ id, cmd: s.cmd, kind: 'structured', alive: true, commands: s.commands, mode: s.mode || undefined, name: termNames[id] || undefined, ...(s.spawnedBy ? { spawned: true, spawnedBy: s.spawnedBy } : {}) })),
|
|
583
583
|
],
|
|
584
584
|
})
|
|
585
585
|
|
package/event-id.mjs
CHANGED
|
@@ -98,10 +98,20 @@ export function capReplayEvents(events, budget = REPLAY_BYTE_BUDGET) {
|
|
|
98
98
|
// no event in the recent window is lost (capReplayEvents truncates; this doesn't). Each
|
|
99
99
|
// returned chunk is broadcast as its own `code-replay` — seqDedup.classifyReplay applies
|
|
100
100
|
// them in order (each chunk is contiguous and seq > seqHi), so the client rebuilds the
|
|
101
|
-
// whole window across frames. We keep the MOST RECENT `maxChunks * budget` bytes
|
|
102
|
-
//
|
|
101
|
+
// whole window across frames. We keep the MOST RECENT `maxChunks * budget` bytes.
|
|
102
|
+
//
|
|
103
|
+
// 6 → 14 (2026-06-29): 6 chunks = 900KB, but a real session's full log routinely
|
|
104
|
+
// exceeds that (measured: a forge thread = 1.0MB / 7 chunks, a maxed 2000-event
|
|
105
|
+
// lane = 1.7MB / 12 chunks), so the OLDEST turns — incl. the user's first prompt —
|
|
106
|
+
// were dropped on replay and never reached the client ("not seeing full history of
|
|
107
|
+
// terminal N", Max 2026-06-29). The DB transcript snapshot can't cover the gap: it's
|
|
108
|
+
// capped at 200 tx events AND the client can only persist what it received, so the
|
|
109
|
+
// head only ever lived in this in-memory log. The bridge already hard-caps the log at
|
|
110
|
+
// STRUCTURED_LOG_MAX (2000) events ≈ 2.1MB worst case, so 14 chunks (2.1MB) sends the
|
|
111
|
+
// WHOLE retained log on a fresh (cursor-0) replay — chunkReplayEvents still only emits
|
|
112
|
+
// as many chunks as the log needs, so small sessions are unaffected.
|
|
103
113
|
// Returns an array of event-arrays, oldest chunk first; [] when there's nothing to send.
|
|
104
|
-
export const REPLAY_MAX_CHUNKS =
|
|
114
|
+
export const REPLAY_MAX_CHUNKS = 14
|
|
105
115
|
export function chunkReplayEvents(events, budget = REPLAY_BYTE_BUDGET, maxChunks = REPLAY_MAX_CHUNKS) {
|
|
106
116
|
if (!Array.isArray(events) || events.length === 0) return []
|
|
107
117
|
// Walk newest→oldest accumulating into the current chunk; start a new chunk when the
|