GitHub Issue:修复重启后 sessions.json 写入绝对路径导致会话失效
解决“Gateway 重启后绑定/会话恢复报错”的场景:建立会话文件路径规范与重启后校验,避免 `sessionFile` 被写成绝对路径。
GITHUBDiscovered 2026-02-13Author miranmind
Prerequisites
- You can inspect and back up the runtime `sessions.json` file before restart tests.
- OpenClaw version is v2026.2.12 or nearby builds where restart regression may appear.
Steps
- Back up `sessions.json` and record one known-good session entry before restarting gateway.
- Restart gateway once, then diff `sessionFile` fields and check whether any absolute paths are introduced.
- If absolute paths appear, convert them back to sessions-directory-relative paths and keep path normalization in your maintenance script.
- Re-run binding/session restore flow to confirm the path validation error is gone.
Commands
openclaw gateway statusopenclaw gateway restartopenclaw logs --local-timeVerify
After restart, session restore/binding works and no `Session file path must be within sessions directory` error appears.
Caveats
- Do not batch-edit `sessions.json` without backup; malformed JSON can break startup.
- Final fix may land in newer upstream patch; verify against release notes before removing workaround(需验证)。
Source attribution
This tip is aggregated from community/public sources and preserved with attribution.
Open original source ↗