autopilot-code 2.2.1 → 2.2.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.
Files changed (2) hide show
  1. package/dist/cli.js +21 -2
  2. package/package.json +1 -1
package/dist/cli.js CHANGED
@@ -158,8 +158,27 @@ function generateSystemdUnit(logPath, intervalSeconds, useSystem) {
158
158
  ];
159
159
  const user = process.env.USER || "root";
160
160
  const home = process.env.HOME || "/root";
161
- // Include current PATH so systemd can find nvm-installed binaries like opencode
162
- const currentPath = process.env.PATH || "/usr/bin:/bin";
161
+ // Dedupe and filter PATH - remove Windows/WSL paths that are irrelevant to systemd services
162
+ // This prevents PATH bloat from accumulating across self-updates (especially in WSL where
163
+ // the shell PATH includes all Windows paths via /mnt/c/, /mnt/d/, etc.)
164
+ const rawPath = process.env.PATH || "/usr/bin:/bin";
165
+ const entries = rawPath.split(':');
166
+ const seen = new Set();
167
+ const filtered = entries.filter(p => {
168
+ // Skip Windows mount paths - they don't work in systemd service context
169
+ if (p.startsWith('/mnt/c/') || p.startsWith('/mnt/C/') ||
170
+ p.startsWith('/mnt/d/') || p.startsWith('/mnt/D/') ||
171
+ p.startsWith('/mnt/f/') || p.startsWith('/mnt/F/')) {
172
+ return false;
173
+ }
174
+ // Dedupe - skip if already seen
175
+ if (seen.has(p)) {
176
+ return false;
177
+ }
178
+ seen.add(p);
179
+ return true;
180
+ });
181
+ const currentPath = filtered.join(':') || "/usr/bin:/bin";
163
182
  return `[Unit]
164
183
  Description=Autopilot automated issue runner
165
184
  After=network.target
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "autopilot-code",
3
- "version": "2.2.1",
3
+ "version": "2.2.2",
4
4
  "private": false,
5
5
  "description": "Repo-issue–driven autopilot runner",
6
6
  "license": "MIT",