1. 07 Feb, 2026 1 commit
  2. 06 Feb, 2026 6 commits
    • shaw's avatar
      fix(ops): 添加 token 相关字段白名单避免误脱敏 · 9f4c1ef9
      shaw authored
      在敏感字段检测中添加白名单,排除 API 参数和用量统计字段:
      - max_tokens, max_completion_tokens, max_output_tokens
      - completion_tokens, prompt_tokens, total_tokens
      - input_tokens, output_tokens
      - cache_creation_input_tokens, cache_read_input_tokens
      
      这些字段名虽然包含 "token" 但只是数值参数,不应被脱敏处理。
      9f4c1ef9
    • shaw's avatar
      fix(gateway): 移除 PR #316 引入的工具名转换逻辑 · d182ef03
      shaw authored
      移除响应阶段的工具名/schema/description 转换逻辑,修复第三方工具调用时
      工具名被错误转换的问题(如 Task → task)。
      
      移除内容:
      - 工具名相关正则变量(toolPrefixRe, toolNameBoundaryRe 等)
      - openCodeToolOverrides 和 claudeToolNameOverrides 映射表
      - 工具名转换函数(normalizeToolNameForClaude, normalizeToolNameForOpenCode 等)
      - 响应体工具名替换函数(replaceToolNamesInText, replaceToolNamesInResponseBody 等)
      - 参数名转换函数(normalizeParamNameForOpenCode, rewriteParamKeysInValue)
      - 工具描述清理函数(sanitizeToolDescription)
      - 输入 schema 转换函数(normalizeToolInputSchema)
      - 模型 ID 正则替换函数(replaceModelIDInText)
      
      保留内容:
      - 系统提示词清理(sanitizeSystemText)
      - Claude Code 指纹 headers 处理
      - 模型 ID 映射(通过 JSON 对象操作)
      d182ef03
    • yangjianbo's avatar
      ee01f80d
    • yangjianbo's avatar
      fix(兼容): 将 Kimi cached_tokens 映射到 Claude 标准 cache_read_input_tokens · f33a9501
      yangjianbo authored
      
      
      Kimi 等 Claude 兼容 API 返回缓存信息使用 OpenAI 风格的 cached_tokens 字段,
      而非 Claude 标准的 cache_read_input_tokens,导致客户端收不到缓存命中信息且
      内部计费缓存折扣为 0。
      
      新增 reconcileCachedTokens 辅助函数,在 cache_read_input_tokens == 0 且
      cached_tokens > 0 时自动填充,覆盖流式(message_start/message_delta)和
      非流式两种响应路径。对 Claude 原生上游无影响。
      Co-Authored-By: default avatarClaude Opus 4.6 <noreply@anthropic.com>
      f33a9501
    • shaw's avatar
      chore: 前端增加opus4.6模型映射 · 01b08e1e
      shaw authored
      01b08e1e
    • yangjianbo's avatar
      fix(兼容): 将 Kimi cached_tokens 映射到 Claude 标准 cache_read_input_tokens · c6a456c7
      yangjianbo authored
      
      
      Kimi 等 Claude 兼容 API 返回缓存信息使用 OpenAI 风格的 cached_tokens 字段,
      而非 Claude 标准的 cache_read_input_tokens,导致客户端收不到缓存命中信息且
      内部计费缓存折扣为 0。
      
      新增 reconcileCachedTokens 辅助函数,在 cache_read_input_tokens == 0 且
      cached_tokens > 0 时自动填充,覆盖流式(message_start/message_delta)和
      非流式两种响应路径。对 Claude 原生上游无影响。
      Co-Authored-By: default avatarClaude Opus 4.6 <noreply@anthropic.com>
      c6a456c7
  3. 05 Feb, 2026 21 commits
  4. 04 Feb, 2026 4 commits
  5. 03 Feb, 2026 8 commits
    • shaw's avatar
      chore: fix gofmt formatting · df1c2383
      shaw authored
      df1c2383
    • liuxiongfeng's avatar
      fix(gemini): 导出 DummyThoughtSignature 常量并修复跨账号签名验证 · 6baf8108
      liuxiongfeng authored
      - 将 dummyThoughtSignature 改为导出的 DummyThoughtSignature 常量,供跨包使用
      - 修改 gemini_native_signature_cleaner.go 将删除签名改为替换为 dummy 签名
        这样可以跳过 Gemini 3 的签名验证,解决粘性会话切换账号时的验证失败问题
      - 更新相关测试文件
      
      Fixes: 粘性会话切换账号时 thoughtSignature 验证失败导致 400 错误
      6baf8108
    • liuxiongfeng's avatar
      fix(openai): 统一 OAuth instructions 处理逻辑,修复 Codex CLI 400 错误 · 9a48b2e9
      liuxiongfeng authored
      - 修改 applyCodexOAuthTransform 函数签名,增加 isCodexCLI 参数
      - 移除 && !isCodexCLI 条件,对所有 OAuth 请求统一处理
      - 新增 applyInstructions/applyCodexCLIInstructions/applyOpenCodeInstructions 辅助函数
      - 新增 isInstructionsEmpty 函数检查 instructions 字段是否为空
      - 添加 Codex CLI 和非 Codex CLI 场景的测试用例
      
      逻辑说明:
      - Codex CLI + 有 instructions: 保持不变
      - Codex CLI + 无 instructions: 补充 opencode 指令
      - 非 Codex CLI: 使用 opencode 指令覆盖
      9a48b2e9
    • bayma888's avatar
      fix(lint): format gateway_service.go with gofmt · 3fed478e
      bayma888 authored
      3fed478e
    • bayma888's avatar
      fix(test): update API contract tests for new quota fields · 0afc5d0b
      bayma888 authored
      Add quota, quota_used, expires_at fields to expected JSON responses
      in POST /api/v1/keys and GET /api/v1/keys test cases.
      0afc5d0b
    • bayma888's avatar
      fix(test): add IncrementQuotaUsed to all APIKeyRepository test stubs · be7bc658
      bayma888 authored
      - Add missing IncrementQuotaUsed method to stubApiKeyRepo in api_contract_test.go
      - Fix gofmt formatting issues in api_key_service.go, dto/types.go, api_key_handler.go
      be7bc658
    • bayma888's avatar
      fix(test): add IncrementQuotaUsed to all APIKeyRepository test stubs · e59e3a9f
      bayma888 authored
      Add the missing IncrementQuotaUsed method to:
      - fakeAPIKeyRepo (api_key_auth_google_test.go)
      - stubApiKeyRepo (api_key_auth_test.go)
      - apiKeyRepoStub (api_key_service_delete_test.go)
      - authRepoStub (api_key_service_cache_test.go)
      e59e3a9f
    • bayma888's avatar
      feat(api-key): add independent quota and expiration support · 6146be14
      bayma888 authored
      This feature allows API Keys to have their own quota limits and expiration
      times, independent of the user's balance.
      
      Backend:
      - Add quota, quota_used, expires_at fields to api_key schema
      - Implement IsExpired() and IsQuotaExhausted() checks in middleware
      - Add ResetQuota and ClearExpiration API endpoints
      - Integrate quota billing in gateway handlers (OpenAI, Anthropic, Gemini)
      - Include quota/expiration fields in auth cache for performance
      - Expiration check returns 403, quota exhausted returns 429
      
      Frontend:
      - Add quota and expiration inputs to key create/edit dialog
      - Add quick-select buttons for expiration (+7, +30, +90 days)
      - Add reset quota confirmation dialog
      - Add expires_at column to keys list
      - Add i18n translations for new features (en/zh)
      
      Migration:
      - Add 045_add_api_key_quota.sql for new columns
      6146be14