• alfadb's avatar
    fix(gateway): strip empty text blocks from nested tool_result content · 70a9d0d3
    alfadb authored
    Empty text blocks inside tool_result.content were not being filtered,
    causing upstream 400 errors: 'text content blocks must be non-empty'.
    
    Changes:
    - Add stripEmptyTextBlocksFromSlice helper for recursive content filtering
    - FilterThinkingBlocksForRetry now recurses into tool_result nested content
    - Add StripEmptyTextBlocks pre-filter on initial request path to avoid
      unnecessary 400+retry round-trips
    - Add unit tests for nested empty text block scenarios
    70a9d0d3
gateway_service.go 283 KB