From 58710252457a8c3f4438c083d53a90f4c86534ba Mon Sep 17 00:00:00 2001 From: nai-degen Date: Thu, 20 Jun 2024 11:24:26 -0500 Subject: [PATCH] fixes AWS keychecker failure caused by Sonnet 3.5 gradual rollout --- src/shared/key-management/aws/checker.ts | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/shared/key-management/aws/checker.ts b/src/shared/key-management/aws/checker.ts index 30dbf60..179a0c1 100644 --- a/src/shared/key-management/aws/checker.ts +++ b/src/shared/key-management/aws/checker.ts @@ -57,9 +57,19 @@ export class AwsKeyChecker extends KeyCheckerBase { this.invokeModel("anthropic.claude-3-sonnet-20240229-v1:0", key), this.invokeModel("anthropic.claude-3-haiku-20240307-v1:0", key), this.invokeModel("anthropic.claude-3-opus-20240229-v1:0", key), - this.invokeModel("anthropic.claude-3-5-sonnet-20240620-v1:0", key), ]; } + + // Sonnet 3.5 is being gradually rolled out and some AWS keys/regions throw + // a ResourceNotFoundException when trying to invoke it which will fail the + // entire key As a temporary measure we will trap thrown errors for this + // particular check and ignore them. + checks.unshift( + this.invokeModel("anthropic.claude-3-5-sonnet-20240620-v1:0", key).catch( + () => false + ) + ); + checks.unshift(this.checkLoggingConfiguration(key)); const [_logging, claudeV2, sonnet, haiku, opus, sonnet35] =