Commit Graph

67 Commits

Author SHA1 Message Date
Peter Steinberger
69dd628fe1 test: stabilize service-env path tests on windows 2026-01-24 04:36:52 +00:00
Peter Steinberger
857ae47203 fix: align service path tests with platform delimiters 2026-01-24 02:34:54 +00:00
Peter Steinberger
76313f7e5e fix: stabilize embedded runner queueing 2026-01-24 02:05:41 +00:00
Peter Steinberger
1c71124ada fix: expand linux service PATH handling 2026-01-23 19:16:41 +00:00
Robby
d167ad9e9c fix(linux): add user bin directories to systemd service PATH for skill installation (#1512)
* fix(linux): add user bin directories to systemd service PATH

Fixes #1503

On Linux, the systemd service PATH was hardcoded to only include system
directories (/usr/local/bin, /usr/bin, /bin), causing binaries installed
via npm global with custom prefix or node version managers to not be found.

This adds common Linux user bin directories to the PATH:
- ~/.local/bin (XDG standard, pip, etc.)
- ~/.npm-global/bin (npm custom prefix)
- ~/bin (user's personal bin)
- Node version manager paths (nvm, fnm, volta, asdf)
- ~/.local/share/pnpm (pnpm global)
- ~/.bun/bin (Bun)

User directories are added before system directories so user-installed
binaries take precedence.

🤖 AI-assisted (Claude Opus 4.5 via Clawdbot)
📋 Testing: Existing unit tests pass (7/7)

* test: add comprehensive tests for Linux user bin directory resolution

- Add dedicated tests for resolveLinuxUserBinDirs() function
- Test path ordering (extraDirs > user dirs > system dirs)
- Test buildMinimalServicePath() with HOME set/unset
- Test platform-specific behavior (Linux vs macOS vs Windows)

Test count: 7 → 20 (+13 tests)

* test: add comprehensive tests for Linux user bin directory handling

- Test Linux user directories included when HOME is set
- Test Linux user directories excluded when HOME is missing
- Test path ordering (extraDirs > user dirs > system dirs)
- Test platform-specific behavior (Linux vs macOS vs Windows)
- Test buildMinimalServicePath() with HOME in env

Covers getMinimalServicePathParts() and buildMinimalServicePath()
for all Linux user bin directory edge cases.

Test count: 7 → 16 (+9 tests)
2026-01-23 19:06:14 +00:00
George Zhang
e0f62ed11a daemon: prefer symlinked paths over realpath for stable service configs (#1505)
When installing the LaunchAgent/systemd service, the CLI was using
fs.realpath() to resolve the entry.js path, which converted stable
symlinked paths (e.g. node_modules/clawdbot) into version-specific
paths (e.g. .pnpm/clawdbot@X.Y.Z/...).

This caused the service to break after pnpm updates because the old
versioned path no longer exists, even though the symlink still works.

Now we prefer the original (symlinked) path when it's valid, keeping
service configs stable across package version updates.
2026-01-23 11:52:26 +00:00
Ameno Osman
52503fa237 fix(node): use node run for node daemon 2026-01-22 11:15:51 -08:00
Peter Steinberger
1eeba6ae10 feat: fold gateway service commands into gateway 2026-01-21 17:45:26 +00:00
Peter Steinberger
df8e949b05 refactor: normalize cli command hints 2026-01-20 07:43:00 +00:00
Peter Steinberger
f115be4d3e fix(daemon): include HOME in service env (#1214)
Thanks @ameno-.

Co-authored-by: Ameno Osman <ameno.osman13@gmail.com>
2026-01-19 08:39:12 +00:00
Peter Steinberger
91c6acd9fa fix: stabilize tests and logging 2026-01-18 18:43:31 +00:00
Peter Steinberger
0bf0c771c8 feat(doctor): repair launch agent bootstrap
Co-authored-by: Dr Alexander Mikhalev <alex@metacortex.engineer>
2026-01-18 16:35:18 +00:00
Peter Steinberger
0ecd13b7a2 feat: add exec host routing + node daemon 2026-01-18 07:46:00 +00:00
Peter Steinberger
77196c8b62 fix: soften windows daemon install 2026-01-17 20:12:26 +00:00
Peter Steinberger
acf3be56f2 fix: improve WSL2 systemd daemon hints 2026-01-17 18:19:55 +00:00
Peter Steinberger
d86a3d1294 chore: run format and fix sandbox browser timeouts 2026-01-16 09:18:58 +00:00
Peter Steinberger
cbbee4bc08 test: stabilize slow and flaky tests 2026-01-16 06:24:58 +00:00
Roshan Singh
ab91f1f9a2 Fix systemd ExecStart parsing whitespace 2026-01-16 05:25:13 +00:00
Peter Steinberger
7f3557bc8e fix: repair CI formatting + launchd test 2026-01-16 03:52:47 +00:00
Peter Steinberger
569635b957 fix: normalize daemon unit paths 2026-01-16 03:47:26 +00:00
Peter Steinberger
defeadcb2a refactor: centralize daemon path resolution 2026-01-15 23:19:52 +00:00
Benjamin Jesuiter
f62f683354 fix: unify daemon service label resolution with env 2026-01-15 22:10:27 +00:00
Peter Steinberger
a9f0dddbae fix(cli): daemon output + health colors 2026-01-15 08:31:02 +00:00
Peter Steinberger
91228778fe chore: prep 2026.1.14 npm release 2026-01-15 07:47:18 +00:00
Peter Steinberger
3578c96530 chore: drop Clawdis legacy references 2026-01-15 06:18:44 +00:00
Peter Steinberger
f7bfa0dfb9 feat: profile-aware gateway service names (#671)
Thanks @bjesuiter.

Co-authored-by: Benjamin Jesuiter <bjesuiter@gmail.com>
2026-01-15 05:23:41 +00:00
Peter Steinberger
74055124ab fix: unblock launchctl stub on windows 2026-01-15 03:58:32 +00:00
Peter Steinberger
7359d4351d fix(daemon): clear launchd disabled state before bootstrap (#849) (thanks @ndraiman) 2026-01-15 03:35:24 +00:00
Netanel Draiman
4d57fc33ec fix(daemon): enable launchd service before bootstrap
When a launchd service is uninstalled via bootout, macOS marks it as
disabled in /var/db/com.apple.xpc.launchd/disabled.*.plist. This persists
across reboots and plist recreation. Future bootstrap calls fail with
error 5 (I/O error) because the service is still marked disabled.

Fix: Call 'launchctl enable' before 'launchctl bootstrap' to clear the
disabled state, matching the fix already applied to the macOS Swift app
in GatewayLaunchAgentManager.swift.

Related: #306
2026-01-15 03:31:52 +00:00
Peter Steinberger
9d28441c41 chore: migrate to oxlint and oxfmt
Co-authored-by: Christoph Nakazawa <christoph.pojer@gmail.com>
2026-01-14 15:02:19 +00:00
Peter Steinberger
b74a102af7 refactor(src): split oversized modules 2026-01-14 01:17:56 +00:00
Peter Steinberger
69228ca766 fix: finish channels rename sweep 2026-01-13 08:40:40 +00:00
Peter Steinberger
500b7c1dd0 fix: honor gateway service override labels 2026-01-13 05:58:49 +00:00
Peter Steinberger
ad0e62b9ea fix: improve daemon node selection 2026-01-12 08:33:32 +00:00
Peter Steinberger
f47b7816ba test: cover auto-reply command gating 2026-01-11 02:27:16 +01:00
Peter Steinberger
3e2b22c0a8 feat: improve gateway services and auto-reply commands 2026-01-11 02:27:16 +01:00
Peter Steinberger
be51d30a49 feat(cli): colorize gateway health + daemon output 2026-01-10 03:01:27 +01:00
Peter Steinberger
a9677bc137 fix: harden onboarding for non-systemd environments 2026-01-09 22:17:09 +01:00
Peter Steinberger
8f4592a883 fix: audit doctor service entrypoint 2026-01-09 17:50:28 +01:00
Ogulcan Celik
45c2d41727 fix: prevent systemd hang on restart with podman sandboxes
Add KillMode=process to generated systemd unit file. Without this,
podman's conmon processes (which monitor sandbox containers) block
shutdown since they're children of the gateway process.

This preserves the desired behavior of keeping containers alive
across restarts while preventing systemd from waiting indefinitely.
2026-01-09 02:37:00 +01:00
Peter Steinberger
d219e8a5c3 fix(daemon): normalize audit paths 2026-01-08 22:28:51 +00:00
Peter Steinberger
baa2abe7e6 fix(daemon): audit runtime best practices 2026-01-08 22:18:07 +00:00
Peter Steinberger
8706f8da2b feat(doctor): add repair/force flows 2026-01-08 21:47:35 +01:00
Peter Steinberger
b8b0994a44 feat(doctor): audit supervisor config + docs 2026-01-08 21:28:48 +01:00
Azade
ee875dc148 fix(daemon): align systemd unit with documentation
Align generated systemd service file with docs:
https://docs.clawd.bot/gateway#supervision-systemd-user-unit

Adds:
- After=network-online.target
- Wants=network-online.target
- RestartSec=5
2026-01-08 21:16:19 +01:00
Peter Steinberger
e2a06a49c0 feat: expand daemon status diagnostics 2026-01-08 08:26:40 +01:00
Peter Steinberger
65f73e6862 fix: wire gateway auth diagnostics into doctor 2026-01-08 08:26:40 +01:00
Peter Steinberger
497816dc80 refactor: simplify cli commands 2026-01-08 07:16:12 +01:00
Peter Steinberger
94df39738b fix(ci): stabilize windows tests 2026-01-08 02:44:19 +00:00
Peter Steinberger
b93e9dd5da refactor: split port diagnostics helpers 2026-01-08 02:42:43 +01:00