thinkpool-pair 0.7.148 → 0.7.149
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 +15 -2
- package/package.json +1 -1
package/bridge.mjs
CHANGED
|
@@ -1840,8 +1840,21 @@ function openStructured({ id, model, resume, log, commands, mode, spawnedBy, rol
|
|
|
1840
1840
|
// mid-turn) flash a brief "Compacting…" beat so it isn't silent — we only learn of it
|
|
1841
1841
|
// post-hoc, so there's no real duration to animate (Max, 2026-07-02).
|
|
1842
1842
|
if (evt.kind === 'compaction') {
|
|
1843
|
-
if (entry.compacting)
|
|
1844
|
-
|
|
1843
|
+
if (entry.compacting) {
|
|
1844
|
+
// MANUAL /compact: attribute the recap card, then CLEAR the "Compacting…"
|
|
1845
|
+
// indicator right here — the compact_boundary milestone IS the "done" signal.
|
|
1846
|
+
// We used to wait for the turn's `result` (below), but a real /compact re-inits
|
|
1847
|
+
// the SDK session, so the result can land after entry.compacting was lost →
|
|
1848
|
+
// the indicator hung forever and kept counting (Max, 2026-07-03). The milestone
|
|
1849
|
+
// is emitted with compacting still true (that's how we attribute `by`), so it's
|
|
1850
|
+
// the reliable place to stop it. The result handler below stays as the backstop
|
|
1851
|
+
// for a NO-OP /compact ("nothing to compact"), which emits a result but no
|
|
1852
|
+
// compaction milestone.
|
|
1853
|
+
evt.by = entry.compactBy || null
|
|
1854
|
+
entry.compacting = false
|
|
1855
|
+
entry.compactBy = null
|
|
1856
|
+
bcast('code-event', { term: id, evt: { kind: 'compact', status: 'done', ts: Date.now() } })
|
|
1857
|
+
} else if (evt.trigger === 'auto') {
|
|
1845
1858
|
bcast('code-event', { term: id, evt: { kind: 'compact', status: 'start', ts: Date.now() } })
|
|
1846
1859
|
setTimeout(() => { bcast('code-event', { term: id, evt: { kind: 'compact', status: 'done', ts: Date.now() } }) }, 2500)
|
|
1847
1860
|
}
|