MCPcopy Create free account
hub / github.com/Serial-Studio/Serial-Studio / cancel

Method cancel

app/src/AI/Conversation.cpp:206–228  ·  view source on GitHub ↗

* @brief Aborts the in-flight reply and cancels any pending confirmations. */

Source from the content-addressed store, hash-verified

204 * @brief Aborts the in-flight reply and cancels any pending confirmations.
205 */
206void AI::Conversation::cancel()
207{
208 m_cancelled = true;
209 m_streamFlushTimer->stop();
210 m_streamDirty = false;
211 if (m_reply)
212 m_reply->abort();
213
214 if (!m_awaitingConfirm.isEmpty()) {
215 for (auto it = m_awaitingConfirm.constBegin(); it != m_awaitingConfirm.constEnd(); ++it)
216 updateToolCallCard(it.key(), CallStatus::Denied);
217
218 m_awaitingConfirm.clear();
219 setAwaitingConfirmation(false);
220 }
221
222 m_pendingThinkingBlocks = QJsonArray();
223 m_pendingToolUseBlocks = QJsonArray();
224 m_pendingToolResultBlocks = QJsonArray();
225 m_outstandingToolResults = 0;
226
227 setBusy(false);
228}
229
230/**
231 * @brief Approves a pending Confirm-tagged tool call by id.

Callers

nothing calls this directly

Calls 5

isEmptyMethod · 0.80
keyMethod · 0.80
stopMethod · 0.45
abortMethod · 0.45
clearMethod · 0.45

Tested by

no test coverage detected