* @brief Clears history and UI state. Aborts any in-flight reply. */
| 311 | * @brief Clears history and UI state. Aborts any in-flight reply. |
| 312 | */ |
| 313 | void AI::Conversation::clear() |
| 314 | { |
| 315 | cancel(); |
| 316 | m_history = QJsonArray(); |
| 317 | m_uiMessages.clear(); |
| 318 | m_assistantIndex = -1; |
| 319 | m_assistantText.clear(); |
| 320 | m_pendingThinkingBlocks = QJsonArray(); |
| 321 | m_pendingToolUseBlocks = QJsonArray(); |
| 322 | m_pendingToolResultBlocks = QJsonArray(); |
| 323 | m_outstandingToolResults = 0; |
| 324 | m_awaitingConfirm.clear(); |
| 325 | setLastError(QString()); |
| 326 | |
| 327 | Q_EMIT messagesChanged(); |
| 328 | } |
| 329 | |
| 330 | //-------------------------------------------------------------------------------------------------- |
| 331 | // Reply slot handlers |
no outgoing calls
no test coverage detected