🛡️ feat: Add Model Refusal Error Handling (Anthropic) (#10478)

* feat: Add error handling for model refusal and update translations

* refactor: error handling in AgentClient to improve logging and cleanup process

* refactor: Update error message for response refusal to improve clarity
This commit is contained in:
Danny Avila 2025-11-13 08:34:55 -05:00 committed by GitHub
parent 3f62ce054f
commit 524fc5bae4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 54 additions and 29 deletions

View file

@ -43,6 +43,7 @@ const errorMessages = {
[ErrorTypes.NO_BASE_URL]: 'com_error_no_base_url',
[ErrorTypes.INVALID_ACTION]: `com_error_${ErrorTypes.INVALID_ACTION}`,
[ErrorTypes.INVALID_REQUEST]: `com_error_${ErrorTypes.INVALID_REQUEST}`,
[ErrorTypes.REFUSAL]: 'com_error_refusal',
[ErrorTypes.MISSING_MODEL]: (json: TGenericError, localize: LocalizeFunction) => {
const { info: endpoint } = json;
const provider = (alternateName[endpoint ?? ''] as string | undefined) ?? endpoint ?? 'unknown';