1. 01 Apr, 2026 2 commits
    • YanzheL's avatar
      test(gateway): add tests for content-based session hash fallback · 4fb16030
      YanzheL authored
      - 20 unit tests for deriveOpenAIContentSessionSeed covering:
        - Empty/nil inputs, model-only, stable across turns
        - Different model/system/first-user produce different seeds
        - Tools, functions, developer role, structured content
        - Responses API: input string, input array, instructions, input_text typed items
        - JSON canonicalization (whitespace/key-order insensitive)
        - Prefix presence, empty tools ignored, messages preferred over input
      - 3 integration tests for GenerateSessionHash content fallback:
        - Content fallback produces stable hash
        - Explicit signals override content fallback
        - Empty body still returns empty hash
      4fb16030
    • YanzheL's avatar
      fix(gateway): add content-based session hash fallback for non-Codex clients · c5aac125
      YanzheL authored
      When no explicit session signals (session_id, conversation_id, prompt_cache_key)
      are provided, derive a stable session seed from the request body content
      (model + tools + system prompt + first user message) to enable sticky routing
      and prompt caching for non-Codex clients using the Chat Completions API.
      
      This mirrors the content-based fallback already present in GatewayService.
      GenerateSessionHash, adapted for the OpenAI gateway's request formats (both
      Chat Completions messages and Responses API input).
      
      JSON fragments are canonicalized via normalizeCompatSeedJSON to ensure
      semantically identical requests produce the same seed regardless of
      whitespace or key ordering.
      
      Closes #1421
      c5aac125
  2. 31 Mar, 2026 7 commits
  3. 30 Mar, 2026 18 commits
  4. 29 Mar, 2026 5 commits
  5. 28 Mar, 2026 1 commit
    • wucm667's avatar
      fix(billing): 计费始终使用用户请求的原始模型,而非映射后的上游模型 · f5764d8d
      wucm667 authored
      当账号配置了模型映射(如 claude-sonnet-4-6 → glm-5.0)时,系统错误地
      使用映射后的上游模型名计算费用。由于上游模型(如 glm-5.0)在定价系统中
      没有价格配置,导致计费失败后被静默置为 0,用户不被扣费。
      
      修改 forwardResultBillingModel 优先返回请求模型名,并移除 OpenAI 路径
      中 BillingModel 字段对计费模型的覆盖逻辑。
      f5764d8d
  6. 27 Mar, 2026 7 commits