thinkpool-pair 0.7.141 → 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/claude-session.mjs +8 -2
- 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)
|
package/claude-session.mjs
CHANGED
|
@@ -763,8 +763,14 @@ export function startClaudeSession({ cwd, model, resume, env, mode: initialMode
|
|
|
763
763
|
// m.slash_commands (init message) — the commands this session really
|
|
764
764
|
// supports: built-ins + the host's custom .claude/commands. Surfaced
|
|
765
765
|
// so the room composer's autocomplete lists what ACTUALLY exists.
|
|
766
|
-
|
|
767
|
-
|
|
766
|
+
// Prefer the INTENDED model (opts.model — set at open and on every /model switch)
|
|
767
|
+
// over the message's own `m.model`. A RESUMED session REPLAYS the transcript's old
|
|
768
|
+
// init messages, all carrying the PRE-switch model, and each one used to reset the
|
|
769
|
+
// displayed model back (Max 2026-07-02: switch to Fable, then 24 replayed
|
|
770
|
+
// "init model=claude-opus-4-8" dragged the chip back to Opus with no result yet to
|
|
771
|
+
// correct it). opts.model reflects what the session will actually run, so trust it.
|
|
772
|
+
curModel = opts.model || m.model || model || curModel
|
|
773
|
+
emit({ kind: 'system', sessionId, model: opts.model || m.model || model || null, commands: Array.isArray(m.slash_commands) ? m.slash_commands : undefined })
|
|
768
774
|
// Dynamic model list — ask the SDK for its OWN supported models and surface
|
|
769
775
|
// them to the room so the /model picker renders live options (incl. new
|
|
770
776
|
// models like Fable) instead of a hardcoded three-item list. Fire-and-forget:
|