@volter/supercode-orchestrator 0.4.50 → 0.4.52

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.
Files changed (2) hide show
  1. package/board/dispatch.mjs +13 -3
  2. package/package.json +1 -1
@@ -580,13 +580,23 @@ function launchPane(board, task, runId, lane, fleet, { input = null, slot = 'wor
580
580
  const tail = model ? ['--model', model] : [];
581
581
  const base = ['open', '--new', 'claude', '--detach', '--on', task.machine, '--cwd', task.workspace_path];
582
582
  // the slot's last session: kept when live, resumed when lost, never another slot's (a reviewer's is its own)
583
- const prev = tx(board, (db) => lastSession(db, task.id, slot));
583
+ // a close its session's own command asked for is carried out first, so its pane is gone before the slot's next
584
+ // session starts (never two processes on one session)
585
+ let prev = tx(board, (db) => lastSession(db, task.id, slot));
586
+ if (prev?.close_requested && !prev.closed_at) {
587
+ const report = { undelivered: [] };
588
+ closeRequested(board, report);
589
+ prev = tx(board, (db) => lastSession(db, task.id, slot));
590
+ // a pane that could not be closed still holds the session: no second process is started on it
591
+ if (prev?.close_requested && !prev.closed_at) throw new Error(`the slot's session ${prev.session_id} asked to be closed and its pane ${prev.pane} could not be: ${report.undelivered.map((u) => u[2]).join('; ') || 'no reason given'}`);
592
+ }
584
593
  let session = null;
585
594
  let replaced = null;
586
595
  if (prev?.forgotten) replaced = { session_id: prev.session_id, why: 'the workflow let it go' };
587
596
  else if (prev && prev.machine === machine) {
588
- // a session the board closed is not kept, whatever a fleet reading taken before the close still lists
589
- if (!prev.closed_at && sessionAlive(fleet, prev)) {
597
+ // a session the board closed, or one whose close its own command asked for (the next tick's sweep closes that
598
+ // run's pane), is not kept, whatever a fleet reading taken before the close still lists
599
+ if (!prev.closed_at && !prev.close_requested && sessionAlive(fleet, prev)) {
590
600
  // the session is kept; the heartbeat's count belongs to the run that ended, so the new run starts it again
591
601
  const { missing_since: _m, goal_turns: _t, goal_nudged_at: _n, close_requested: _q, closed_at: _c, ...kept } = prev;
592
602
  session = { ...kept, mode: 'adopt', launched_at: now(), seen_at: now() };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@volter/supercode-orchestrator",
3
- "version": "0.4.50",
3
+ "version": "0.4.52",
4
4
  "type": "module",
5
5
  "description": "The orchestrator runtime over the Volter Harness ontology: one typed operational model whose folder is its serialization, read and written through the harness orchestration doors (docs/ORCHESTRATOR-IR.md)",
6
6
  "exports": {