Skip to content

Commit 655bde2

Browse files
committed
tick fix
1 parent d57354e commit 655bde2

1 file changed

Lines changed: 12 additions & 4 deletions

File tree

src/CasCap.SmartHaus/Services/CommunicationsBgService.Messaging.cs

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -266,14 +266,22 @@ await _notifier.SendProgressUpdateAsync(
266266
debugSteps.Count(s => s.Result?.Usage is not null));
267267
await _debugNotifier.SendDebugStatsAsync(request.Prompt, agentResult!, debugSteps,
268268
request.BinaryContent, request.MimeType, cancellationToken);
269+
270+
// Green tick reaction to indicate successful processing.
271+
if (request.Sender is not null && request.Timestamp is not null)
272+
await _notifier.SendProgressUpdateAsync(
273+
_signalCliConfig.PhoneNumber, _groupId!, "\u2705", request.Sender, request.Timestamp.Value);
269274
}
270275
else
276+
{
271277
LogAgentEmptyResponse(_logger, nameof(CommunicationsBgService));
272278

273-
// Green tick reaction to indicate successful processing.
274-
if (request.Sender is not null && request.Timestamp is not null)
275-
await _notifier.SendProgressUpdateAsync(
276-
_signalCliConfig.PhoneNumber, _groupId!, "\u2705", request.Sender, request.Timestamp.Value);
279+
// Red cross reaction: the agent failed (e.g. remote inference error) or
280+
// produced no usable response, so do not signal success to the user.
281+
if (request.Sender is not null && request.Timestamp is not null)
282+
await _notifier.SendProgressUpdateAsync(
283+
_signalCliConfig.PhoneNumber, _groupId!, "\u274C", request.Sender, request.Timestamp.Value);
284+
}
277285
}
278286
catch (Exception ex) when (ex is not OperationCanceledException and not TaskCanceledException)
279287
{

0 commit comments

Comments
 (0)