Core: log reply attempts and surface send failures

Log every command reply (target + size, debug) and warn when the plugin's
sendTextMessage returns an error instead of silently discarding it.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
faumarayandClaude Opus 4.8 committed 2026-06-26 02:39:10 +03:00
1 parent 5796ccbc74
commit 352101e657
1 file changed
+15 -1
+15 -1
View File
@@ -1246,9 +1246,23 @@ namespace Echoion::Core
// Create reply callback
auto replyFunc = [this](uint64_t clientId,
std::string_view message) {
Void::Log::debug(
"Core", "{}",
std::format("Reply -> client {} ({} bytes)",
clientId, message.size()));
if (pluginInterface_) {
pluginInterface_->sendTextMessage(
auto sent = pluginInterface_->sendTextMessage(
clientId, std::string(message));
if (!sent) {
Void::Log::warn(
"Core", "{}",
std::format("Reply send failed: {}",
sent.error().message));
}
} else {
Void::Log::warn("Core", "{}",
"Reply dropped: no plugin "
"interface");
}
};