thinkpool-pair 0.7.132 → 0.7.133
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 +6 -2
- package/package.json +1 -1
package/bridge.mjs
CHANGED
|
@@ -1370,7 +1370,11 @@ function openStructured({ id, model, resume, log, commands, mode, spawnedBy, rol
|
|
|
1370
1370
|
// subagent-block; without cwd it runs outside its worktree; without rolePrompt it loses its
|
|
1371
1371
|
// Flow role. blockSubagents / onLaneDone / onReviewVerdict / onSubmitPlan all derive from
|
|
1372
1372
|
// these, so restoring them restores the whole behavior.
|
|
1373
|
-
|
|
1373
|
+
// model: persist the terminal's active model so a /model switch SURVIVES a bridge
|
|
1374
|
+
// restart. Without this, sessionData omitted it → on restart the resumed session
|
|
1375
|
+
// re-launched on the host default (Opus) regardless of the last switch, and the
|
|
1376
|
+
// switch looked like it "never changed the model" (Max 2026-07-02). Restored below.
|
|
1377
|
+
const sessionData = () => ({ sessionId: entry.session?.sessionId || resume || null, log: entry.log, commands: entry.commands, mode: entry.mode, model: entry.model || null, spawnedBy: entry.spawnedBy, flowSessionId: entry.flowSessionId, flowTaskKey: entry.flowTaskKey, cwd: entry.cwd, rolePrompt: entry.rolePrompt, flowReviewTarget: entry.flowReviewTarget || null, revertTarget: entry.revertTarget || null, reviewSliceRoots: entry.reviewSliceRoots || [], openedAt: entry.openedAt || null })
|
|
1374
1378
|
const persist = () => saveSession(room, id, sessionData())
|
|
1375
1379
|
// Synchronous flush of this session's record. Used on open (so a brand-new session
|
|
1376
1380
|
// has a file under its id BEFORE its first event — surviving a restart inside the
|
|
@@ -2348,7 +2352,7 @@ Output:`
|
|
|
2348
2352
|
// FL-M6 — restore the flow context (id/role/cwd) so an in-flight flow survives a
|
|
2349
2353
|
// bridge restart: the conductor keeps its subagent-block + plan interception, and
|
|
2350
2354
|
// lanes keep their worktree cwd + the ability to mark done.
|
|
2351
|
-
openStructured({ id: rec.id, resume: canResume(rec) ? rec.sessionId : undefined, log: rec.log, commands: rec.commands, mode: rec.mode, spawnedBy: rec.spawnedBy, flowSessionId: rec.flowSessionId, flowTaskKey: rec.flowTaskKey, cwd: rec.cwd, rolePrompt: rec.rolePrompt, reviewSliceRoots: rec.reviewSliceRoots, openedAt: rec.openedAt,
|
|
2355
|
+
openStructured({ id: rec.id, model: rec.model || undefined, resume: canResume(rec) ? rec.sessionId : undefined, log: rec.log, commands: rec.commands, mode: rec.mode, spawnedBy: rec.spawnedBy, flowSessionId: rec.flowSessionId, flowTaskKey: rec.flowTaskKey, cwd: rec.cwd, rolePrompt: rec.rolePrompt, reviewSliceRoots: rec.reviewSliceRoots, openedAt: rec.openedAt,
|
|
2352
2356
|
// Lazy-boot restored terminals that were IDLE + not part of a flow: their transcript
|
|
2353
2357
|
// shows immediately; the query boots on first turn. Mid-turn + flow terminals boot now
|
|
2354
2358
|
// (mid-turn needs auto-resume; flow needs its lane live).
|