MCPcopy
hub / github.com/ValueCell-ai/ClawX / refreshVisibleSessionSummaries

Function refreshVisibleSessionSummaries

src/stores/chat.ts:225–245  ·  view source on GitHub ↗
(
  set: ChatSet,
  get: ChatGet,
  sessionKeys?: string[],
)

Source from the content-addressed store, hash-verified

223}
224
225async function refreshVisibleSessionSummaries(
226 set: ChatSet,
227 get: ChatGet,
228 sessionKeys?: string[],
229): Promise<void> {
230 const sessions = get().sessions;
231 const currentSessionKey = get().currentSessionKey;
232 const targetKeys = (sessionKeys && sessionKeys.length > 0
233 ? sessionKeys
234 : sessions.map((session) => session.key)
235 )
236 .filter((key) => key && !key.endsWith(':main') && key !== currentSessionKey);
237 if (targetKeys.length === 0) return;
238
239 try {
240 const summaries = await fetchSessionLabelSummaries(targetKeys);
241 applySessionLabelSummaries(set, summaries);
242 } catch (error) {
243 console.warn('[session summaries] refresh failed:', error);
244 }
245}
246
247function cleanSessionLabelText(text: string): string {
248 return text

Callers 2

loadGatewayHistoryFunction · 0.85

Calls 3

getFunction · 0.50

Tested by

no test coverage detected