Skip to content

Commit df88d62

Browse files
committed
Add debug logging for retry behavior diagnostics
1 parent 8ac91a9 commit df88d62

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

cli/src/hooks/use-send-message.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2004,6 +2004,20 @@ export const useSendMessage = ({
20042004
const shouldRetryError =
20052005
timedOutDueToSdk || !isConnectedRef.current || isRetryableError(error)
20062006

2007+
// Debug: Log what's triggering retry
2008+
if (shouldRetryError) {
2009+
logger.warn(
2010+
{
2011+
userMessageId,
2012+
errorMessage,
2013+
timedOutDueToSdk,
2014+
isConnected: isConnectedRef.current,
2015+
isRetryableError: isRetryableError(error),
2016+
},
2017+
'[RETRY-DEBUG] Error detected as retryable - will retry',
2018+
)
2019+
}
2020+
20072021
// Only mark as interrupted and show error if NOT retrying
20082022
// (retryable errors will be retried silently)
20092023
if (!shouldRetryError) {

0 commit comments

Comments
 (0)