@volter/supercode-orchestrator 0.4.48 → 0.4.49
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/board/dispatch.mjs +5 -2
- package/board/workflow.mjs +2 -1
- package/package.json +1 -1
package/board/dispatch.mjs
CHANGED
|
@@ -474,6 +474,8 @@ export async function sessionEffect(board, e) {
|
|
|
474
474
|
if (e.kind === 'close_session') {
|
|
475
475
|
const rows = tx(board, (db) => db.prepare('SELECT id, metadata FROM task_runs WHERE task_id = ? ORDER BY id DESC').all(e.id));
|
|
476
476
|
for (const row of rows) {
|
|
477
|
+
// a run newer than the one that left the status is its successor, already started in this tick: not closed
|
|
478
|
+
if (e.runId && row.id > e.runId) continue;
|
|
477
479
|
const session = json(row.metadata, {})?.supercode;
|
|
478
480
|
if ((session?.slot ?? 'worker') !== e.slot || !session?.pane || session.closed_at) continue;
|
|
479
481
|
// the session that sent the event is not closed under its own command: the dispatcher closes it next tick
|
|
@@ -583,9 +585,10 @@ function launchPane(board, task, runId, lane, fleet, { input = null, slot = 'wor
|
|
|
583
585
|
let replaced = null;
|
|
584
586
|
if (prev?.forgotten) replaced = { session_id: prev.session_id, why: 'the workflow let it go' };
|
|
585
587
|
else if (prev && prev.machine === machine) {
|
|
586
|
-
|
|
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)) {
|
|
587
590
|
// the session is kept; the heartbeat's count belongs to the run that ended, so the new run starts it again
|
|
588
|
-
const { missing_since: _m, goal_turns: _t, goal_nudged_at: _n, ...kept } = prev;
|
|
591
|
+
const { missing_since: _m, goal_turns: _t, goal_nudged_at: _n, close_requested: _q, closed_at: _c, ...kept } = prev;
|
|
589
592
|
session = { ...kept, mode: 'adopt', launched_at: now(), seen_at: now() };
|
|
590
593
|
// a kept session is told what this run is for (its card came back to it, with what happened since)
|
|
591
594
|
if (input) deliverNow(board, prev.address ?? `sc:${prev.machine}:claude-code:${prev.session_id}`, input, `board-run-${task.id}-r${runId}`);
|
package/board/workflow.mjs
CHANGED
|
@@ -462,7 +462,8 @@ const ACTIONS = {
|
|
|
462
462
|
},
|
|
463
463
|
cleanup_workspace(ctx) { ctx.effects.push({ kind: 'cleanup_workspace', id: ctx.id }); },
|
|
464
464
|
stop_run(ctx) { ctx.effects.push({ kind: 'stop_run', id: ctx.id, runId: ctx.runId }); },
|
|
465
|
-
|
|
465
|
+
// the run leaving the status is the one whose session closes, never a run started after it (a reclaim's successor)
|
|
466
|
+
close_session(ctx, slot) { ctx.effects.push({ kind: 'close_session', id: ctx.id, slot, runId: ctx.runId }); },
|
|
466
467
|
// the slot's last session is let go: its next run starts a new session (a card's context is otherwise kept: a
|
|
467
468
|
// session that cannot be resumed stops the card, it is never replaced on the board's own account)
|
|
468
469
|
forget_session(ctx, slot) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@volter/supercode-orchestrator",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.49",
|
|
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": {
|