• IanShaw027's avatar
    fix(backend): 改进 thinking/tool block 签名处理和重试策略 · 87426e5d
    IanShaw027 authored
    主要改动:
    - request_transformer: thinking block 缺少签名时降级为文本而非丢弃,保留内容并在上层禁用 thinking mode
    - antigravity_gateway_service: 新增两阶段降级策略,先处理 thinking blocks,如仍失败且涉及 tool 签名错误则进一步降级 tool blocks
    - gateway_request: 新增 FilterSignatureSensitiveBlocksForRetry 函数,支持将 tool_use/tool_result 降级为文本
    - gateway_request: 改进 FilterThinkingBlocksForRetry,禁用顶层 thinking 配置以避免结构约束冲突
    - gateway_service: 实现保守的两阶段重试逻辑,优先保留内容,仅在必要时降级工具调用
    - 新增 antigravity_gateway_service_test.go 测试签名块剥离逻辑
    - 更新相关测试用例以验证降级行为
    
    此修复解决了跨平台/账户切换时历史消息签名失效导致的请求失败问题。
    87426e5d
gateway_request_test.go 8.24 KB