Skip to content

fix(twilio): log whether a line cut into is set to be said again, and why it wasn't - #1494

Merged
yileicn merged 1 commit into
SciSharp:masterfrom
yuyixg:fix/relay-resume-diagnostics
Nov 13, 2026
Merged

yileicn merged 1 commit into
SciSharp:masterfrom
yuyixg:fix/relay-resume-diagnostics

Conversation

@yuyixg

@yuyixg yuyixg commented Nov 13, 2026

Copy link
Copy Markdown
Contributor

Why

On a ConversationRelay call the caller cut into a question after half a second, nothing followed for about six seconds, and the question was never said again. ResumeAfterCutInSeconds should have said it again, but nothing in the logs showed which of two things happened: the caller had started talking within that time (which cancels saying it again, by design), or the line was never set to be said again (the setting off for the agent).

What

Logs only; nothing said on a call changes.

  • The interrupt's log line now says when the line will be said again if nothing follows, and after how many seconds.
  • A line set to be said again and dropped because the caller spoke is logged, with how soon after the cut-in.

Tests

The relay tests in BotSharp.Core.UnitTests (ConversationRelay*): 14 of 14.

🤖 Generated with Claude Code

… why it wasn't

After a cut-in the line never came back and the call sat silent for about six
seconds, and nothing in the logs showed whether the caller had started talking
(which cancels saying it again) or the line was never set to be said again
(ResumeAfterCutInSeconds off for the agent).

- The interrupt's log line says when the line will be said again if nothing follows,
  and after how many seconds.
- A line set to be said again and dropped because the caller spoke is logged, with
  how soon after the cut-in.

No change to what is said.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@qodo-code-review

Copy link
Copy Markdown
Contributor

Qodo reviews are paused for this user.

Troubleshooting steps vary by plan Learn more →

On a Teams plan?
Reviews resume once this user has a paid seat and their Git account is linked in Qodo.
Link Git account →

Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center?
These require an Enterprise plan - Contact us
Contact us →

@yileicn
yileicn requested a lite review from Copilot November 13, 2026 08:43
@yileicn
yileicn merged commit 5c6a610 into SciSharp:master Nov 13, 2026
4 checks passed

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

An active finding remains because the diagnostic can misleadingly report that the caller spoke when the interaction was actually cancelled by DTMF input.

1 open issue
What changed in this PR

Improves ConversationRelay diagnostics by logging whether an interrupted agent line is scheduled for replay and why a scheduled replay is cancelled, without changing call behavior.

Changes:

  • Logs the configured replay delay when an interrupted line is eligible for replay.
  • Logs when caller activity cancels a pending replay, including elapsed time since the interruption.
  • Limits changes to diagnostic logging in the ConversationRelay session flow.
File Description
src/​Plugins/​BotSharp.Plugin.Twilio/​Services/​ConversationRelaySession.cs Adds replay-status and cancellation diagnostics to the ConversationRelay interruption and resume flow.

Review effort: Lite

Comment on lines +948 to +949
_logger.LogInformation($"The caller spoke within {(DateTime.UtcNow - _cutInUtc).TotalSeconds:0.0} s of cutting in, " +
$"in conversation {_conversationId}; the line they cut into is not said again.");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants