( set: ChatSet, get: ChatGet, sessionKeys?: string[], )
| 223 | } |
| 224 | |
| 225 | async 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 | |
| 247 | function cleanSessionLabelText(text: string): string { |
| 248 | return text |
no test coverage detected