fix(desktop): prefer sips image backend on macOS for OpenClaw process#674
Merged
fix(desktop): prefer sips image backend on macOS for OpenClaw process#674
Conversation
added 3 commits
March 30, 2026 17:56
OpenClaw's image optimization pipeline depends on sharp (native Node.js addon). In packaged Desktop builds, sharp's native binaries may fail to load, causing "Failed to optimize image" errors when users send images to bots via Discord/Slack/Feishu/WeChat. Set OPENCLAW_IMAGE_BACKEND=sips for the OpenClaw process on macOS, using the system-native sips tool instead of sharp. Covers both launchd mode (plist-generator) and dev/orchestrator mode (openclaw-process spawn env). Closes #424
Deploying nexu-docs with
|
| Latest commit: |
03c8844
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://dd15d6f1.nexu-docs.pages.dev |
| Branch Preview URL: | https://fix-image-recognition-sips.nexu-docs.pages.dev |
lefarcen
approved these changes
Mar 30, 2026
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Set
OPENCLAW_IMAGE_BACKEND=sipsfor the OpenClaw process on macOS, using the system-nativesipstool for image processing instead ofsharp.Why
Users across all channels (Discord, Slack, Feishu, WeChat) report "Failed to optimize image" when sending pictures to bots (#424, #429, #385, #569). Root cause: OpenClaw's image optimization depends on
sharp(native Node.js addon), which may fail to load in packaged Desktop builds. macOS has a built-insipstool that can handle the same image operations without native binary dependencies.How
OPENCLAW_IMAGE_BACKEND=sipsto the OpenClaw plist environment inplist-generator.tsOPENCLAW_IMAGE_BACKEND=sipsinjection inopenclaw-process.tsspawn env (macOS only viaprocess.platform === "darwin")prefersSips()function reads this env var and routes image processing through/usr/bin/sipsinstead ofsharpThis is the Nexu-side fix. A complementary OpenClaw-side fix adds graceful degradation (
loadWebMediaRawfallback) for non-macOS platforms.Affected areas
Checklist
pnpm typecheckpassespnpm lintpassespnpm testpassespnpm generate-typesrun (if API routes/schemas changed)anytypes introduced (useunknownwith narrowing)Notes for reviewers
loadImageFromRef()fallback toloadWebMediaRawwhen optimization fails