Commit Graph

367 Commits

Author SHA1 Message Date
Bryan Pearson
a2b8f2aef0 fix(launchd): set ProcessType=Interactive to prevent macOS App Nap
The gateway launchd plist does not set ProcessType, so macOS treats it as a background process eligible for App Nap. When the system is idle, App Nap can suspend the process and freeze setTimeout-based heartbeat timers.

Setting ProcessType to Interactive tells launchd the process needs timely execution.

Fixes #58061; refs #62294 and #66992.
2026-05-09 16:39:27 +05:30
Val Alexander
fa79e9754e fix(gateway): harden macOS update restart lifecycle
Summary:
- Clear stale SIGUSR1 restart state before rejected or externally allowed restart handling can leave an in-flight token stuck.
- Verify the live gateway version after macOS package-update service refreshes and skip redundant restarts when the refreshed LaunchAgent already serves the expected version.
- Set generated LaunchAgents to a 10s throttle plus 20s shutdown window and widen gateway bind retries around supervisor-owned restarts.

Fixes #79577. Refs #78699 and #60885.

Verification:
- pnpm test src/cli/gateway-cli/run-loop.test.ts src/infra/infra-runtime.test.ts
- pnpm test src/cli/update-cli.test.ts src/daemon/launchd.test.ts src/gateway/server/http-listen.test.ts
- pnpm exec oxfmt --check --threads=1 src/cli/gateway-cli/run-loop.ts src/cli/gateway-cli/run-loop.test.ts
- pnpm check:changed
- Crabbox/Blacksmith wrapper smoke passed focused tests plus pnpm check:changed: https://github.com/openclaw/openclaw/actions/runs/25595985603
- PR CI was green before upstream main advanced; the latest rebased heads hit unrelated broad lint failures also reproduced on current main CI (for example https://github.com/openclaw/openclaw/actions/runs/25598671666). No failing lint diagnostics referenced this gateway/update diff.
2026-05-09 05:21:17 -05:00
Shakker
5c9755d347 test: tighten e2e array assertions 2026-05-09 06:03:18 +01:00
Shakker
e2d8b78b69 test: tighten daemon infra array assertions 2026-05-09 05:56:26 +01:00
Shakker
3ee3fd72bb test: tighten registry empty array assertions 2026-05-09 05:40:02 +01:00
Peter Steinberger
6dfbee78e4 test: simplify launchd event parsing 2026-05-09 01:02:42 +01:00
Andy Ye
368c21e211 fix(daemon): include Homebrew in macOS service PATH
Summary:
- Document the canonical macOS LaunchAgent PATH including Apple Silicon Homebrew bin directories.
- Add service-audit regression coverage that flags stale macOS service PATHs missing Homebrew directories.
- Record the user-facing Gateway/macOS fix in the changelog.

Verification:
- Exact PR head 8aa19dde07 was approved, CLEAN, and MERGEABLE before merge.
- GitHub exact-head CI/check-docs/proof lanes were green with no failing or pending check runs.
- pnpm exec oxfmt --check --threads=1 CHANGELOG.md docs/gateway/doctor.md src/daemon/service-audit.test.ts src/daemon/service-env.ts src/daemon/service-env.test.ts src/commands/daemon-install-helpers.test.ts
- pnpm check:changelog-attributions
2026-05-08 17:59:46 -05:00
Peter Steinberger
aa34ce41a1 test: avoid single result filter assertions 2026-05-08 22:19:50 +01:00
Peter Steinberger
ce515dbf4d test: avoid misc count filter allocations 2026-05-08 22:05:41 +01:00
Peter Steinberger
150ded8f27 test: tighten core capture assertions 2026-05-08 20:44:46 +01:00
Shakker
62bafd4e6e test: tighten systemd status assertions 2026-05-08 20:09:21 +01:00
Shakker
069aa10c18 test: tighten service audit drift assertion 2026-05-08 17:13:12 +01:00
Super Zheng
e7277b4e3a refactor(agents): preserve raw reasoning stream and push formatting to edge (#78397)
Merged via squash.

Prepared head SHA: bb56f7ee00
Co-authored-by: medns <1575008+medns@users.noreply.github.com>
Co-authored-by: odysseus0 <8635094+odysseus0@users.noreply.github.com>
Reviewed-by: @odysseus0
2026-05-08 06:08:21 -07:00
Peter Steinberger
5099e4712e test: clarify daemon launchd signal assertion 2026-05-08 11:07:39 +01:00
Peter Steinberger
e132e3a539 test: clarify daemon path assertion 2026-05-08 10:57:27 +01:00
Val Alexander
84fe3c5409 fix(daemon): include homebrew paths in launchagent env (#79331) 2026-05-08 04:31:30 -05:00
Peter Steinberger
c94641c08b test: clarify launchd command assertions 2026-05-08 09:09:16 +01:00
Peter Steinberger
9730be1bba test: reuse daemon service audit helper 2026-05-08 08:55:31 +01:00
Peter Steinberger
c2ffe1fd04 test: remove redundant service path assertions 2026-05-08 08:51:51 +01:00
Peter Steinberger
1f88cb2ce5 fix(gateway): persist macOS stop disable after bootout
Summary:
- carry forward #78412's macOS LaunchAgent bootout-by-default stop behavior and repair guard
- fix the remaining `gateway stop --disable` tail when the service is already not loaded after bootout
- add lifecycle regressions, docs, and changelog

Verification:
- pnpm install
- pnpm test src/cli/daemon-cli/lifecycle-core.test.ts src/cli/daemon-cli/lifecycle.test.ts src/daemon/launchd.test.ts
- pnpm exec oxfmt --check --threads=1 CHANGELOG.md src/cli/daemon-cli/lifecycle-core.ts src/cli/daemon-cli/lifecycle.ts src/cli/daemon-cli/lifecycle-core.test.ts src/cli/daemon-cli/lifecycle.test.ts docs/cli/gateway.md docs/gateway/index.md src/daemon/launchd.ts src/daemon/launchd.test.ts src/cli/daemon-cli/register-service-commands.ts src/cli/daemon-cli/types.ts src/daemon/service-types.ts
- git diff --check origin/main...HEAD
- pnpm build
- Parallels macOS Tahoe VM reproduce/fix proof in PR body
- PR checks green: Real behavior proof, auto-response, dispatch, label, label-issues

Co-authored-by: wdeveloper16 <25180374+wdeveloper16@users.noreply.github.com>
2026-05-08 05:35:21 +01:00
Peter Steinberger
9ef37d1907 test: tighten assertions and harness coverage 2026-05-08 05:28:12 +01:00
Peter Steinberger
955b025697 feat: add native sqlite Kysely dialect
Add an owned Kysely dialect for native node:sqlite, raise the Node 22 floor to 22.16+ for StatementSync.columns(), and cover select/returning/stale insert id behavior.
2026-05-07 13:07:03 +01:00
拐爷&&老拐瘦
03e6a029ab Windows startup: handle localized schtasks access denied
Fixes #77993.\n\nMaintainer-prepped by rebasing onto current main, keeping the localized Windows schtasks Access Denied fallback scoped, adding focused regression coverage and changelog, and verifying local gates plus green CI.\n\nCo-authored-by: 拐爷&&老拐瘦 <geyunfei@gmail.com>\nCo-authored-by: Brad Groux <3053586+BradGroux@users.noreply.github.com>
2026-05-06 00:36:54 -05:00
Peter Steinberger
538605ff44 [codex] Extract filesystem safety primitives (#77918)
* refactor: extract filesystem safety primitives

* refactor: use fs-safe for file access helpers

* refactor: reuse fs-safe for media reads

* refactor: use fs-safe for image reads

* refactor: reuse fs-safe in qqbot media opener

* refactor: reuse fs-safe for local media checks

* refactor: consume cleaner fs-safe api

* refactor: align fs-safe json option names

* fix: preserve fs-safe migration contracts

* refactor: use fs-safe primitive subpaths

* refactor: use grouped fs-safe subpaths

* refactor: align fs-safe api usage

* refactor: adapt private state store api

* chore: refresh proof gate

* refactor: follow fs-safe json api split

* refactor: follow reduced fs-safe surface

* build: default fs-safe python helper off

* fix: preserve fs-safe plugin sdk aliases

* refactor: consolidate fs-safe usage

* refactor: unify fs-safe store usage

* refactor: trim fs-safe temp workspace usage

* refactor: hide low-level fs-safe primitives

* build: use published fs-safe package

* fix: preserve outbound recovery durability after rebase

* chore: refresh pr checks
2026-05-06 02:15:17 +01:00
Vincent Koc
97d35f4c57 fix(gateway): clarify systemd service scope 2026-05-04 03:33:49 -07:00
Peter Steinberger
2b01bcf6c8 refactor: source service env install planning 2026-05-04 01:47:02 +01:00
HCL
f8f881f63f fix(daemon): preserve systemd env-file secrets on re-stage
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-04 00:34:18 +01:00
Peter Steinberger
1ace6a0d6a fix: avoid launchd kickstart after fresh bootstrap 2026-05-03 21:49:53 +01:00
Peter Steinberger
d0ad5c3eaa fix(daemon): prefer system node for gateway install 2026-05-03 21:48:57 +01:00
Peter Steinberger
b726214cf3 fix: avoid fresh launchd repair kickstart 2026-05-03 21:04:48 +01:00
Peter Steinberger
3b1a020eba fix: repair stale gateway service on start 2026-05-02 20:56:35 +01:00
Peter Steinberger
85ce75c005 fix(daemon): canonicalize macOS service PATH 2026-05-02 12:02:47 +01:00
Ayaan Zaidi
626a22decb refactor(daemon): reuse shared path normalizer 2026-05-02 16:20:50 +05:30
leonaIee
49b1b08444 fix: drop stale service PATH entries 2026-05-02 16:20:50 +05:30
Peter Steinberger
eb3e4f20a0 fix: relax gateway service path audit 2026-05-02 11:36:23 +01:00
Peter Steinberger
ca319906ce refactor: trim daemon and gateway helper exports 2026-05-02 03:05:44 +01:00
Peter Steinberger
6f52b06f9f refactor: trim crestodian and daemon internals 2026-05-02 02:54:13 +01:00
Peter Steinberger
bdda14e170 refactor: trim daemon service manager exports 2026-05-02 02:51:02 +01:00
Peter Steinberger
225b71db1e refactor: trim daemon runtime exports 2026-05-02 02:47:21 +01:00
Peter Steinberger
0871b9fcd8 refactor: trim daemon helper exports 2026-05-02 02:45:14 +01:00
Val Alexander
df0ee092f0 fix: harden gateway recovery diagnostics and media delivery
Harden gateway recovery diagnostics and media delivery.\n\n- Accept gateway send asVoice and map it to outbound audioAsVoice.\n- Preserve generated Swift protocol models for the gateway send schema.\n- Keep the broader recovery hardening for install/update/status/vector/TTS paths in one reviewed PR.\n\nProof:\n- Focused local gateway/outbound/update/status/doctor/sqlite-vec tests passed.\n- oxfmt --check and git diff --check passed.\n- Testbox OPENCLAW_TESTBOX=1 pnpm check:changed passed at 2f5ef650e97763a61ff43c28e61707db84c50060.\n- GitHub required checks are green at the merge SHA; the qa-lab parity gate is optional/surface-only and was still pending.
2026-04-30 21:46:22 -05:00
jesse-merhi
706eb8833f fix: filter launchd handoff environment 2026-04-29 13:51:42 +10:00
Sliverp
e0008268ad fix(onboarding): Improve the dynamic import UX. (#73419)
* fix(onboarding): skip redundant install prompt when only one source exists

When the channel-setup flow asks 'Install <plugin>?' after the user has
already picked the channel in the previous menu, and the only real
install source available is npm (or local), the prompt degenerates into
'<that source> vs Skip'. The user already expressed intent by picking
the channel, so re-confirming adds friction without offering a
meaningful choice.

Resolve directly to the available source in that case. Keep the prompt
when both npm and local sources exist so the user can still pick which
to use, and keep it when no real source exists (the prompt then only
offers Skip, which is informative).

* fix ci

* fix ci

* fix(channel-setup): skip redundant install prompt when only one source exists

Add autoConfirmSingleSource opt-in parameter to promptInstallChoice /
ensureOnboardingPluginInstalled / ensureChannelSetupPluginInstalled.
When set and only one real install source (npm or local, not both)
exists, the 'Install <plugin>? / Skip' prompt is skipped and the
single source is used directly.

Only channel-setup.ts passes autoConfirmSingleSource: true — the user
already expressed intent by picking the channel in the previous menu,
so re-confirming adds friction without a meaningful choice. The
onboarding and quickstart entry points keep the existing prompt
behavior unchanged.

Also fix findBundledPluginSourceInMap mock type in
onboarding-plugin-install.test.ts to avoid TS2345.

* fix(tests): revert auto-confirm test expectations and fix mock leak

- Revert 'offers registry npm specs' test to expect the prompt
  (autoConfirmSingleSource not passed)
- Revert channel-setup 'does not default to bundled local path' test
  to expect the prompt
- Reset findBundledPluginSourceInMap and
  resolveBundledInstallPlanForCatalogEntry mocks after the bundled
  prompt test to prevent cross-test leakage

* fix ci

* docs(changelog): add #73419
2026-04-29 10:41:42 +08:00
Pavan Kumar Gondhi
230f7122dd fix(security): prevent workspace PATH injection via service env and trash helpers (#73264)
* fix: address issue

* fix: address PR review feedback

* fix: address review-pr skill feedback

* fix: address PR review feedback

* fix: address PR review feedback

* fix: address build feedback

* fix: address PR review feedback

* docs: add changelog entry for PR merge
2026-04-28 21:30:51 +05:30
Jesse Merhi
2633b14914 feat(security): support operator-managed network proxy routing (#70044)
* feat: support operator-managed proxy routing

* docs: add network proxy changelog entry

* fix(proxy): restrict gateway bypass to loopback IPs

* fix(cli): harden container proxy URL checks

* docs(proxy): clarify gateway bypass scope

* docs: remove proxy changelog entry

* fix(proxy): clear startup CI guard failures

* fix(proxy): harden gateway proxy policy parsing

* fix(proxy): honor update shorthand proxy policy

* fix(cli): redact proxy URL suffixes

* test(proxy): keep gateway help off proxy startup

* fix(proxy): keep overlapping lifecycle active

* docs: add proxy changelog entry

---------

Co-authored-by: joshavant <830519+joshavant@users.noreply.github.com>
2026-04-28 00:20:47 -05:00
Peter Steinberger
a6141a5a41 fix: harden macOS gateway updates 2026-04-28 05:58:05 +01:00
Peter Steinberger
e1acb61317 refactor: expose SDK test helper subpaths 2026-04-28 03:28:17 +01:00
Peter Steinberger
dd0f5937d2 fix(doctor): avoid companion gateway service false positives 2026-04-27 23:30:29 +01:00
Peter Steinberger
0cc3c027a8 test: avoid slow home lookups in service audit tests 2026-04-27 23:23:15 +01:00
Peter Steinberger
abf5dea7dd fix(daemon): filter missing service path fallbacks 2026-04-27 23:16:04 +01:00