Repository navigation
fix(twilio): log whether a line cut into is set to be said again, and why it wasn't - #1494
Merged
Merged
Conversation
… 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]>
Contributor
Qodo reviews are paused for this user.Troubleshooting steps vary by plan Learn more → On a Teams plan? Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center? |
There was a problem hiding this comment.
🟡 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."); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

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.
ResumeAfterCutInSecondsshould 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.
Tests
The relay tests in
BotSharp.Core.UnitTests(ConversationRelay*): 14 of 14.🤖 Generated with Claude Code