@volter/supercode-orchestrator 0.4.50 → 0.4.51

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 +10 -3
  2. package/package.json +1 -1
@@ -580,13 +580,20 @@ 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
+ closeRequested(board, { undelivered: [] });
588
+ prev = tx(board, (db) => lastSession(db, task.id, slot));
589
+ }
584
590
  let session = null;
585
591
  let replaced = null;
586
592
  if (prev?.forgotten) replaced = { session_id: prev.session_id, why: 'the workflow let it go' };
587
593
  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)) {
594
+ // a session the board closed, or one whose close its own command asked for (the next tick's sweep closes that
595
+ // run's pane), is not kept, whatever a fleet reading taken before the close still lists
596
+ if (!prev.closed_at && !prev.close_requested && sessionAlive(fleet, prev)) {
590
597
  // the session is kept; the heartbeat's count belongs to the run that ended, so the new run starts it again
591
598
  const { missing_since: _m, goal_turns: _t, goal_nudged_at: _n, close_requested: _q, closed_at: _c, ...kept } = prev;
592
599
  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.51",
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": {