← Back to library

Cron 会话“到期换新后在 UI 消失”排障:同步刷新 sessionFile 路径

问题/场景:isolated cron 会话过期后生成新 sessionId,但索引仍指向旧 `sessionFile`,导致 UI/TUI 看不到新会话。前置条件:存在会话滚动(session roll)场景并可查看 sessions index。实施步骤:升级到含 PR #20188 的版本→构造会话过期与滚动→核对新 sessionId 与 sessionFile 一致。关键点:新 session 必须重算 transcript 路径。验证:新会话在 UI/TUI 可见。风险:历史脏索引可能需一次性清理(需验证)。

GITHUBDiscovered 2026-02-19Author jriff
Prerequisites
  • You run cron isolated jobs and can observe session rollover after expiration.
  • You can inspect sessions index/session files on disk and compare UI visibility.
Steps
  1. Upgrade to build containing PR #20188 and restart gateway.
  2. Trigger one cron job run, wait for session expiry condition, then trigger next run to force new sessionId.
  3. Inspect session entry and ensure `sessionFile` path matches the new sessionId transcript path.
  4. Open UI/TUI sessions list and verify rolled session appears with latest timestamps.
Commands
openclaw cron runs --id <jobId>
openclaw gateway status
openclaw gateway restart
Verify

Rolled cron sessions remain visible in UI/TUI and no stale sessionFile pointer remains in sessions index.

Caveats
  • If rollover condition is hard to trigger in your environment, use a short test expiry window first(需验证).
  • Do not manually rewrite session index in production without backup.
Source attribution

This tip is aggregated from community/public sources and preserved with attribution.

Open original source ↗
Visit original post