Summary
On a Control UI instance with a large accumulated session store (~116 visible sessions), routine sessions.list refreshes can create noticeable Gateway stalls and liveness warnings. The most visible path is the chat-turn completion refresh: Control UI requests recent sessions with activeMinutes and a relatively broad limit, which forces repeated row/model/session enrichment work during normal chat use.
This is narrower than #76562, but likely part of the same control-plane latency family.
Observed locally
Environment:
- OpenClaw
2026.5.2
- macOS / Node 22
- Control UI direct webchat
- ~116 active/visible sessions in the session store
Before local mitigation:
openclaw sessions --json: ~16.3s
- imported
listSessionsFromStoreAsync({}): ~20.4s
limit:20: ~3.9s
- cold Control UI reconnect could produce
sessions.list spikes around ~16-19s
- liveness warnings showed event-loop delay spikes in the ~1-3s range during active UI/tooling work
After local mitigation:
- steady
sessions.list: ~69-124ms
- Gateway reachable: ~196ms
- quiet CPU sample: ~0.2%, sleeping
- remaining cold reconnect RPCs (
node.list, chat.history) can still briefly spike around ~0.9-1.2s, so this is not a full control-plane fix
Suspected hot paths
The local profile/debugging pointed at two avoidable costs:
buildGatewaySessionRow calling isCliProvider repeatedly across many rows, which can repeatedly reach plugin/setup CLI backend discovery.
- Control UI chat lifecycle refreshes asking for a broader session window than the chat sidebar needs.
Some source-side work on main already appears to have improved session row hydration, but the chat completion refresh can still be bounded more aggressively.
Proposed fix
A small PR is coming that:
- caches
isCliProvider lookup results by normalized provider + configured CLI backend keys
- caps the Control UI chat-turn session refresh to the small recent-window count the sidebar needs
This should reduce normal chat-turn control-plane pressure without changing the explicit Sessions page/search flows.
Related
Summary
On a Control UI instance with a large accumulated session store (~116 visible sessions), routine
sessions.listrefreshes can create noticeable Gateway stalls and liveness warnings. The most visible path is the chat-turn completion refresh: Control UI requests recent sessions withactiveMinutesand a relatively broad limit, which forces repeated row/model/session enrichment work during normal chat use.This is narrower than #76562, but likely part of the same control-plane latency family.
Observed locally
Environment:
2026.5.2Before local mitigation:
openclaw sessions --json: ~16.3slistSessionsFromStoreAsync({}): ~20.4slimit:20: ~3.9ssessions.listspikes around ~16-19sAfter local mitigation:
sessions.list: ~69-124msnode.list,chat.history) can still briefly spike around ~0.9-1.2s, so this is not a full control-plane fixSuspected hot paths
The local profile/debugging pointed at two avoidable costs:
buildGatewaySessionRowcallingisCliProviderrepeatedly across many rows, which can repeatedly reach plugin/setup CLI backend discovery.Some source-side work on
mainalready appears to have improved session row hydration, but the chat completion refresh can still be bounded more aggressively.Proposed fix
A small PR is coming that:
isCliProviderlookup results by normalized provider + configured CLI backend keysThis should reduce normal chat-turn control-plane pressure without changing the explicit Sessions page/search flows.
Related