aidevops 3.8.41 → 3.8.43
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/VERSION +1 -1
- package/aidevops.sh +1 -1
- package/package.json +1 -1
- package/setup-modules/agent-deploy.sh +64 -0
- package/setup.sh +1 -1
package/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
3.8.
|
|
1
|
+
3.8.43
|
package/aidevops.sh
CHANGED
package/package.json
CHANGED
|
@@ -8,6 +8,62 @@
|
|
|
8
8
|
# Shell safety baseline
|
|
9
9
|
set -Eeuo pipefail
|
|
10
10
|
IFS=$'\n\t'
|
|
11
|
+
|
|
12
|
+
#######################################
|
|
13
|
+
# Restart the pulse process if it's running, so it picks up newly deployed
|
|
14
|
+
# scripts. Bash processes source files at startup only — file changes on
|
|
15
|
+
# disk don't affect a running process. The pulse is long-lived (hours/days)
|
|
16
|
+
# so it would run stale code indefinitely without a restart.
|
|
17
|
+
#
|
|
18
|
+
# The pulse auto-restarts via launchd/cron, so killing it is safe. If no
|
|
19
|
+
# auto-restart mechanism exists, we start it manually.
|
|
20
|
+
#######################################
|
|
21
|
+
_restart_pulse_if_running() {
|
|
22
|
+
local pid_file="${HOME}/.aidevops/logs/pulse.pid"
|
|
23
|
+
[[ -f "$pid_file" ]] || return 0
|
|
24
|
+
|
|
25
|
+
local pulse_pid=""
|
|
26
|
+
pulse_pid=$(grep -oE '[0-9]+' "$pid_file" | head -1) || return 0
|
|
27
|
+
[[ -n "$pulse_pid" ]] || return 0
|
|
28
|
+
|
|
29
|
+
# Check if the process is actually alive
|
|
30
|
+
if ! kill -0 "$pulse_pid" 2>/dev/null; then
|
|
31
|
+
return 0
|
|
32
|
+
fi
|
|
33
|
+
|
|
34
|
+
print_info "Restarting pulse (PID $pulse_pid) to load updated scripts..."
|
|
35
|
+
kill "$pulse_pid" 2>/dev/null || true
|
|
36
|
+
|
|
37
|
+
# Wait for it to die
|
|
38
|
+
local wait_count=0
|
|
39
|
+
while kill -0 "$pulse_pid" 2>/dev/null && [[ "$wait_count" -lt 10 ]]; do
|
|
40
|
+
sleep 1
|
|
41
|
+
wait_count=$((wait_count + 1))
|
|
42
|
+
done
|
|
43
|
+
|
|
44
|
+
# Give launchd/cron a moment to restart it
|
|
45
|
+
sleep 5
|
|
46
|
+
|
|
47
|
+
# Check if it auto-restarted
|
|
48
|
+
if [[ -f "$pid_file" ]]; then
|
|
49
|
+
local new_pid=""
|
|
50
|
+
new_pid=$(grep -oE '[0-9]+' "$pid_file" | head -1) || new_pid=""
|
|
51
|
+
if [[ -n "$new_pid" ]] && kill -0 "$new_pid" 2>/dev/null; then
|
|
52
|
+
print_success "Pulse restarted (new PID $new_pid)"
|
|
53
|
+
return 0
|
|
54
|
+
fi
|
|
55
|
+
fi
|
|
56
|
+
|
|
57
|
+
# No auto-restart — start it manually
|
|
58
|
+
local pulse_script="${HOME}/.aidevops/agents/scripts/pulse-wrapper.sh"
|
|
59
|
+
if [[ -x "$pulse_script" ]]; then
|
|
60
|
+
nohup "$pulse_script" >>"${HOME}/.aidevops/logs/pulse-wrapper.log" 2>&1 &
|
|
61
|
+
print_success "Pulse started manually (PID $!)"
|
|
62
|
+
else
|
|
63
|
+
print_warning "Pulse not restarted — $pulse_script not found"
|
|
64
|
+
fi
|
|
65
|
+
return 0
|
|
66
|
+
}
|
|
11
67
|
# shellcheck disable=SC2154 # rc is assigned by $? in the trap string
|
|
12
68
|
trap 'rc=$?; echo "[ERROR] ${BASH_SOURCE[0]}:${LINENO} exit $rc" >&2' ERR
|
|
13
69
|
shopt -s inherit_errexit 2>/dev/null || true
|
|
@@ -514,6 +570,14 @@ deploy_aidevops_agents() {
|
|
|
514
570
|
print_success "Deployed agents to $target_dir"
|
|
515
571
|
_deploy_agents_post_copy "$target_dir" "$repo_dir" "$source_dir" "$plugins_file"
|
|
516
572
|
|
|
573
|
+
# Restart pulse if running — bash processes load source files at startup
|
|
574
|
+
# and don't re-read them when files change on disk. Without a restart,
|
|
575
|
+
# fixes to pulse-*.sh, dispatch-dedup-*.sh, headless-runtime-*.sh, and
|
|
576
|
+
# other sourced scripts don't take effect until the next manual restart.
|
|
577
|
+
# This was the root cause of a multi-hour outage where deployed fixes
|
|
578
|
+
# were correct but the running pulse kept using old code in memory.
|
|
579
|
+
_restart_pulse_if_running
|
|
580
|
+
|
|
517
581
|
return 0
|
|
518
582
|
}
|
|
519
583
|
|
package/setup.sh
CHANGED
|
@@ -12,7 +12,7 @@ shopt -s inherit_errexit 2>/dev/null || true
|
|
|
12
12
|
# AI Assistant Server Access Framework Setup Script
|
|
13
13
|
# Helps developers set up the framework for their infrastructure
|
|
14
14
|
#
|
|
15
|
-
# Version: 3.8.
|
|
15
|
+
# Version: 3.8.43
|
|
16
16
|
#
|
|
17
17
|
# Quick Install:
|
|
18
18
|
# npm install -g aidevops && aidevops update (recommended)
|