thinkpool-pair 0.7.142 → 0.7.143
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 +13 -0
- package/package.json +1 -1
package/bridge.mjs
CHANGED
|
@@ -2215,6 +2215,19 @@ channel
|
|
|
2215
2215
|
if (await budgetBlocked(s, payload.term)) return
|
|
2216
2216
|
s.session.sendTurn(text)
|
|
2217
2217
|
echoYou()
|
|
2218
|
+
// Pool-order fix (2026-07-02): emit the "dispatched to agent" marker HERE, right after
|
|
2219
|
+
// the @pool you-line, so it inherits the NEXT seq (seqable('pool') is true) and orders
|
|
2220
|
+
// correctly for EVERY viewer. It used to be pushed web-side with the FIRER's wall-clock
|
|
2221
|
+
// ts; a remote viewer sorted that against the bridge-clock you-line ts, so the two
|
|
2222
|
+
// inverted — "Pool dispatched" showed ABOVE "<name> @pool" for the OTHER person (the
|
|
2223
|
+
// firer's own view was right only because their optimistic you-line shared its clock).
|
|
2224
|
+
// seq ordering is clock-independent → consistent for firer + peers, and pushLog archives
|
|
2225
|
+
// it durably so it survives reload/replay too. Skips silent turns (no you-line to trail).
|
|
2226
|
+
if (payload.pooled && !payload.silent) {
|
|
2227
|
+
const note = { kind: 'pool', text: 'dispatched to agent' }
|
|
2228
|
+
pushLog(s, note) // stamps ts+cid, assigns seq = you-line.seq + 1, archives durably
|
|
2229
|
+
bcast('code-event', { term: payload.term, evt: note })
|
|
2230
|
+
}
|
|
2218
2231
|
})
|
|
2219
2232
|
.on('broadcast', { event: 'code-perm' }, ({ payload }) => {
|
|
2220
2233
|
const s = payload?.term && sessions.get(payload.term)
|