thinkpool-pair 0.7.135 → 0.7.137
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 +7 -0
- package/claude-session.mjs +8 -0
- package/package.json +1 -1
package/bridge.mjs
CHANGED
|
@@ -2180,6 +2180,13 @@ channel
|
|
|
2180
2180
|
// when you left + returned to the tab. onEvent refines s.model to the full
|
|
2181
2181
|
// id on the next turn; the announce carries it to every device meanwhile.
|
|
2182
2182
|
s.model = mm[1]; announce()
|
|
2183
|
+
// Durably save the pick RIGHT NOW — not only after the next turn's debounced
|
|
2184
|
+
// write. Without this, switching then restarting the bridge before a turn
|
|
2185
|
+
// (exactly what an update-restart does) lost the choice: the resumed session
|
|
2186
|
+
// re-launched on the host default (Opus), so the switch read as "reverts on
|
|
2187
|
+
// reload" (Max 2026-07-02). flush() writes the model into the session record
|
|
2188
|
+
// synchronously; the restore path re-applies it via query opts.model.
|
|
2189
|
+
s.flush?.()
|
|
2183
2190
|
ctlLine(`switched model → ${mm[1]}`)
|
|
2184
2191
|
}
|
|
2185
2192
|
else { ctlLine('use /model <name> to switch — e.g. opus, sonnet, haiku') }
|
package/claude-session.mjs
CHANGED
|
@@ -880,6 +880,14 @@ export function startClaudeSession({ cwd, model, resume, env, mode: initialMode
|
|
|
880
880
|
// instead, and echo a note line so both drivers see the change.
|
|
881
881
|
async setModel(m) {
|
|
882
882
|
try { await q?.setModel?.(m) } catch { /* may reject unknown model */ }
|
|
883
|
+
// setModel switches only the LIVE query object. runQuery() re-runs query() with
|
|
884
|
+
// `opts` on every auto-restart (transient stream drop / reconnect), so unless we
|
|
885
|
+
// also update opts.model the reconnect re-launches on the ORIGINAL model — which
|
|
886
|
+
// is why a /model switch kept snapping back to Opus after a few turns (Max
|
|
887
|
+
// 2026-07-02: 11× "init model=claude-opus-4-8" after switching to Fable). Pin the
|
|
888
|
+
// switch into opts + curModel so every subsequent re-run carries it.
|
|
889
|
+
opts.model = m
|
|
890
|
+
curModel = m
|
|
883
891
|
emit({ kind: 'note', text: `model → ${m}` })
|
|
884
892
|
},
|
|
885
893
|
async listModels() {
|