Presence 与版本号一致性排障:统一版本优先级并验证广播路径
解决“状态广播不一致/版本号来源混乱”问题:按 OPENCLAW_VERSION > OPENCLAW_SERVICE_VERSION > npm_package_version 固定优先级,并统一 presence 广播路径。
GITHUBDiscovered 2026-02-18Author @gustavosant
Prerequisites
- You manage OpenClaw in multi-process or reverse-proxy setup where presence/version is monitored.
- Environment variable injection path is controllable (systemd, docker, or shell runtime).
Steps
- Set explicit version env vars in staging and restart gateway.
- Trigger presence snapshots from both normal system events and disconnect/reconnect flows.
- Confirm all clients receive the same version value according to precedence rules.
- Run regression tests around presence routing and version precedence.
- Promote config to production only after consistent snapshot behavior is observed.
Commands
export OPENCLAW_VERSION="2026.02.18-custom"export OPENCLAW_SERVICE_VERSION="2026.02.18-service"openclaw gateway restartpnpm test src/gateway/server/presence-events.test.ts src/version.test.ts src/infra/system-presence.test.ts src/infra/system-presence.version.test.tsVerify
Presence snapshots from different event paths report identical version values and precedence behavior matches release expectation.
Caveats
- Test command paths may differ in packaged installs (without source tree).
- Version env overrides can hide packaging mistakes if left permanently enabled(需验证).
Source attribution
This tip is aggregated from community/public sources and preserved with attribution.
Open original source ↗