@link-assistant/hive-mind 1.74.0 → 1.74.2
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 +30 -0
- package/README.hi.md +30 -2
- package/README.md +33 -2
- package/README.ru.md +32 -1
- package/README.zh.md +30 -2
- package/package.json +1 -1
- package/src/claude.lib.mjs +2 -0
- package/src/cleanup.mjs +75 -1
- package/src/cleanup.os.lib.mjs +341 -0
- package/src/codex.lib.mjs +2 -0
- package/src/interactive-image-render.lib.mjs +140 -0
- package/src/interactive-image-upload.lib.mjs +415 -0
- package/src/interactive-mode.lib.mjs +27 -8
- package/src/interactive-mode.shared.lib.mjs +97 -0
- package/src/isolation-runner.lib.mjs +27 -4
- package/src/process-debug.lib.mjs +361 -0
- package/src/solve.config.lib.mjs +9 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,35 @@
|
|
|
1
1
|
# @link-assistant/hive-mind
|
|
2
2
|
|
|
3
|
+
## 1.74.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- d726744: Add cleanup process diagnostics for mapping agent PIDs to task sessions and stopping orphaned terminal-session agents.
|
|
8
|
+
|
|
9
|
+
## 1.74.1
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- 59eee9a: feat(interactive-mode): display images the AI reads/writes inline in PR comments (#1843)
|
|
14
|
+
|
|
15
|
+
When `--interactive-mode` posts Claude/Codex tool activity as PR comments, any
|
|
16
|
+
images the AI reads or produces (the `Read` tool on a screenshot, Playwright
|
|
17
|
+
captures, MCP image results) were previously serialized as multi-kilobyte
|
|
18
|
+
base64 blobs inside the "Raw JSON" section — unreadable and pushing comments
|
|
19
|
+
toward GitHub's size limit.
|
|
20
|
+
|
|
21
|
+
Those base64 payloads are now uploaded to hidden custom Git refs
|
|
22
|
+
(`refs/hive-mind-media/pr-...`) via the Git Data API and embedded inline in the
|
|
23
|
+
comment as commit-SHA `` blob URLs, so reviewers see the actual
|
|
24
|
+
image (GitHub's Camo proxy renders `?raw=true` blob URLs inline for both public
|
|
25
|
+
and private repos, whereas `data:` URIs are stripped by the comment sanitizer).
|
|
26
|
+
Uploads are content-hashed (SHA-256) for dedup, and the base64 is redacted from
|
|
27
|
+
the Raw JSON section with a `<image data: N base64 chars>` placeholder.
|
|
28
|
+
|
|
29
|
+
Enabled by default; use `--no-interactive-image-upload` to opt out, in which
|
|
30
|
+
case each image degrades to a compact metadata note instead of being embedded.
|
|
31
|
+
All comment bodies continue to pass through the token sanitizer (#1745).
|
|
32
|
+
|
|
3
33
|
## 1.74.0
|
|
4
34
|
|
|
5
35
|
### Minor Changes
|
package/README.hi.md
CHANGED
|
@@ -746,12 +746,25 @@ cleanup --force-start-command
|
|
|
746
746
|
# Ubuntu / सिस्टम क्लीनअप (apt कैश, journald लॉग, npm कैश)
|
|
747
747
|
cleanup --system --sudo
|
|
748
748
|
|
|
749
|
+
# लाइव/अटके हुए agent PID को hive/start-command कार्य सत्रों से मिलाएँ
|
|
750
|
+
cleanup --processes
|
|
751
|
+
|
|
752
|
+
# किसी खास non-agent PID को ट्रेस करें, जैसे browser child या shell
|
|
753
|
+
cleanup --pid 94445
|
|
754
|
+
|
|
755
|
+
# रोके जा सकने वाले orphaned agents का पूर्वावलोकन करें
|
|
756
|
+
cleanup --kill-orphaned-agents --dry-run
|
|
757
|
+
|
|
758
|
+
# पूर्वावलोकन जाँचने के बाद orphaned agent process trees रोकें
|
|
759
|
+
cleanup --kill-orphaned-agents --force
|
|
760
|
+
|
|
749
761
|
# सक्रिय-कार्य पहचान अक्षम करें (केवल सुरक्षित पथ रखे जाते हैं)
|
|
750
762
|
cleanup --no-keep-active-tasks-folders --dry-run
|
|
751
763
|
```
|
|
752
764
|
|
|
753
765
|
विकल्पों की पूरी सूची के लिए `cleanup --help` चलाएँ। यह कमांड dry-run के अनुकूल है और
|
|
754
|
-
हर रन के लिए टाइमस्टैम्प वाला `cleanup-*.log` लिखता है।
|
|
766
|
+
हर रन के लिए टाइमस्टैम्प वाला `cleanup-*.log` लिखता है। प्रक्रिया डायग्नोस्टिक आउटपुट
|
|
767
|
+
कमांड लाइन प्रिंट करने से पहले सामान्य token आकारों को छिपाता है।
|
|
755
768
|
|
|
756
769
|
## 🔍 निगरानी और लॉगिंग
|
|
757
770
|
|
|
@@ -802,7 +815,22 @@ find docs/ -name "*.md" -exec wc -l {} + | awk '$1 > 1000 {print "ERROR: " $2 "
|
|
|
802
815
|
|
|
803
816
|
## सर्वर डायग्नोस्टिक्स
|
|
804
817
|
|
|
805
|
-
|
|
818
|
+
किसी व्यस्त `claude`, `codex`, `gemini`, `qwen`, या `opencode` PID को उसे शुरू करने
|
|
819
|
+
वाले hive कार्य से जोड़ने के लिए पहले built-in process diagnostic command उपयोग करें:
|
|
820
|
+
|
|
821
|
+
```bash
|
|
822
|
+
# agent PID, start-command session ID, GitHub task URL, workspace, match reasons और संभावित orphaned agents दिखाएँ।
|
|
823
|
+
cleanup --processes
|
|
824
|
+
|
|
825
|
+
# उसी report में कोई भी PID शामिल करें।
|
|
826
|
+
cleanup --pid 62220
|
|
827
|
+
|
|
828
|
+
# केवल terminal task वाले orphaned agents रोकें।
|
|
829
|
+
cleanup --kill-orphaned-agents --dry-run
|
|
830
|
+
cleanup --kill-orphaned-agents --force
|
|
831
|
+
```
|
|
832
|
+
|
|
833
|
+
Manual fallback: उन स्क्रीन की पहचान करें जो संसाधन खपत करने वाली प्रक्रियाओं के पैरेंट हैं।
|
|
806
834
|
|
|
807
835
|
```bash
|
|
808
836
|
TARGETS="62220 65988 63094 66606 1028071 4127023"
|
package/README.md
CHANGED
|
@@ -767,12 +767,25 @@ cleanup --force-start-command
|
|
|
767
767
|
# Ubuntu / system cleanup (apt caches, journald logs, npm cache)
|
|
768
768
|
cleanup --system --sudo
|
|
769
769
|
|
|
770
|
+
# Map live/stuck agent PIDs back to hive/start-command task sessions
|
|
771
|
+
cleanup --processes
|
|
772
|
+
|
|
773
|
+
# Trace a specific non-agent PID, for example a browser child or shell
|
|
774
|
+
cleanup --pid 94445
|
|
775
|
+
|
|
776
|
+
# Preview orphaned terminal-session agents that can be stopped
|
|
777
|
+
cleanup --kill-orphaned-agents --dry-run
|
|
778
|
+
|
|
779
|
+
# Stop orphaned agent process trees after reviewing the preview
|
|
780
|
+
cleanup --kill-orphaned-agents --force
|
|
781
|
+
|
|
770
782
|
# Disable active-task detection (only protected paths are kept)
|
|
771
783
|
cleanup --no-keep-active-tasks-folders --dry-run
|
|
772
784
|
```
|
|
773
785
|
|
|
774
786
|
Run `cleanup --help` for the full list of options. The command is dry-run
|
|
775
|
-
friendly and writes a timestamped `cleanup-*.log` for every run.
|
|
787
|
+
friendly and writes a timestamped `cleanup-*.log` for every run. Process
|
|
788
|
+
diagnostic output redacts common token shapes before printing command lines.
|
|
776
789
|
|
|
777
790
|
## 🔍 Monitoring & Logging
|
|
778
791
|
|
|
@@ -823,7 +836,25 @@ find docs/ -name "*.md" -exec wc -l {} + | awk '$1 > 1000 {print "ERROR: " $2 "
|
|
|
823
836
|
|
|
824
837
|
## Server diagnostics
|
|
825
838
|
|
|
826
|
-
|
|
839
|
+
Prefer the built-in process diagnostic command when connecting a busy
|
|
840
|
+
`claude`, `codex`, `gemini`, `qwen`, or `opencode` PID back to the hive task
|
|
841
|
+
that launched it:
|
|
842
|
+
|
|
843
|
+
```bash
|
|
844
|
+
# Show agent PIDs, start-command session IDs, GitHub task URLs, workspaces,
|
|
845
|
+
# match reasons, and possible orphaned terminal-session agents.
|
|
846
|
+
cleanup --processes
|
|
847
|
+
|
|
848
|
+
# Include an arbitrary PID in the same report.
|
|
849
|
+
cleanup --pid 62220
|
|
850
|
+
|
|
851
|
+
# Kill only agents whose matched start-command task is already terminal.
|
|
852
|
+
cleanup --kill-orphaned-agents --dry-run
|
|
853
|
+
cleanup --kill-orphaned-agents --force
|
|
854
|
+
```
|
|
855
|
+
|
|
856
|
+
Manual fallback: identify screens that are parents of processes that are eating
|
|
857
|
+
the resources.
|
|
827
858
|
|
|
828
859
|
```bash
|
|
829
860
|
TARGETS="62220 65988 63094 66606 1028071 4127023"
|
package/README.ru.md
CHANGED
|
@@ -749,12 +749,26 @@ cleanup --force-start-command
|
|
|
749
749
|
# Очистка Ubuntu / системы (кэши apt, логи journald, кэш npm)
|
|
750
750
|
cleanup --system --sudo
|
|
751
751
|
|
|
752
|
+
# Сопоставить живые/зависшие agent PID с задачами hive/start-command
|
|
753
|
+
cleanup --processes
|
|
754
|
+
|
|
755
|
+
# Отследить конкретный не-agent PID, например дочерний процесс браузера или shell
|
|
756
|
+
cleanup --pid 94445
|
|
757
|
+
|
|
758
|
+
# Предпросмотр orphaned agents, которые можно остановить
|
|
759
|
+
cleanup --kill-orphaned-agents --dry-run
|
|
760
|
+
|
|
761
|
+
# Остановить деревья orphaned agent процессов после просмотра предпросмотра
|
|
762
|
+
cleanup --kill-orphaned-agents --force
|
|
763
|
+
|
|
752
764
|
# Отключить обнаружение активных задач (сохраняются только защищённые пути)
|
|
753
765
|
cleanup --no-keep-active-tasks-folders --dry-run
|
|
754
766
|
```
|
|
755
767
|
|
|
756
768
|
Запустите `cleanup --help`, чтобы увидеть полный список опций. Команда удобна для
|
|
757
769
|
режима dry-run и записывает лог `cleanup-*.log` с меткой времени при каждом запуске.
|
|
770
|
+
Диагностический вывод процессов скрывает распространённые формы token перед печатью
|
|
771
|
+
командных строк.
|
|
758
772
|
|
|
759
773
|
## 🔍 Мониторинг и логирование
|
|
760
774
|
|
|
@@ -805,7 +819,24 @@ find docs/ -name "*.md" -exec wc -l {} + | awk '$1 > 1000 {print "ERROR: " $2 "
|
|
|
805
819
|
|
|
806
820
|
## Диагностика сервера
|
|
807
821
|
|
|
808
|
-
|
|
822
|
+
Чтобы связать загруженный `claude`, `codex`, `gemini`, `qwen` или `opencode` PID с
|
|
823
|
+
запустившей его задачей hive, сначала используйте встроенную диагностику процессов:
|
|
824
|
+
|
|
825
|
+
```bash
|
|
826
|
+
# Показать agent PID, start-command session ID, GitHub task URL, workspace,
|
|
827
|
+
# причины совпадения и возможные orphaned agents.
|
|
828
|
+
cleanup --processes
|
|
829
|
+
|
|
830
|
+
# Включить произвольный PID в тот же отчёт.
|
|
831
|
+
cleanup --pid 62220
|
|
832
|
+
|
|
833
|
+
# Остановить только orphaned agents, чья задача уже завершена.
|
|
834
|
+
cleanup --kill-orphaned-agents --dry-run
|
|
835
|
+
cleanup --kill-orphaned-agents --force
|
|
836
|
+
```
|
|
837
|
+
|
|
838
|
+
Ручной fallback: определите screen-сессии, являющиеся родительскими для процессов,
|
|
839
|
+
потребляющих ресурсы.
|
|
809
840
|
|
|
810
841
|
```bash
|
|
811
842
|
TARGETS="62220 65988 63094 66606 1028071 4127023"
|
package/README.zh.md
CHANGED
|
@@ -741,12 +741,25 @@ cleanup --force-start-command
|
|
|
741
741
|
# Ubuntu / 系统清理(apt 缓存、journald 日志、npm 缓存)
|
|
742
742
|
cleanup --system --sudo
|
|
743
743
|
|
|
744
|
+
# 将实时/卡住的 agent PID 映射回 hive/start-command 任务会话
|
|
745
|
+
cleanup --processes
|
|
746
|
+
|
|
747
|
+
# 跟踪指定的非 agent PID,例如浏览器子进程或 shell
|
|
748
|
+
cleanup --pid 94445
|
|
749
|
+
|
|
750
|
+
# 预览可以停止的孤立 agent
|
|
751
|
+
cleanup --kill-orphaned-agents --dry-run
|
|
752
|
+
|
|
753
|
+
# 审查预览后停止孤立 agent 进程树
|
|
754
|
+
cleanup --kill-orphaned-agents --force
|
|
755
|
+
|
|
744
756
|
# 禁用活动任务检测(仅保留受保护的路径)
|
|
745
757
|
cleanup --no-keep-active-tasks-folders --dry-run
|
|
746
758
|
```
|
|
747
759
|
|
|
748
760
|
运行 `cleanup --help` 查看完整的选项列表。该命令对 dry-run 友好,并为每次运行写入
|
|
749
|
-
带时间戳的 `cleanup-*.log`
|
|
761
|
+
带时间戳的 `cleanup-*.log` 日志。进程诊断输出会在打印命令行前遮蔽常见 token
|
|
762
|
+
格式。
|
|
750
763
|
|
|
751
764
|
## 🔍 监控与日志
|
|
752
765
|
|
|
@@ -797,7 +810,22 @@ find docs/ -name "*.md" -exec wc -l {} + | awk '$1 > 1000 {print "ERROR: " $2 "
|
|
|
797
810
|
|
|
798
811
|
## 服务器诊断
|
|
799
812
|
|
|
800
|
-
|
|
813
|
+
将繁忙的 `claude`、`codex`、`gemini`、`qwen` 或 `opencode` PID 关联回启动它的
|
|
814
|
+
hive 任务时,优先使用内置进程诊断命令:
|
|
815
|
+
|
|
816
|
+
```bash
|
|
817
|
+
# 显示 agent PID、start-command 会话 ID、GitHub 任务 URL、工作区、匹配原因和可能的孤立 agent。
|
|
818
|
+
cleanup --processes
|
|
819
|
+
|
|
820
|
+
# 在同一报告中包含任意 PID。
|
|
821
|
+
cleanup --pid 62220
|
|
822
|
+
|
|
823
|
+
# 只停止已完成任务中的孤立 agent。
|
|
824
|
+
cleanup --kill-orphaned-agents --dry-run
|
|
825
|
+
cleanup --kill-orphaned-agents --force
|
|
826
|
+
```
|
|
827
|
+
|
|
828
|
+
手动兜底:识别消耗资源的进程所属的 Screen 会话。
|
|
801
829
|
|
|
802
830
|
```bash
|
|
803
831
|
TARGETS="62220 65988 63094 66606 1028071 4127023"
|
package/package.json
CHANGED
package/src/claude.lib.mjs
CHANGED
|
@@ -687,6 +687,8 @@ export const executeClaudeCommand = async params => {
|
|
|
687
687
|
// so the comment-posting path can honor them; flags default to false.
|
|
688
688
|
skipOutputSanitization: argv['dangerously-skip-output-sanitization'] === true,
|
|
689
689
|
skipActiveTokensOutputSanitization: argv['dangerously-skip-active-tokens-output-sanitization'] === true,
|
|
690
|
+
// Issue #1843: upload & embed images by default; --no-interactive-image-upload opts out.
|
|
691
|
+
imageUploadEnabled: argv['interactive-image-upload'] !== false,
|
|
690
692
|
});
|
|
691
693
|
} else if (argv.interactiveMode) {
|
|
692
694
|
await log('⚠️ Interactive mode: Disabled - missing PR info (owner/repo/prNumber)', { verbose: true });
|
package/src/cleanup.mjs
CHANGED
|
@@ -21,6 +21,8 @@
|
|
|
21
21
|
* --force-start-command allow deleting /tmp/start-command
|
|
22
22
|
* --include-system also consider system-owned temp entries
|
|
23
23
|
* --no-keep-dirty allow deleting clones with unpushed changes
|
|
24
|
+
* --processes map claude/codex/etc. PIDs to task sessions
|
|
25
|
+
* --kill-orphaned-agents signal orphaned terminal-session agents
|
|
24
26
|
* --apt --journal --docker --npm Ubuntu/system cleanup (opt-in)
|
|
25
27
|
* --system shorthand for --apt --journal --npm
|
|
26
28
|
* --sudo prefix package-manager commands with sudo
|
|
@@ -34,7 +36,8 @@ import { promises as fsp } from 'node:fs';
|
|
|
34
36
|
import { execSync } from 'node:child_process';
|
|
35
37
|
|
|
36
38
|
import { classifyEntries, summarize, formatBytes, describeReason, buildActiveMatchers, DEFAULT_PROTECTED_NAMES } from './cleanup.lib.mjs';
|
|
37
|
-
import { getTempRoot, listTempEntries, getPathSize, readFolderGitInfo, listProcessHeldPaths, getActiveTasks, removePath, runSystemCleanup } from './cleanup.os.lib.mjs';
|
|
39
|
+
import { getTempRoot, listTempEntries, getPathSize, readFolderGitInfo, listProcessHeldPaths, getActiveTasks, removePath, runSystemCleanup, collectProcessDebugReport, signalOrphanedAgentTrees } from './cleanup.os.lib.mjs';
|
|
40
|
+
import { formatProcessDebugReport } from './process-debug.lib.mjs';
|
|
38
41
|
|
|
39
42
|
const args = process.argv.slice(2);
|
|
40
43
|
|
|
@@ -42,6 +45,32 @@ function hasFlag(...names) {
|
|
|
42
45
|
return names.some(n => args.includes(n));
|
|
43
46
|
}
|
|
44
47
|
|
|
48
|
+
function getFlagValue(name) {
|
|
49
|
+
const exact = args.indexOf(name);
|
|
50
|
+
if (exact >= 0 && args[exact + 1] && !args[exact + 1].startsWith('-')) return args[exact + 1];
|
|
51
|
+
const prefix = `${name}=`;
|
|
52
|
+
const withEquals = args.find(arg => arg.startsWith(prefix));
|
|
53
|
+
return withEquals ? withEquals.slice(prefix.length) : null;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
function getFlagValues(name) {
|
|
57
|
+
const values = [];
|
|
58
|
+
const prefix = `${name}=`;
|
|
59
|
+
for (let i = 0; i < args.length; i++) {
|
|
60
|
+
const arg = args[i];
|
|
61
|
+
if (arg === name && args[i + 1] && !args[i + 1].startsWith('-')) values.push(args[i + 1]);
|
|
62
|
+
else if (arg.startsWith(prefix)) values.push(arg.slice(prefix.length));
|
|
63
|
+
}
|
|
64
|
+
return values;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
function parsePidList(values) {
|
|
68
|
+
return values
|
|
69
|
+
.flatMap(value => String(value || '').split(','))
|
|
70
|
+
.map(value => Number(value.trim()))
|
|
71
|
+
.filter(value => Number.isInteger(value) && value > 0);
|
|
72
|
+
}
|
|
73
|
+
|
|
45
74
|
// ---------------------------------------------------------------------------
|
|
46
75
|
// Early --version / --help handling (no heavy imports).
|
|
47
76
|
// ---------------------------------------------------------------------------
|
|
@@ -75,6 +104,16 @@ Options:
|
|
|
75
104
|
--no-sessions Do not query '$ --status' for active sessions
|
|
76
105
|
--no-resolve-branches Do not resolve PR head branches via gh
|
|
77
106
|
|
|
107
|
+
Process diagnostics:
|
|
108
|
+
--processes, --debug-processes
|
|
109
|
+
Map claude/codex/gemini/qwen/opencode PIDs to
|
|
110
|
+
hive-mind task sessions and workspaces
|
|
111
|
+
--pid <pid[,pid...]> Include specific non-agent PIDs in the report
|
|
112
|
+
--kill-orphaned-agents Signal orphaned agent processes whose task
|
|
113
|
+
session has already reached a terminal status
|
|
114
|
+
(dry-run unless --force is also set)
|
|
115
|
+
--signal <name> Signal for --kill-orphaned-agents [SIGTERM]
|
|
116
|
+
|
|
78
117
|
System / Ubuntu cleanup (opt-in):
|
|
79
118
|
--apt apt-get clean / autoclean / autoremove
|
|
80
119
|
--journal journalctl --vacuum-time=2weeks
|
|
@@ -103,6 +142,10 @@ const options = {
|
|
|
103
142
|
keepDirty: !hasFlag('--no-keep-dirty'),
|
|
104
143
|
useSessions: !hasFlag('--no-sessions'),
|
|
105
144
|
resolveBranches: !hasFlag('--no-resolve-branches'),
|
|
145
|
+
debugProcesses: hasFlag('--processes', '--debug-processes'),
|
|
146
|
+
killOrphanedAgents: hasFlag('--kill-orphaned-agents'),
|
|
147
|
+
targetPids: parsePidList(getFlagValues('--pid')),
|
|
148
|
+
signal: getFlagValue('--signal') || 'SIGTERM',
|
|
106
149
|
verbose: hasFlag('--verbose', '-v'),
|
|
107
150
|
apt: hasFlag('--apt', '--system'),
|
|
108
151
|
journal: hasFlag('--journal', '--system'),
|
|
@@ -110,6 +153,7 @@ const options = {
|
|
|
110
153
|
npm: hasFlag('--npm', '--system'),
|
|
111
154
|
sudo: hasFlag('--sudo'),
|
|
112
155
|
};
|
|
156
|
+
if (options.targetPids.length > 0) options.debugProcesses = true;
|
|
113
157
|
|
|
114
158
|
const timestamp = new Date().toISOString().replace(/[:.]/g, '-');
|
|
115
159
|
const scriptDir = path.dirname(process.argv[1]);
|
|
@@ -156,6 +200,36 @@ async function main() {
|
|
|
156
200
|
if (options.dryRun) await log('📝 DRY RUN — nothing will be deleted\n');
|
|
157
201
|
else if (options.force) await log('⚠️ FORCE — deleting without confirmation\n');
|
|
158
202
|
|
|
203
|
+
if (options.debugProcesses || options.killOrphanedAgents) {
|
|
204
|
+
const report = await collectProcessDebugReport({ useSessions: options.useSessions, targetPids: options.targetPids });
|
|
205
|
+
await log('');
|
|
206
|
+
await log(formatProcessDebugReport(report));
|
|
207
|
+
|
|
208
|
+
if (options.killOrphanedAgents) {
|
|
209
|
+
if (report.orphans.length === 0) {
|
|
210
|
+
await log('\n✅ No orphaned terminal-session agent processes found.');
|
|
211
|
+
} else if (options.dryRun || !options.force) {
|
|
212
|
+
await log(`\n📝 Dry run: would send ${options.signal} to orphaned agent roots: ${report.orphans.map(item => item.pid).join(', ')}`);
|
|
213
|
+
await log('Re-run with --force to signal these process trees.');
|
|
214
|
+
} else {
|
|
215
|
+
await log(`\n🧯 Sending ${options.signal} to orphaned agent process trees...`);
|
|
216
|
+
const killed = signalOrphanedAgentTrees(report, { signal: options.signal, currentPid: process.pid });
|
|
217
|
+
let ok = 0;
|
|
218
|
+
let failed = 0;
|
|
219
|
+
for (const tree of killed) {
|
|
220
|
+
const pids = tree.results.map(result => `${result.pid}${result.ok ? '' : ' (failed)'}`).join(', ') || '(none)';
|
|
221
|
+
await log(` root ${tree.rootPid}: ${pids}`);
|
|
222
|
+
ok += tree.results.filter(result => result.ok).length;
|
|
223
|
+
failed += tree.results.filter(result => !result.ok).length;
|
|
224
|
+
}
|
|
225
|
+
await log(`\n✅ Signalled ${ok} processes${failed ? `, ${failed} failed` : ''}.`);
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
await log(`\n📁 Log file: ${logFile}`);
|
|
230
|
+
return;
|
|
231
|
+
}
|
|
232
|
+
|
|
159
233
|
// 1. Enumerate candidate entries.
|
|
160
234
|
const entries = listTempEntries(tempRoot);
|
|
161
235
|
await log(`🔍 Found ${entries.length} entries under ${tempRoot}`);
|