Skip to content

Commit 5768cf5

Browse files
authored
fix(cw): retry 1 times cw streaming sdk client #6798
## Problem This client is used in many Q features and does not currently allow retries. This means a single SDK request failure will cause the operation to fail. It appears based on the code that this is not intentional, and was accidentally left unfinished. ## Solution - allow up to 1 retry.
1 parent 9f5b90e commit 5768cf5

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

packages/core/src/shared/clients/codewhispererChatClient.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,7 @@ export async function createCodeWhispererChatStreamingClient(): Promise<CodeWhis
1717
endpoint: cwsprConfig.endpoint,
1818
token: { token: bearerToken },
1919
customUserAgent: getUserAgent(),
20-
// SETTING max attempts to 0 FOR BETA. RE-ENABLE FOR RE-INVENT
21-
// Implement exponential back off starting with a base of 500ms (500 + attempt^10)
22-
retryStrategy: new ConfiguredRetryStrategy(0, (attempt: number) => 500 + attempt ** 10),
20+
retryStrategy: new ConfiguredRetryStrategy(1, (attempt: number) => 500 + attempt ** 10),
2321
})
2422
return streamingClient
2523
}

0 commit comments

Comments
 (0)