OpenClaw Pet
A native OpenClaw plugin that turns user-supplied Codex-compatible pet atlases into transparent, always-on-top desktop pets on macOS and Windows 11. A display can combine its local OpenClaw activity with activity pulled from remote OpenClaw Gateways.
OpenClaw Pet
A native OpenClaw plugin that turns user-supplied Codex-compatible pet atlases into transparent, always-on-top desktop pets on macOS and Windows 11. A display can combine its local OpenClaw activity with activity pulled from remote OpenClaw Gateways.
Privacy
The plugin reduces OpenClaw lifecycle events to display-only pet state in the platform-neutral controller. Its versioned Gateway bridge exposes only an allowlisted { animation, changedAt, activityLabel, activity } snapshot. Activity labels are generated from fixed lifecycle phases and validated tool names; prompts, tool arguments, tool results, model output, arbitrary event titles/statuses, credentials, asset paths, and controller errors never enter a bridge snapshot. Session context is extensible by kind: cron runs show only the configured cron display name when available and the validated agent ID (Cron "name" · agent id); other sessions use a persisted session display name when available (Session "name" · agent id) and otherwise the generic Session · agent id shape. The plugin never reads transcript text for display. Prompts, delivery targets, raw session keys, job identifiers, and run identifiers are never displayed. Labels are trimmed, control characters are removed, and bounded to 80 characters. Do not put secrets in a session or cron name.
Remote sources are pull-only: the display host periodically fetches the remote plugin's gateway-authenticated /api/openclaw-pet/v1/snapshot bridge endpoint and validates the complete response against the strict bridge contract. A response containing unknown fields is rejected. Gateway credentials are resolved from the display host's environment and used only for Gateway authentication. Token-authenticated remote sources must use HTTPS; loopback HTTP is accepted only for local development and SSH tunnels.
The native overlay receives source IDs, display labels, availability, sanitized pet state, layout, and locally hosted sprite sheets over an ephemeral HTTP server bound to 127.0.0.1. Every source's assetDir is a display-host-local setting and never appears in either the Gateway bridge or renderer state JSON.
The Windows WebView2 helper only permits navigation to that loopback origin and the internal watchdog/resize signals. The macOS and Windows helpers accept the same arguments and resize each pet window when the display host changes its runtime size.
Both native helpers load the same renderer from the loopback server. If that renderer cannot reach /state for 10 consecutive seconds, its watchdog asks the native helper to exit so a Gateway crash cannot leave an orphaned pet running indefinitely.
Setup
-
For each custom displayed pet, put
pet.jsonand a 1536-pixel-widespritesheet.webpwith 208-pixel animation rows in a directory on the display host. For the built-in OpenClaw creatures, setcreaturetolobster,crab,snail,duck, orjellyfishinstead. Lobsters additionally support all 42 OpenClaw flavors throughlobster.flavorand optional trait settings. -
Build on the OS where the plugin will run:
bash npm ci --ignore-scripts npm run build -
Install the local package with
openclaw plugins install ., then enable conversation access for the plugin and configureplugins.entries.openclaw-pet.config. -
Restart the Gateway. Use
/petfor status,/pet resetto return the local pet to idle,/pet resize 288to resize all pets, and/pet resize server 320to resize one source at runtime.
Example plugin config (use escaped backslashes in JSON on Windows):
{
"assetDir": "C:\\Users\\you\\openclaw-pet-assets",
"overlay": {
"enabled": true,
"size": 224,
"corner": "bottom-right",
"showStatus": false,
"clickThrough": false
}
}
Example plugin entry:
{
"plugins": {
"entries": {
"openclaw-pet": {
"enabled": true,
"hooks": {
"allowConversationAccess": true
},
"config": {
"assetDir": "C:\\Users\\you\\openclaw-pet-assets",
"overlay": {
"enabled": true,
"size": 224
}
}
}
}
}
}
Example lobster settings:
{
"creature": "lobster",
"lobster": {
"flavor": "blue",
"personality": "showoff",
"build": "round",
"clawSize": "mighty",
"antennae": "perky",
"accessory": "crown",
"tailFan": true,
"freckles": false
}
}
flavor selects one of: crimson, blue, gold, lumen, magma, oilslick, aurora, nebula, banana, mood, bee, rubberduck, watermelon, clawtron, selene, geode, ghost, glass, split, sourdough, zombie, plush, balloon, cryptid, flatpack, tinfoil, actual, cottoncandy, disco, chimera, pixel, blueprint, phosphor, ascii, portal, notexture, loading, eclipse, heisenbug, invisible, retro, or goldenretro. Source-level settings in sources[] override the top-level lobster settings.
hooks.allowConversationAccess lets OpenClaw deliver the lifecycle events needed for completion/failure states. The legacy assetDir form remains supported and creates one source named local.
The built-in creature SVGs are adapted from OpenClaw's canonical lobster-pet art and are served locally by the display host. See THIRD_PARTY_NOTICES.md for source paths and MIT attribution.
Multiple local and remote sources
Configure sources on the machine that owns the desktop display. A source without gateway follows the display host's local controller. A source with gateway is pulled from that remote OpenClaw installation. Every assetDir, including a remote source's pet art, is a path on the display host:
{
"sources": [
{
"id": "laptop",
"label": "Laptop",
"assetDir": "/Users/you/pets/laptop"
},
{
"id": "server",
"label": "Build server",
"assetDir": "/Users/you/pets/server",
"size": 288,
"gateway": {
"url": "https://openclaw.example.test/api/openclaw-pet/v1/snapshot",
"tokenEnv": "OPENCLAW_BUILD_SERVER_TOKEN",
"pollIntervalMs": 1000,
"timeoutMs": 5000
}
}
],
"overlay": {
"enabled": true,
"size": 224,
"corner": "bottom-right",
"clickThrough": false
}
}
Install and enable the plugin on each remote source Gateway. A source-only host can set overlay.enabled to false and does not need local pet assets; lifecycle events still drive its sanitized bridge snapshot. Put the token itself only in the display host environment variable named by tokenEnv. Token-authenticated bridge URLs must be https:// unless they are loopback http:// URLs used for local development or SSH tunnels.
Every display source needs display-host-local assets, either through source-level assetDir or top-level assetDir. Invalid source IDs, missing asset paths, invalid display assets, and unsafe token transports are skipped with a startup warning.
The display retains the last validated remote animation data but visibly marks a source unavailable whenever polling fails or returns a non-conforming snapshot. Polling never overlaps for a given source: the next poll is scheduled after the previous request finishes.
Each configured source is rendered in its own native helper window. Multiple pets start near the configured corner with a small stagger, then can be dragged independently when overlay.clickThrough is false.
Runtime sizing
overlay.size sets the startup size from 96 through 768 pixels. A source can set its own startup size with sources[].size. On a display host, change every current source without restarting through the write-scoped Gateway method:
openclaw gateway call openclaw-pet.resize --params '{"size":288}'
Resize one display source with sourceId:
openclaw gateway call openclaw-pet.resize --params '{"sourceId":"server","size":320}'
The equivalent chat commands are /pet resize 288 and /pet resize server 320. Runtime resizing also recomputes the initial stagger offsets so pets do not overlap after a size change; if you manually dragged a pet, a later resize may move it back near the configured corner. Runtime sizing is intentionally not part of openclaw-pet.bridge.snapshot; a source Gateway cannot change a display host's layout through the bridge. Runtime changes are in-memory and the configured overlay.size / sources[].size values are used again after restart.
overlay.clickThrough is optional and defaults to false, preserving draggable pet windows. Set it to true to pass pointer input to windows underneath the pets; click-through pets cannot be dragged, so change the corner in config and restart the Gateway to reposition them.
overlay.showStatus is optional and defaults to true. Set it to false to hide the status and recent-activity panel while keeping the animated pet visible. Hidden status panels do not leave an invisible interactive area beside the pet.
Build prerequisites
Use Node.js 24.15.0 and npm 11.12.1 for the verified development toolchain. npm ci --ignore-scripts restores the committed dependency graph without running dependency lifecycle scripts; the explicit build command compiles the helper. The development and peer SDK are pinned to OpenClaw 2026.9.1. Other SDK versions are unverified; widening the peer range requires compatibility checks. This pin records compile/import/registration-test compatibility, not a full live Gateway acceptance result.
- macOS: Xcode Command Line Tools with
swiftc.npm run build:overlaycompilesoverlay/pet-overlay.swifttodist/pet-overlay-macos. - Windows 11: the .NET SDK version in
global.json(10.0.400).npm run build:overlaypublishes a self-contained WPF helper for the current Node architecture todist/pet-overlay-win.exe; Swift is not required. The Evergreen WebView2 Runtime is part of Windows 11, but stripped-down or managed installations may need Microsoft’s runtime installed separately. - Other platforms: TypeScript can build, while the native-overlay step prints a no-op message.
pack:checkdeliberately fails because it cannot validate a supported desktop archive.
Run the full validation commands with:
npm run validate
openclaw plugins inspect openclaw-pet --runtime --json
openclaw plugins doctor
validate builds the native helper, runs the full test suite, creates a real .tgz, checks required compiled files and the platform executable, rejects a stale opposite-platform helper, and imports the compiled SDK entry. CI uses locked npm and NuGet restores and saves architecture-labelled archives. The host OS/compiler and Evergreen WebView2 runtime remain external inputs; this is dependency reproducibility, not a bit-for-bit binary guarantee. See verification and acceptance for test boundaries and desktop checks.
Run the two openclaw inspection commands after installing or linking the plugin. openclaw plugins build and openclaw plugins validate intentionally validate generated defineToolPlugin metadata and do not apply to this definePluginEntry service plugin. General static validation for definePluginEntry would be an upstream enhancement, not a blocker for this package.
Windows behavior and limitations
The Windows helper uses a borderless WPF window, WebView2 composition rendering, the Win32 topmost/non-activating styles, and an optional transparent input style. It does not appear in the taskbar or intentionally take focus.
- Corner placement currently uses the primary display’s work area.
- With the default
clickThrough: false, drag any pet to reposition that pet temporarily; its adjacent activity panel remains interactive whenshowStatusis enabled. - With
clickThrough: true, clicks pass through where Windows permits, but dragging is unavailable. - The build emits one architecture-specific executable. CI validates x64 on Windows Server 2025; Windows 11 desktop behavior still needs manual acceptance. ARM64 and x86 build paths exist but are not CI-verified.
Before release, manually smoke-test on Windows 11:
-
Hide the pets, drag the remaining status bubble, and confirm the separate
Show petscontrol works. -
Disconnect a remote source and confirm its last state remains visible with an unavailable indication.
-
Launching the overlay does not move focus away from the foreground application.
-
Dragging the default overlay does not activate it or switch the foreground application.
-
With
clickThrough: true, pointer input reaches an unrelated application underneath the overlay. -
Stop the Gateway and confirm the helper disappears; force-terminate the Gateway and confirm the watchdog closes the helper within about 10 seconds.
Before release, manually smoke-test on macOS:
-
Launch and drag the overlay without changing the foreground application.
-
Hide the pets, drag the remaining status bubble, and confirm the separate
Show petscontrol works. -
Disconnect a remote source and confirm its last state remains visible with an unavailable indication.
-
Each loopback renderer is transparent, animates, and remains draggable by default.
-
clickThrough: truepasses input through and disables dragging. -
Normal Gateway stop closes the helper, and the watchdog closes it after a forced Gateway termination.
