thinkpool-pair 0.7.105 → 0.7.106
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
|
@@ -1839,7 +1839,11 @@ flowChannel
|
|
|
1839
1839
|
const cid = randomUUID()
|
|
1840
1840
|
termNames[cid] = `Flow · ${String(payload.flowId).slice(0, 6)}`
|
|
1841
1841
|
saveNames(room, termNames)
|
|
1842
|
-
|
|
1842
|
+
// spawnedBy = the SAME synthetic `flow:<id>` the lanes carry, so the conductor + its
|
|
1843
|
+
// lanes form ONE Ensemble group (same ensembleRoot) — the drilled flow shows a row of
|
|
1844
|
+
// all its terminals to hop between, with a working Back. (No flowTaskKey → it's still
|
|
1845
|
+
// the conductor, excluded from the lane cap below.)
|
|
1846
|
+
openStructured({ id: cid, mode: 'plan', rolePrompt: FLOW_CONDUCTOR_PROMPT, flowSessionId: payload.flowId, spawnedBy: `flow:${payload.flowId}` })
|
|
1843
1847
|
const ce = sessions.get(cid)
|
|
1844
1848
|
if (ce?.session) { try { ce.session.sendTurn(payload.prompt || '') } catch { /* session still starting */ } }
|
|
1845
1849
|
process.stderr.write(`\n ${A.mag}◆ flow conductor launched — flow ${String(payload.flowId).slice(0, 8)} (plan mode).${A.rst}\n`)
|
|
@@ -1856,7 +1860,7 @@ flowChannel
|
|
|
1856
1860
|
const assignments = []
|
|
1857
1861
|
// Step 6 — cap concurrent Flow lanes (invariant: ≤ FLOW_LIMITS.maxConcurrentLanes).
|
|
1858
1862
|
// Overflow tasks stay pending; the room re-dispatches them in the next wave.
|
|
1859
|
-
let liveLanes = [...sessions.values()].filter(e => typeof e.spawnedBy === 'string' && e.spawnedBy.startsWith('flow:')).length
|
|
1863
|
+
let liveLanes = [...sessions.values()].filter(e => typeof e.spawnedBy === 'string' && e.spawnedBy.startsWith('flow:') && e.flowTaskKey).length // lanes only — conductor has no flowTaskKey
|
|
1860
1864
|
for (const t of payload.tasks) {
|
|
1861
1865
|
const gate = canDispatch({ mode: payload.mode || 'guide', liveLanes, budget: { capTokens: null, spentTokens: 0, killed: false } })
|
|
1862
1866
|
if (!gate.ok) { process.stderr.write(`\n ${A.yel}◆ flow dispatch held (${gate.reason}, ${liveLanes}/${FLOW_LIMITS.maxConcurrentLanes} lanes) — ${assignments.length} spawned this wave.${A.rst}\n`); break }
|