1. 14 Apr, 2026 6 commits
    • shuanbao0's avatar
      fix(gateway): 兼容 Cursor /v1/chat/completions 的 Responses API body · f47f7b8e
      shuanbao0 authored and 陈曦's avatar 陈曦 committed
      
      
      Cursor 云端 (User-Agent: Go-http-client/2.0) 发往 /v1/chat/completions 的
      body 使用 Responses API 格式:
          {"model":"gpt-5.4","input":[{"role":"system","content":"..."}],"stream":true}
      
      原代码用 ChatCompletionsRequest 反序列化,该结构体没有 Input 字段,
      Cursor 的 input 数组被静默丢弃,ChatCompletionsToResponses 转换后产出
      input: null,Codex 上游以 "Invalid type for 'input': expected a string,
      but got an object" 拒绝请求(上游 typeof null === 'object')。
      
      修复:在 ForwardAsChatCompletions 里用 gjson 检测 body shape,当 input
      存在且 messages 缺失时,跳过 Chat→Responses 转换,用 sjson 仅改写 model
      字段后原样透传 body。billing 所需的 ServiceTier 和 Reasoning.Effort 通过
      gjson 从 raw body 提取,下游 codex OAuth transform 路径保持不变。
      
      测试:新增 openai_cursor_warmup_pipeline_test.go,覆盖 5 个 shape 检测
      用例(正向/标准请求不误伤/两字段共存/空 body/JSON 回读)。
      Co-Authored-By: default avatarClaude Opus 4.6 (1M context) <noreply@anthropic.com>
      f47f7b8e
    • qingyuzhang's avatar
      fix(frontend): lazy load mobile account usage cells · 3c243c47
      qingyuzhang authored and 陈曦's avatar 陈曦 committed
      3c243c47
    • qingyuzhang's avatar
      fix(frontend): avoid mounting hidden mobile table · 8b4fc76b
      qingyuzhang authored and 陈曦's avatar 陈曦 committed
      8b4fc76b
    • erio's avatar
      fix(frontend): lower QR code error correction level to reduce density · de2cab2f
      erio authored and 陈曦's avatar 陈曦 committed
      Closes #1607
      de2cab2f
    • erio's avatar
      fix(payment): fix Alipay/Wxpay direct provider type mapping and enable... · 0e2a3901
      erio authored and 陈曦's avatar 陈曦 committed
      fix(payment): fix Alipay/Wxpay direct provider type mapping and enable cross-provider load balancing
      
      Two issues fixed:
      
      1. Alipay.SupportedTypes() returned ["alipay_direct"] and Wxpay returned
         ["wxpay_direct"], but the frontend sends payment_type="alipay"/"wxpay".
         The registry lookup failed with "payment method (alipay) is not
         configured". Fix: return the base types ["alipay"]/["wxpay"].
      
      2. When multiple providers support the same payment type (e.g. EasyPay
         and Alipay direct both handle "alipay"), only the last-registered
         provider's instances were reachable — the registry mapped one type to
         one provider key, and SelectInstance queried by that single key.
      
         Fix: bypass the registry in invokeProvider and let SelectInstance
         query across all providers when providerKey is empty. The selected
         instance's own ProviderKey (now included in InstanceSelection) is
         used to create the correct provider, enabling true cross-provider
         load balancing.
      
      Closes #1592
      0e2a3901
    • sakurawztlt's avatar
      fix: Anthropic 非流式路径在上游终态事件 output 为空时从 delta 事件重建响应内容 · 777820c1
      sakurawztlt authored and 陈曦's avatar 陈曦 committed
      b2e379cf 引入的 BufferedResponseAccumulator 已修复了 chat_completions
      非流式路径和 responses OAuth 非流式路径,但遗漏了 Anthropic /v1/messages
      非流式路径 (handleAnthropicBufferedStreamingResponse)。
      
      当客户端请求 stream=false 且模型开启思考时,上游 response.completed
      终态事件的 output 字段可能为空,实际 message 内容通过
      response.output_text.delta 增量事件下发。旧代码只读终态事件的 Response,
      导致客户端收到的 content 字段为空 ([{"type":"text"}])。
      
      本 commit 将 b2e379cf 的相同修复模式镜像到 Anthropic 路径:在 SSE 扫描
      过程中用 BufferedResponseAccumulator 累积 delta 内容,终态 output 为空
      时通过 SupplementResponseOutput 补充重建。
      
      同时修复 handleAnthropicBufferedStreamingResponse 遗漏 response.done
      事件类型的问题,与 chat completions 路径保持一致,避免上游发送
      response.done 时 handler 认不出终态事件、最终返回 502 的潜在问题。
      
      BufferedResponseAccumulator 已在 chatcompletions_responses_test.go 有
      完整单元测试覆盖(TextOnly/ToolCalls/Reasoning/Mixed/SupplementEmpty/
      NoSupplementWhenOutputExists/EmptyDeltas/IgnoresNonFunctionCallItems),
      本次复用相同累加器无需新增测试。
      777820c1
  2. 13 Apr, 2026 1 commit
  3. 12 Apr, 2026 8 commits
  4. 11 Apr, 2026 22 commits
  5. 10 Apr, 2026 3 commits