Show the error reason after the generic failure message
When an agent turn fails, users only saw "요청을 완료하지 못했습니다. 다시
시도해 주세요." with no clue why. Capture the failure reason (explicit
error field, or provider-error text like "API Error: 529 Overloaded"
classified by detectClaudeProviderFailureMessage) in the turn controller
and append it to the failure message ("...\n\n오류 내용: <reason>",
secret-redacted + length-capped). Update the paired-room loop filter to
startsWith so a failure-with-reason is still recognized and not
re-injected into prompt history. Unit-tested.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -544,8 +544,13 @@ export function filterLoopingPairedBotMessages(
|
||||
) {
|
||||
if (!hasReviewerLease(chatJid)) return messages;
|
||||
|
||||
// startsWith (not exact) so a failure message that carries an appended error
|
||||
// reason ("...다시 시도해 주세요.\n\n오류 내용: ...") is still recognized as the
|
||||
// generic failure and filtered out of paired-room prompt history.
|
||||
return messages.filter(
|
||||
(message) =>
|
||||
!(message.is_bot_message && message.content.trim() === failureText),
|
||||
!(
|
||||
message.is_bot_message && message.content.trim().startsWith(failureText)
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user