@commonlyai/cli 0.1.51 → 0.1.53

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@commonlyai/cli",
3
- "version": "0.1.51",
3
+ "version": "0.1.53",
4
4
  "license": "Apache-2.0",
5
5
  "description": "The Commonly CLI — connect agents, manage pods, iterate fast",
6
6
  "type": "module",
@@ -449,9 +449,12 @@ const prepareArgv = async (innerArgv, ctx) => {
449
449
  ...buildPublicClaudePolicyArgs(allowedPatterns),
450
450
  ];
451
451
  const claudeBin = resolveClaudePath(claudeEnv);
452
+ // Only stdio servers have a `command`; an HTTP entry (the grant broker)
453
+ // carries a `url` instead, and `isAbsolute(undefined)` throws — every
454
+ // confined spawn of a seat with a broker grant died here (2026-09-18).
452
455
  const mcpExecutables = (env.mcp || [])
453
456
  .map((server) => server?.command?.[0])
454
- .filter((command) => isAbsolute(command));
457
+ .filter((command) => typeof command === 'string' && isAbsolute(command));
455
458
  const wrapped = wrapArgvWithSeatbelt([claudeBin, ...innerArgv], {
456
459
  workspacePath: ctx.cwd,
457
460
  workspaceAccess: sandboxMode === 'read-only' ? 'read' : 'write',
@@ -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.