• alfadb's avatar
    fix: strip empty text blocks in retry filter and fix error pattern matching · b8ada63a
    alfadb authored
    
    
    Empty text blocks ({"type":"text","text":""}) cause Anthropic upstream to
    return 400: "text content blocks must be non-empty". This was not caught
    by the existing error detection pattern in isThinkingBlockSignatureError,
    nor handled by FilterThinkingBlocksForRetry.
    
    - Add empty text block stripping to FilterThinkingBlocksForRetry
    - Fix isThinkingBlockSignatureError to match new Anthropic error format
    - Add fast-path byte patterns to avoid unnecessary JSON parsing
    Co-Authored-By: default avatarClaude Opus 4.6 (1M context) <noreply@anthropic.com>
    b8ada63a
gateway_request.go 27.7 KB