alvin-bot 4.8.5 → 4.8.6
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 +26 -0
- package/bin/cli.js +2 -7
- package/dist/handlers/commands.js +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,32 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to Alvin Bot are documented here.
|
|
4
4
|
|
|
5
|
+
## [4.8.6] — 2026-04-11
|
|
6
|
+
|
|
7
|
+
### 🐛 LaunchAgent: `/restart` left the bot down forever
|
|
8
|
+
|
|
9
|
+
Caught on the Mac mini production bot: running `/restart` in Telegram killed the bot cleanly but the process never came back, leaving the bot dead until manual intervention.
|
|
10
|
+
|
|
11
|
+
**Root cause**: The 4.6.0 LaunchAgent plist template hardcoded a conditional `KeepAlive`:
|
|
12
|
+
|
|
13
|
+
```xml
|
|
14
|
+
<key>KeepAlive</key>
|
|
15
|
+
<dict>
|
|
16
|
+
<key>SuccessfulExit</key>
|
|
17
|
+
<false/> <!-- don't restart on normal exit -->
|
|
18
|
+
<key>Crashed</key>
|
|
19
|
+
<true/> <!-- only restart on crash -->
|
|
20
|
+
</dict>
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
That meant launchd would only auto-restart on **crashes**, not on normal exits. But `/restart` (and `/update`) work by calling `process.exit(0)` — a deliberate clean exit — and relying on the process manager to bring the bot back up. With pm2 this always worked because pm2's default is "restart on any exit". With launchd's conditional KeepAlive, `process.exit(0)` was the ONE exit code that guaranteed the bot stayed down.
|
|
24
|
+
|
|
25
|
+
**Fix**: Plist template now uses `<key>KeepAlive</key><true/>` — unconditional restart on any exit. Matches pm2's default behavior. `ThrottleInterval` dropped from 10s to 5s so recovery is quicker.
|
|
26
|
+
|
|
27
|
+
**Migration for existing installs**: re-run `alvin-bot launchd install` to get the new plist. The install script unloads the old plist, writes the new one, and reloads it — existing data and running state are preserved.
|
|
28
|
+
|
|
29
|
+
Also removed the stale "(PM2)" suffix from the `/restart` Telegram command description — it's just "Restart the bot" now, since the command works identically with both pm2 and launchd.
|
|
30
|
+
|
|
5
31
|
## [4.8.5] — 2026-04-11
|
|
6
32
|
|
|
7
33
|
### 🐛 `/update` now works for npm-global installs
|
package/bin/cli.js
CHANGED
|
@@ -1461,15 +1461,10 @@ function renderLaunchdPlist({ label, nodePath, entryPoint, cwd, home, logDir })
|
|
|
1461
1461
|
<true/>
|
|
1462
1462
|
|
|
1463
1463
|
<key>KeepAlive</key>
|
|
1464
|
-
<
|
|
1465
|
-
<key>SuccessfulExit</key>
|
|
1466
|
-
<false/>
|
|
1467
|
-
<key>Crashed</key>
|
|
1468
|
-
<true/>
|
|
1469
|
-
</dict>
|
|
1464
|
+
<true/>
|
|
1470
1465
|
|
|
1471
1466
|
<key>ThrottleInterval</key>
|
|
1472
|
-
<integer>
|
|
1467
|
+
<integer>5</integer>
|
|
1473
1468
|
|
|
1474
1469
|
<key>StandardOutPath</key>
|
|
1475
1470
|
<string>${logDir}/alvin-bot.out.log</string>
|
|
@@ -156,7 +156,7 @@ export function registerCommands(bot) {
|
|
|
156
156
|
{ command: "webui", description: "Open Web UI in browser" },
|
|
157
157
|
{ command: "setup", description: "Configure API keys & platforms" },
|
|
158
158
|
{ command: "cancel", description: "Cancel running request" },
|
|
159
|
-
{ command: "restart", description: "Restart the bot
|
|
159
|
+
{ command: "restart", description: "Restart the bot" },
|
|
160
160
|
{ command: "update", description: "Pull latest, build, restart" },
|
|
161
161
|
{ command: "autoupdate", description: "Auto-update on|off|status" },
|
|
162
162
|
]).catch(err => console.error("Failed to set bot commands:", err));
|