(
chatKey: string,
content: string,
requestId: string,
aiChatId: string | null = null
)
| 453 | } |
| 454 | |
| 455 | function setActiveTaskMeta( |
| 456 | chatKey: string, |
| 457 | content: string, |
| 458 | requestId: string, |
| 459 | aiChatId: string | null = null |
| 460 | ): void { |
| 461 | const state = getSessionState(chatKey) |
| 462 | if (!state) return |
| 463 | |
| 464 | activeTask.value = { |
| 465 | requestId, |
| 466 | chatKey, |
| 467 | sessionId: state.sessionId, |
| 468 | sessionName: state.sessionName, |
| 469 | chatType: state.chatType, |
| 470 | aiChatId, |
| 471 | questionPreview: content.trim().slice(0, 80), |
| 472 | startedAt: Date.now(), |
| 473 | } |
| 474 | } |
| 475 | |
| 476 | function clearActiveTask(chatKey: string, requestId?: string): void { |
| 477 | if (!activeTask.value) return |
no test coverage detected