codeam-cli 2.75.15 → 2.75.17

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/CHANGELOG.md CHANGED
@@ -4,6 +4,19 @@ All notable changes to `codeam-cli` are documented here.
4
4
 
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6
6
 
7
+ ## [2.75.16] — 2026-09-25
8
+
9
+ ### Fixed
10
+
11
+ - **cli:** One-shots (Preview detect, summaries) run as the CURRENT agent, not the deploy one
12
+
13
+ ## [2.75.15] — 2026-09-25
14
+
15
+ ### Fixed
16
+
17
+ - **cli:** Accept the documented `--agent <id>` space form in pair/deploy
18
+ - **cli:** Recognise OpenRouter's "requires more credits" 402 as a BYO billing failure
19
+
7
20
  ## [2.75.14] — 2026-09-24
8
21
 
9
22
  ### Fixed
package/dist/index.js CHANGED
@@ -10509,7 +10509,7 @@ function readAnonId() {
10509
10509
  }
10510
10510
  function superProperties() {
10511
10511
  return {
10512
- cliVersion: true ? "2.75.15" : "0.0.0-dev",
10512
+ cliVersion: true ? "2.75.17" : "0.0.0-dev",
10513
10513
  nodeVersion: process.version,
10514
10514
  platform: process.platform,
10515
10515
  arch: process.arch,
@@ -10751,7 +10751,7 @@ var http = __toESM(require("http"));
10751
10751
  // package.json
10752
10752
  var package_default = {
10753
10753
  name: "codeam-cli",
10754
- version: "2.75.15",
10754
+ version: "2.75.17",
10755
10755
  description: "Workflow-continuity bridge for AI coding agents. Wrap Claude Code or Codex in a PTY and supervise, approve, and redirect the session from any device \u2014 async. The terminal companion for CodeAgent Mobile.",
10756
10756
  type: "commonjs",
10757
10757
  main: "dist/index.js",
@@ -12081,7 +12081,7 @@ var CommandRelayService = class _CommandRelayService {
12081
12081
  // fresh + clear the "CLI update available" banner after a self-update
12082
12082
  // (a codespace that reinstalls @latest reconnects via heartbeat, not
12083
12083
  // pair/reconnect). Older backends ignore the extra field.
12084
- ..."2.75.15" ? { ideVersion: "2.75.15" } : {}
12084
+ ..."2.75.17" ? { ideVersion: "2.75.17" } : {}
12085
12085
  };
12086
12086
  try {
12087
12087
  const res = await _postJson(`${API_BASE2}/api/plugin/heartbeat`, body);
@@ -17463,6 +17463,20 @@ async function fetchClaudeQuota() {
17463
17463
  });
17464
17464
  }
17465
17465
 
17466
+ // src/agents/current-agent-env.ts
17467
+ var overlay = {};
17468
+ function setCurrentAgentEnv(next) {
17469
+ overlay = { ...next ?? {} };
17470
+ }
17471
+ function currentAgentEnv(base = process.env) {
17472
+ const out2 = { ...base };
17473
+ for (const [k2, v] of Object.entries(overlay)) {
17474
+ if (v === void 0) delete out2[k2];
17475
+ else out2[k2] = v;
17476
+ }
17477
+ return out2;
17478
+ }
17479
+
17466
17480
  // src/services/spawn-and-capture.ts
17467
17481
  var import_child_process11 = require("child_process");
17468
17482
  var activeChildren = /* @__PURE__ */ new Set();
@@ -17489,7 +17503,9 @@ async function spawnAndCapture(cmd, args2, opts = {}) {
17489
17503
  try {
17490
17504
  child = (0, import_child_process11.spawn)(cmd, [...args2], {
17491
17505
  cwd: opts.cwd,
17492
- env: opts.env ?? process.env,
17506
+ // The CURRENT agent's env, not the deploy-time process env — see
17507
+ // agents/current-agent-env.ts.
17508
+ env: opts.env ?? currentAgentEnv(),
17493
17509
  stdio: ["ignore", "pipe", "pipe"]
17494
17510
  });
17495
17511
  } catch {
@@ -41181,6 +41197,7 @@ async function runAcpSession(opts) {
41181
41197
  autoApprovePermissions: opts.autoApprovePermissions,
41182
41198
  disable1mContext
41183
41199
  });
41200
+ setCurrentAgentEnv(extraEnv);
41184
41201
  const toolCallTracker = new ToolCallTracker();
41185
41202
  const clientOptions = {
41186
41203
  adapter: opts.adapter,
@@ -41499,6 +41516,7 @@ async function runAcpSession(opts) {
41499
41516
  };
41500
41517
  const next = new AcpClient(clientOptions);
41501
41518
  const hs = await next.start();
41519
+ setCurrentAgentEnv(clientOptions.extraEnv);
41502
41520
  client3 = next;
41503
41521
  opts.agent = nextAgent;
41504
41522
  opts.adapter = adapter;
@@ -47598,7 +47616,7 @@ async function autoUpgradeBeforeCriticalCommand() {
47598
47616
  if (process.env.NODE_ENV === "test") return;
47599
47617
  if (process.env.CODEAM_DISABLE_UPDATE_CHECK === "1") return;
47600
47618
  if (process.env.CI) return;
47601
- const current2 = true ? "2.75.15" : null;
47619
+ const current2 = true ? "2.75.17" : null;
47602
47620
  if (!current2) return;
47603
47621
  const cache = readCache();
47604
47622
  const fresh = cache && Date.now() - cache.fetchedAt < TTL_MS;
@@ -47615,7 +47633,7 @@ function checkForUpdates() {
47615
47633
  if (process.env.CODEAM_DISABLE_UPDATE_CHECK === "1") return;
47616
47634
  if (process.env.CI) return;
47617
47635
  if (!process.stdout.isTTY) return;
47618
- const current2 = true ? "2.75.15" : null;
47636
+ const current2 = true ? "2.75.17" : null;
47619
47637
  if (!current2) return;
47620
47638
  const cache = readCache();
47621
47639
  const fresh = cache && Date.now() - cache.fetchedAt < TTL_MS;
@@ -47638,7 +47656,7 @@ var SELF_UPDATE_INSTALL_TIMEOUT_MS = 18e4;
47638
47656
  var SELF_UPDATE_LS_TIMEOUT_MS = 15e3;
47639
47657
  var SUDO_PREFLIGHT_TIMEOUT_MS = 5e3;
47640
47658
  function currentCliVersion() {
47641
- return true ? "2.75.15" : null;
47659
+ return true ? "2.75.17" : null;
47642
47660
  }
47643
47661
  async function installedVersion(deps) {
47644
47662
  const ls = await deps.run(
@@ -47750,6 +47768,7 @@ var defaultDisableService = () => {
47750
47768
  // src/commands/host-agent.ts
47751
47769
  var HEARTBEAT_INTERVAL_MS = 2e4;
47752
47770
  var RESUME_RETRY_BACKOFF_MS = [15e3, 3e4, 6e4, 12e4];
47771
+ var CRASH_RESPAWN_MIN_UPTIME_MS = 6e4;
47753
47772
  var RESUME_REPROBE_INTERVAL_MS = 5 * 6e4;
47754
47773
  var RESUME_HEALTHY_AFTER_MS = 10 * 6e4;
47755
47774
  function isRefreshCredentialsPayload(p2) {
@@ -48828,8 +48847,9 @@ var HostAgentSupervisor = class {
48828
48847
  proc.stdout?.on("data", appendTail);
48829
48848
  proc.stderr?.on("data", appendTail);
48830
48849
  report("agent_starting", "agent process started");
48831
- proc.once("exit", (code) => {
48850
+ proc.once("exit", (code, signal) => {
48832
48851
  const tracked = this.untrackChild(payload.deployId, proc);
48852
+ if (tracked && this.respawnCrashedChild(child, code, signal, tail)) return;
48833
48853
  if (tracked) {
48834
48854
  void reportSessionEvent(
48835
48855
  { hostId: this.identity.hostId, hostToken: this.identity.hostToken },
@@ -48990,11 +49010,15 @@ var HostAgentSupervisor = class {
48990
49010
  proc.stdout?.on("data", appendTail);
48991
49011
  proc.stderr?.on("data", appendTail);
48992
49012
  proc.once("exit", (code, signal) => {
48993
- this.untrackChild(deployId, proc);
49013
+ const tracked = this.untrackChild(deployId, proc);
48994
49014
  if (typeof code === "number" && code !== 0) {
48995
49015
  this.onResumeChildExit(target, code, tail.trim().slice(-300));
48996
49016
  return;
48997
49017
  }
49018
+ if (tracked && signal) {
49019
+ this.onResumeChildExit(target, 128 + (os62.constants.signals[signal] ?? 9), `signal ${signal}`);
49020
+ return;
49021
+ }
48998
49022
  log.warn(
48999
49023
  "host-agent",
49000
49024
  `resumed session ${session.id.slice(0, 8)} exited ${signal ?? code ?? 0} without taking over \u2014 tail: ${tail.trim().slice(-300) || "(no output)"}`
@@ -49024,6 +49048,25 @@ var HostAgentSupervisor = class {
49024
49048
  * ({@link resumeRecoveryTick}) so an externally-fixed cause heals without a
49025
49049
  * manual restart.
49026
49050
  */
49051
+ /**
49052
+ * A deploy child that was UP (≥ {@link CRASH_RESPAWN_MIN_UPTIME_MS}) died on
49053
+ * its own → resume its paired session with the bounded retry path. Returns
49054
+ * false when it must be treated as before (early start failure, supervisor
49055
+ * stopping, or no saved paired session for that workspace).
49056
+ */
49057
+ respawnCrashedChild(child, code, signal, tail) {
49058
+ if (this.stopped) return false;
49059
+ if (Date.now() - child.startedAt < CRASH_RESPAWN_MIN_UPTIME_MS) return false;
49060
+ const session = pickSavedSessionForWorkspace(this.listSavedSessions(), child.cwd);
49061
+ if (!session) return false;
49062
+ const exitCode = typeof code === "number" ? code : 128 + (signal ? os62.constants.signals[signal] ?? 9 : 9);
49063
+ log.warn(
49064
+ "host-agent",
49065
+ `session deploy=${child.deployId.slice(0, 8)} died (${signal ?? code}) after ${Math.round((Date.now() - child.startedAt) / 1e3)}s \u2014 respawning it (resume)`
49066
+ );
49067
+ this.onResumeChildExit({ deployId: child.deployId, cwd: child.cwd, session }, exitCode, tail.trim().slice(-300));
49068
+ return true;
49069
+ }
49027
49070
  onResumeChildExit(target, code, detail) {
49028
49071
  if (this.stopped) return;
49029
49072
  const { session } = target;
@@ -49499,7 +49542,7 @@ function checkChokidar() {
49499
49542
  }
49500
49543
  async function doctor(args2 = []) {
49501
49544
  const json = args2.includes("--json");
49502
- const cliVersion = true ? "2.75.15" : "0.0.0-dev";
49545
+ const cliVersion = true ? "2.75.17" : "0.0.0-dev";
49503
49546
  const apiBase2 = resolveApiBaseUrl();
49504
49547
  const diagnosticId = (0, import_node_crypto12.randomUUID)();
49505
49548
  log.info("doctor", `run id=${diagnosticId} cli=${cliVersion}`);
@@ -50023,7 +50066,7 @@ async function mcpWarm(argv = [], opts = {}) {
50023
50066
  // src/commands/version.ts
50024
50067
  var import_picocolors15 = __toESM(require("picocolors"));
50025
50068
  function version2() {
50026
- const v = true ? "2.75.15" : "unknown";
50069
+ const v = true ? "2.75.17" : "unknown";
50027
50070
  console.log(`${import_picocolors15.default.bold("codeam-cli")} ${import_picocolors15.default.cyan(v)}`);
50028
50071
  }
50029
50072
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "codeam-cli",
3
- "version": "2.75.15",
3
+ "version": "2.75.17",
4
4
  "description": "Workflow-continuity bridge for AI coding agents. Wrap Claude Code or Codex in a PTY and supervise, approve, and redirect the session from any device — async. The terminal companion for CodeAgent Mobile.",
5
5
  "type": "commonjs",
6
6
  "main": "dist/index.js",