| 80 | } |
| 81 | |
| 82 | void LLMClientInterface::handleRequestFailed(const QString &requestId, const QString &error) |
| 83 | { |
| 84 | auto it = m_activeRequests.find(requestId); |
| 85 | if (it == m_activeRequests.end()) |
| 86 | return; |
| 87 | |
| 88 | const RequestContext &ctx = it.value(); |
| 89 | |
| 90 | LOG_MESSAGE(QString("Request %1 failed: %2").arg(requestId, error)); |
| 91 | |
| 92 | // Send LSP error response to client |
| 93 | QJsonObject response; |
| 94 | response["jsonrpc"] = "2.0"; |
| 95 | response[LanguageServerProtocol::idKey] = ctx.originalRequest["id"]; |
| 96 | |
| 97 | QJsonObject errorObject; |
| 98 | errorObject["code"] = -32603; // Internal error code |
| 99 | errorObject["message"] = error; |
| 100 | response["error"] = errorObject; |
| 101 | |
| 102 | emit messageReceived(LanguageServerProtocol::JsonRpcMessage(response)); |
| 103 | |
| 104 | m_activeRequests.erase(it); |
| 105 | m_performanceLogger.endTimeMeasurement(requestId); |
| 106 | } |
| 107 | |
| 108 | void LLMClientInterface::sendData(const QByteArray &data) |
| 109 | { |
nothing calls this directly
no test coverage detected