ragent-cli 1.7.0 → 1.7.1

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.
Files changed (2) hide show
  1. package/dist/index.js +23 -4
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -31,7 +31,7 @@ var require_package = __commonJS({
31
31
  "package.json"(exports2, module2) {
32
32
  module2.exports = {
33
33
  name: "ragent-cli",
34
- version: "1.7.0",
34
+ version: "1.7.1",
35
35
  description: "CLI agent for rAgent Live \u2014 browser-first terminal control plane for AI coding agents",
36
36
  main: "dist/index.js",
37
37
  bin: {
@@ -1573,8 +1573,18 @@ var SessionStreamer = class {
1573
1573
  if (!pid) return false;
1574
1574
  if (!(0, import_node_fs.existsSync)(`/proc/${pid}`)) {
1575
1575
  console.warn(`[rAgent] Process ${pid} does not exist (no /proc/${pid}).`);
1576
+ this.sendFn(sessionId, "\r\n[rAgent] Process is no longer running. It will be removed on next sync.\r\n");
1576
1577
  return false;
1577
1578
  }
1579
+ try {
1580
+ const stat = (0, import_node_fs.readFileSync)(`/proc/${pid}/stat`, "utf8");
1581
+ if (stat.includes(") Z")) {
1582
+ console.warn(`[rAgent] Process ${pid} is a zombie.`);
1583
+ this.sendFn(sessionId, "\r\n[rAgent] Process has exited (zombie). It will be removed on next sync.\r\n");
1584
+ return false;
1585
+ }
1586
+ } catch {
1587
+ }
1578
1588
  try {
1579
1589
  const straceProc = (0, import_node_child_process2.spawn)(
1580
1590
  "strace",
@@ -1632,7 +1642,11 @@ var SessionStreamer = class {
1632
1642
  const remaining = stream.utf8Decoder.end();
1633
1643
  if (remaining) this.sendFn(sessionId, remaining);
1634
1644
  if (code === 1) {
1635
- this.sendFn(sessionId, "\r\n[rAgent] Permission denied: cannot attach to process.\r\nTo enable process tracing, run:\r\n sudo sysctl kernel.yama.ptrace_scope=0\r\n");
1645
+ if (pid && !(0, import_node_fs.existsSync)(`/proc/${pid}`)) {
1646
+ this.sendFn(sessionId, "\r\n[rAgent] Process has exited. It will be removed on next sync.\r\n");
1647
+ } else {
1648
+ this.sendFn(sessionId, "\r\n[rAgent] Permission denied: cannot attach to process.\r\nTo enable process tracing, run:\r\n sudo sysctl kernel.yama.ptrace_scope=0\r\n");
1649
+ }
1636
1650
  }
1637
1651
  stream.stopped = true;
1638
1652
  this.active.delete(sessionId);
@@ -2723,8 +2737,13 @@ var ControlDispatcher = class {
2723
2737
  process.kill(pid, "SIGTERM");
2724
2738
  console.log(`[rAgent] Sent SIGTERM to process ${pid} (${sessionId}).`);
2725
2739
  } catch (error) {
2726
- const message = error instanceof Error ? error.message : String(error);
2727
- console.warn(`[rAgent] Failed to kill process ${pid}: ${message}`);
2740
+ const code = error.code;
2741
+ if (code === "ESRCH") {
2742
+ console.log(`[rAgent] Process ${pid} already exited, cleaning up.`);
2743
+ } else {
2744
+ const message = error instanceof Error ? error.message : String(error);
2745
+ console.warn(`[rAgent] Failed to kill process ${pid}: ${message}`);
2746
+ }
2728
2747
  }
2729
2748
  await this.syncInventory();
2730
2749
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ragent-cli",
3
- "version": "1.7.0",
3
+ "version": "1.7.1",
4
4
  "description": "CLI agent for rAgent Live — browser-first terminal control plane for AI coding agents",
5
5
  "main": "dist/index.js",
6
6
  "bin": {