fix(realtime): handle response_cancel_not_active as non-fatal#3795
Conversation
Codecov Report❌ Patch coverage is
... and 97 files with indirect coverage changes 🚀 New features to boost your workflow:
|
kollaikal-rupesh
left a comment
There was a problem hiding this comment.
Nice fix! The approach is correct — response_cancel_not_active should definitely not be fatal.
One minor suggestion: consider using logger.debug() instead of logger.warning() here. This error is an expected, benign condition in push-to-talk mode — every time the user presses the button while the bot is idle, this will fire. Using warning could create log noise in production for something that's completely normal. debug would be more appropriate for an expected code path.
Also, minor style nit: the pipecat convention for log messages typically prefixes with {self} for service identification, e.g.:
logger.debug(f"{self} {evt.error.message}")| await self._handle_evt_error(evt) | ||
| return | ||
| if evt.error.code == "response_cancel_not_active": | ||
| logger.warning(f"Non-fatal API error: {evt.error.message}") |
There was a problem hiding this comment.
This was suggested already, but this should be debug. If it's a warning, it'll draw undue attention since it's a normal outcome of using the API.
There was a problem hiding this comment.
make sense, done
Please describe the changes in your PR. If it is addressing an issue, please reference that as well.
Fixes #3755
Change :
response_cancel_not_activeerrors from the API are now logged as warnings instead of fatally killing the ws connection in realtime services.