@commonlyai/cli 0.1.51 → 0.1.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.
- package/package.json +1 -1
- package/src/lib/daemon-supervisor.js +18 -4
package/package.json
CHANGED
|
@@ -368,12 +368,26 @@ export const createDaemonSupervisor = ({
|
|
|
368
368
|
seats.set(key, seat);
|
|
369
369
|
}
|
|
370
370
|
seat.desired = true;
|
|
371
|
-
const localToken = loadToken(row.agentName);
|
|
372
|
-
seat.adapter = row.runtime?.adapter || localToken?.adapter || seat.adapter || null;
|
|
373
|
-
seat.model = row.runtime?.model || localToken?.environment?.model || seat.model || null;
|
|
374
|
-
seat.effort = row.runtime?.effort || localToken?.environment?.effort || seat.effort || null;
|
|
375
371
|
// eslint-disable-next-line no-await-in-loop
|
|
376
372
|
const ready = await ensureToken(row);
|
|
373
|
+
// Report what the seat actually RUNS, which is the record: `agent run`
|
|
374
|
+
// reads it once at boot, and ensureToken above may have just rewritten it
|
|
375
|
+
// (a mint, or a config change). Reading it AFTER ensureToken is the point
|
|
376
|
+
// — the same tick's write is the record the seat starts from, so the very
|
|
377
|
+
// first heartbeat is already about the running seat.
|
|
378
|
+
//
|
|
379
|
+
// The row's runtime is a COMPATIBILITY OVERLAY for a seat with no record
|
|
380
|
+
// at all, never an override of a declared environment (see the overlay
|
|
381
|
+
// comment above ensureToken): leading with it here reported a model the
|
|
382
|
+
// seat was not running, because the spawn path gives the declared
|
|
383
|
+
// environment precedence over runtime.model/effort (environmentFor, and
|
|
384
|
+
// the TASK-065 measurement). ensureToken also REFUSES a change it cannot
|
|
385
|
+
// apply — a requested adapter this machine does not have — so the record
|
|
386
|
+
// is the honest answer there too: it names the adapter that kept running.
|
|
387
|
+
const current = loadToken(row.agentName);
|
|
388
|
+
seat.adapter = current ? (current.adapter || null) : (row.runtime?.adapter || null);
|
|
389
|
+
seat.model = current ? (current.environment?.model || null) : (row.runtime?.model || null);
|
|
390
|
+
seat.effort = current ? (current.environment?.effort || null) : (row.runtime?.effort || null);
|
|
377
391
|
if (ready === 'changed' && seat.child) {
|
|
378
392
|
// desired stays true, so the exit handler respawns with the updated
|
|
379
393
|
// record — the restart path IS the D6 path, no second spawner.
|