@commonlyai/cli 0.1.222 → 0.1.223

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.222",
3
+ "version": "0.1.223",
4
4
  "license": "Apache-2.0",
5
5
  "description": "The Commonly CLI — connect agents, manage pods, iterate fast",
6
6
  "type": "module",
@@ -96,6 +96,7 @@ import { createSeatStop } from '../lib/seat-stop.js';
96
96
  import { detectSeatbelt } from '../lib/sandbox/seatbelt.js';
97
97
  import { describeUpstreamRefusal } from '../lib/upstream-refusal.js';
98
98
  import { createTurnRunner, supervisedRunPolicy } from '../lib/supervised-turn.js';
99
+ import { describeFirstOutputWatch } from '../lib/first-output-watchdog.js';
99
100
  import {
100
101
  DEFAULT_HOOK_TIMEOUT_MS,
101
102
  clampHookTimeoutMs,
@@ -1586,6 +1587,7 @@ export const performRun = ({
1586
1587
  seat: agentName, turnTimeoutMs: effectiveTurnTimeoutMs, supervise: supervising, log,
1587
1588
  });
1588
1589
  if (supervising) log(turnRunner.describe(adapter?.name));
1590
+ if (adapter?.name === 'claude') log(describeFirstOutputWatch());
1589
1591
  const runtimeReporter = createRuntimeReporter({
1590
1592
  client: runtimeReportClient || { post: async () => {} },
1591
1593
  harness: adapter.name, detect: () => adapter.detect(),
@@ -676,6 +676,13 @@ const runClaude = ({
676
676
  const table = Number.isInteger(proc.pid) ? processTable() : null;
677
677
  if (table) stallSnapshot = descendantsOf(table, proc.pid);
678
678
  killProcessTree(proc, 'SIGTERM', treeIo(() => table));
679
+ // A stopped process holds a SIGTERM it handles (claude does) until it is
680
+ // continued, so a turn frozen with SIGSTOP sat out the whole grace below:
681
+ // 191 s on a 180 s window (rivet, 2026-11-01). SIGCONT lets it act on the
682
+ // SIGTERM now. A process that is not stopped is unaffected unless it
683
+ // handles SIGCONT (a job-control shell does); the SIGKILL below still
684
+ // lands at the grace either way.
685
+ killProcessTree(proc, 'SIGCONT', treeIo(() => table));
679
686
  // A process parked in a system call may not act on SIGTERM. SIGKILL the
680
687
  // child, its group when it leads one, and its descendants.
681
688
  stallKill = setTimeout(() => {
@@ -77,6 +77,17 @@ export const physicalPath = (dir) => {
77
77
  // How long a stalled spawn gets to exit after SIGTERM before SIGKILL.
78
78
  export const STALL_KILL_GRACE_MS = 10_000;
79
79
 
80
+ // The boot line for a claude seat. This watchdog is the stall guard a claude
81
+ // turn runs: the seats supervisor's stall window is off for claude
82
+ // (STALL_DEFAULTS_MS in supervised-turn.js), and its package default of 120 s
83
+ // was once read as this one's (the G6 walk, 2026-11-01).
84
+ export const describeFirstOutputWatch = (env = process.env) => {
85
+ const windowMs = firstOutputWindowMs(env);
86
+ if (!windowMs) return 'first-output watchdog OFF for claude (COMMONLY_FIRST_OUTPUT_WINDOW_MS=0)';
87
+ return `first-output watchdog ON for claude: a turn with no model output in ${windowMs}ms is killed `
88
+ + `(SIGTERM, then SIGKILL ${STALL_KILL_GRACE_MS}ms later if it is still alive)`;
89
+ };
90
+
80
91
  /**
81
92
  * SIGKILL each snapshotted descendant of a stalled spawn that is still alive
82
93
  * once the spawn itself has exited. Its parent may have exited, so it may now