"backend/internal/handler/vscode:/vscode.git/clone" did not exist on "bac9e2bfd527f8b5e22cf342aaeb9a70267f9c3e"
  1. 11 Jan, 2026 8 commits
    • IanShaw027's avatar
      feat(ops): 增强上游错误追踪和新增定时报告服务 · 73b62bb1
      IanShaw027 authored
      - 优化错误日志中间件,即使请求成功也记录上游重试/故障转移事件
      - 新增OpsScheduledReportService支持定时报告功能
      - 使用Redis分布式锁确保定时任务单实例执行
      - 完善依赖注入配置
      - 优化前端错误趋势图表展示
      73b62bb1
    • IanShaw027's avatar
      feat(ops): 添加运维监控配置开关 · c1a3dd41
      IanShaw027 authored
      - 在 .env.example 和 config.example.yaml 中添加 ops.enabled 配置项
      - 默认值为 true,保持现有行为
      - 当设置为 false 时,左侧栏隐藏运维监控菜单并禁用所有运维监控功能
      - 修改后端 GetSettings API,让 ops_monitoring_enabled 受 config.ops.enabled 控制
      - 数据清理和预聚合任务默认保持开启状态(通过运维监控设置对话框配置)
      c1a3dd41
    • IanShaw027's avatar
      feat(ops): 添加高级设置API支持 · 988b4d02
      IanShaw027 authored
      - 新增OpsAdvancedSettings数据模型
      - 支持数据保留策略配置(错误日志、分钟级指标、小时级指标)
      - 支持数据聚合开关配置
      - 添加GET/PUT /admin/ops/advanced-settings接口
      - 添加配置校验和默认值处理
      
      相关文件:
      - backend/internal/service/ops_settings_models.go
      - backend/internal/service/ops_settings.go
      - backend/internal/handler/admin/ops_settings_handler.go
      - backend/internal/server/routes/admin.go
      - backend/internal/service/domain_constants.go
      988b4d02
    • yangjianbo's avatar
      6271a33d
    • yangjianbo's avatar
      1a869547
    • IanShaw027's avatar
      feat(ops): 实现上游错误事件记录与查询功能 · 7ebca553
      IanShaw027 authored
      **新增功能**:
      - 新建ops_upstream_error_events表存储上游服务错误详情
      - 支持记录上游429/529/5xx错误的详细上下文信息
      - 提供按时间范围查询上游错误事件的API
      
      **后端改动**:
      1. 模型层(ops_models.go, ops_port.go):
         - 新增UpstreamErrorEvent结构体
         - 扩展Repository接口支持上游错误事件CRUD
      
      2. 仓储层(ops_repo.go):
         - 实现InsertUpstreamErrorEvent写入上游错误
         - 实现GetUpstreamErrorEvents按时间范围查询
      
      3. 服务层(ops_service.go, ops_upstream_context.go):
         - ops_service: 新增GetUpstreamErrorEvents查询方法
         - ops_upstream_context: 封装上游错误上下文构建逻辑
      
      4. Handler层(ops_error_logger.go):
         - 新增GetUpstreamErrorsHandler处理上游错误查询请求
      
      5. Gateway层集成:
         - antigravity_gateway_service.go: 429/529错误时记录上游事件
         - gateway_service.go: OpenAI 429/5xx错误时记录
         - gemini_messages_compat_service.go: Gemini 429/5xx错误时记录
         - openai_gateway_service.go: OpenAI 429/5xx错误时记录
         - ratelimit_service.go: 429限流错误时记录
      
      **数据记录字段**:
      - request_id: 关联ops_logs主记录
      - platform/model: 上游服务标识
      - status_code/error_message: 错误详情
      - request_headers/response_body: 调试信息(可选)
      - created_at: 错误发生时间
      7ebca553
    • IanShaw027's avatar
      feat(ops): 添加QPS脉搏线图并优化指标布局 · 89a725a4
      IanShaw027 authored
      - 添加实时QPS/TPS历史数据追踪(最近60个数据点)
      - 在平均QPS/TPS上方添加SVG脉搏线图(sparkline)
      - 将延迟和TTFT卡片的指标布局从2列改为3列
      - 恢复Max指标显示(P95/P90/P50/Avg/Max)
      89a725a4
    • IanShaw027's avatar
      fix: 临时保存编译错误修复 · fc4ea659
      IanShaw027 authored
      - 添加 LinuxDo 和 Update 配置(从 main 分支缺失)
      - 添加 LinuxDoConnectSyntheticEmailDomain 常量
      - 添加 IsClaudeCodeClient context key
      - 添加 GetLinuxDoConnectOAuthConfig 方法
      - 修复 BindStickySession 调用签名
      - 修复前端 i18n 重复属性
      - 重新生成 wire 依赖注入代码
      
      这个提交准备被合并替换,先保存以防丢失。
      fc4ea659
  2. 10 Jan, 2026 3 commits
    • Edric Li's avatar
      feat(settings): add home content customization and config injection · 5265b12c
      Edric Li authored
      - Add home_content setting for custom homepage (HTML or iframe URL)
      - Inject public settings into index.html to eliminate page flash
      - Support ETag caching with automatic invalidation on settings update
      - Add Vite plugin for dev mode settings injection
      - Refactor HomeView to use appStore instead of local API calls
      5265b12c
    • long's avatar
      feat: 实现注册优惠码功能 · 9f4d4e5a
      long authored
        - 支持创建/编辑/删除优惠码,设置赠送金额和使用限制
        - 注册页面实时验证优惠码并显示赠送金额
        - 支持 URL 参数自动填充 (?promo=CODE)
        - 添加优惠码验证接口速率限制
        - 使用数据库行锁防止并发超限
        - 新增后台优惠码管理页面,支持复制注册链接
      9f4d4e5a
    • long's avatar
      feat: 实现注册优惠码功能 · d2fc14fb
      long authored
        - 支持创建/编辑/删除优惠码,设置赠送金额和使用限制
        - 注册页面实时验证优惠码并显示赠送金额
        - 支持 URL 参数自动填充 (?promo=CODE)
        - 添加优惠码验证接口速率限制
        - 使用数据库行锁防止并发超限
        - 新增后台优惠码管理页面,支持复制注册链接
      d2fc14fb
  3. 09 Jan, 2026 13 commits
    • cyhhao's avatar
      Make Codex CLI passthrough · eb06006d
      cyhhao authored
      eb06006d
    • IanShaw027's avatar
      feat(运维监控): 增强监控功能和健康评分系统 · 585257d3
      IanShaw027 authored
      后端改进:
      - 新增健康评分计算服务(ops_health_score.go)
      - 添加分布式锁支持(ops_advisory_lock.go)
      - 优化指标采集和聚合逻辑
      - 新增运维指标采集间隔配置(60-3600秒)
      - 移除未使用的WebSocket查询token认证中间件
      - 改进清理服务和告警评估逻辑
      
      前端改进:
      - 简化OpsDashboard组件结构
      - 完善国际化文本(中英文)
      - 新增运维监控相关API类型定义
      - 添加运维指标采集间隔设置界面
      - 优化错误详情模态框
      
      测试:
      - 添加健康评分单元测试
      - 更新API契约测试
      585257d3
    • Edric.Li's avatar
      feat(api-key): 添加 IP 白名单/黑名单限制功能 (#221) · 0a4641c2
      Edric.Li authored
      * feat(api-key): add IP whitelist/blacklist restriction and usage log IP tracking
      
      - Add IP restriction feature for API keys (whitelist/blacklist with CIDR support)
      - Add IP address logging to usage logs (admin-only visibility)
      - Remove billing_type column from usage logs UI (redundant)
      - Use generic "Access denied" error message for security
      
      Backend:
      - New ip package with IP/CIDR validation and matching utilities
      - Database migrations for ip_whitelist, ip_blacklist (api_keys) and ip_address (usage_logs)
      - Middleware IP restriction check after API key validation
      - Input validation for IP/CIDR patterns on create/update
      
      Frontend:
      - API key form with enable toggle for IP restriction
      - Shield icon indicator in table for keys with IP restriction
      - Removed billing_type filter and column from usage views
      
      * fix: update API contract tests for ip_whitelist/ip_blacklist fields
      
      Add ip_whitelist and ip_blacklist fields to expected JSON responses
      in API contract tests to match the new API key schema.
      0a4641c2
    • Edric Li's avatar
      feat(api-key): add IP whitelist/blacklist restriction and usage log IP tracking · 90798f14
      Edric Li authored
      - Add IP restriction feature for API keys (whitelist/blacklist with CIDR support)
      - Add IP address logging to usage logs (admin-only visibility)
      - Remove billing_type column from usage logs UI (redundant)
      - Use generic "Access denied" error message for security
      
      Backend:
      - New ip package with IP/CIDR validation and matching utilities
      - Database migrations for ip_whitelist, ip_blacklist (api_keys) and ip_address (usage_logs)
      - Middleware IP restriction check after API key validation
      - Input validation for IP/CIDR patterns on create/update
      
      Frontend:
      - API key form with enable toggle for IP restriction
      - Shield icon indicator in table for keys with IP restriction
      - Removed billing_type filter and column from usage views
      90798f14
    • IanShaw027's avatar
      feat(设置): 集成运维监控配置到系统设置 · 2d123a11
      IanShaw027 authored
      - 扩展 setting_handler 支持 ops 配置管理
      - 扩展 setting_service 支持 ops 配置持久化
      - 更新 settings_view 包含 ops 配置视图
      2d123a11
    • IanShaw027's avatar
      feat(网关): 集成运维监控到 API 网关处理器 · fcdf839b
      IanShaw027 authored
      - 在 gateway_handler 中添加请求监控和错误追踪
      - 在 openai_gateway_handler 中集成 ops 指标采集
      - 在 gemini_v1beta_handler 中集成 ops 指标采集
      - 更新 handler 基类支持 ops 错误日志记录
      fcdf839b
    • IanShaw027's avatar
      feat(handler): 实现运维监控 API 处理器和中间件 · f3ed95d4
      IanShaw027 authored
      - 新增 ops 错误日志记录器(ops_error_logger.go)
      - 新增 ops 主处理器(ops_handler.go)
      - 新增告警管理处理器(ops_alerts_handler.go)
      - 新增仪表板处理器(ops_dashboard_handler.go)
      - 新增实时监控处理器(ops_realtime_handler.go)
      - 新增配置管理处理器(ops_settings_handler.go)
      - 新增 WebSocket 处理器(ops_ws_handler.go)
      - 扩展设置 DTO 支持 ops 配置
      - 新增客户端请求 ID 中间件(client_request_id.go)
      - 新增 WebSocket 查询令牌认证中间件(ws_query_token_auth.go)
      - 更新管理员认证中间件支持 ops 路由
      - 注册 handler 依赖注入
      f3ed95d4
    • IanShaw027's avatar
      fix(admin): 代码审查修复 - 输入验证和测试完善 · 7c3d5cad
      IanShaw027 authored
      根据 Codex 代码审查报告,修复所有 P0 和 P1 优先级问题。
      
      ## P0 紧急修复
      
      ### 1. 修复集成测试编译错误
      - 更新 group_repo_integration_test.go 中所有 ListWithFilters 调用
      - 添加缺失的 search 参数(传入空字符串)
      - 修复 4 处旧签名调用,避免 CI 编译失败
      
      ### 2. 添加统一的 search 参数输入验证
      为所有 admin handler 添加一致的输入验证逻辑:
      - group_handler.go: 添加 TrimSpace + 长度限制
      - proxy_handler.go: 添加 TrimSpace + 长度限制
      - redeem_handler.go: 添加 TrimSpace + 长度限制
      - user_handler.go: 添加 TrimSpace + 长度限制
      
      验证规则:
      - TrimSpace() 去除首尾空格
      - 最大长度 100 字符(防止 DoS 攻击)
      - 超长输入自动截断
      
      ## P1 改进
      
      ### 3. 补充 search 功能的单元测试
      新增 admin_service_group_test.go 中的测试:
      - TestAdminService_ListGroups_WithSearch
        - search 参数正常传递到 repository 层
        - search 为空字符串时的行为
        - search 与其他过滤条件组合使用
      
      新增 admin_service_search_test.go 文件:
      - 为其他 admin API 添加 search 测试覆盖
      - 统一的测试模式和断言
      
      ### 4. 补充 search 功能的集成测试
      新增 group_repo_integration_test.go 测试场景:
      - TestListWithFilters_Search
        - 搜索 name 字段匹配
        - 搜索 description 字段匹配
        - 搜索不存在内容(返回空)
        - 大小写不敏感测试
        - 特殊字符转义测试(%、_)
        - 与其他过滤条件组合
      
      ## 测试结果
      
      -  编译检查通过
      -  单元测试全部通过 (3/3)
      -  集成测试编译通过
      -  所有 service 测试通过
      
      ## 影响范围
      
      修改文件: 8 个
      代码变更: +234 行 / -8 行
      
      ## 相关 Issue
      
      解决代码审查中的安全性和稳定性问题:
      - 防止 DoS 攻击(超长搜索字符串)
      - 修复测试编译错误(CI 阻塞问题)
      - 提升测试覆盖率
      7c3d5cad
    • shaw's avatar
      f060db0b
    • IanShaw027's avatar
      feat(admin): 添加账号批量调度开关功能 · 5e936fbf
      IanShaw027 authored
      - 后端:支持批量更新账号的 schedulable 字段
        - 在 BulkUpdateAccountsRequest 中添加 schedulable 参数
        - 在 AccountBulkUpdate 中添加 schedulable 字段支持
        - 更新 repository 层批量更新 SQL 逻辑
      - 前端:在账号管理页面添加批量调度控制
        - 新增"批量启用调度"和"批量停止调度"按钮
        - 添加 handleBulkToggleSchedulable 处理函数
        - 显示具体的成功提示信息(包含操作账号数量)
      - 国际化:添加批量调度相关中英文翻译
      - 优化:添加 search 参数标准化和验证(account_handler)
      5e936fbf
    • IanShaw027's avatar
      fix(admin): 修复表格批量操作和搜索功能问题 · 38202322
      IanShaw027 authored
      1. 恢复账号管理批量操作栏缺失的功能按钮
         - 添加"本页全选"按钮支持批量选择当前页所有账号
         - 添加"清除已选"按钮快速清空已选账号列表
         - 在重构拆分组件时遗漏,现已恢复
      
      2. 修复分组管理搜索功能仅搜索当前页的问题
         - 前端:移除本地过滤逻辑,改用后端搜索
         - 后端:添加 search 参数支持,搜索名称和描述字段
         - 支持不区分大小写的模糊匹配
         - 统一所有管理页面的搜索体验
      38202322
    • admin's avatar
      refactor(auth): 将 Linux DO OAuth 配置迁移到系统设置 · d1c2a61d
      admin authored
      - 将 LinuxDo Connect 配置从环境变量迁移到数据库持久化
      - 在管理后台系统设置中添加 LinuxDo OAuth 配置项
      - 简化部署流程,无需修改 docker-compose.override.yml
      
      🤖 Generated with [Claude Code](https://claude.com/claude-code
      
      )
      Co-Authored-By: default avatarClaude Opus 4.5 <noreply@anthropic.com>
      d1c2a61d
    • admin's avatar
      feat(auth): 添加 Linux DO Connect OAuth 登录支持 · 152d0cde
      admin authored
      - 新增 Linux DO OAuth 配置项和环境变量支持
      - 实现 OAuth 授权流程和回调处理
      - 前端添加 Linux DO 登录按钮和回调页面
      - 支持通过 Linux DO 账号注册/登录
      - 添加相关国际化文本
      
      🤖 Generated with [Claude Code](https://claude.com/claude-code
      
      )
      Co-Authored-By: default avatarClaude Opus 4.5 <noreply@anthropic.com>
      152d0cde
  4. 08 Jan, 2026 5 commits
  5. 07 Jan, 2026 2 commits
  6. 06 Jan, 2026 3 commits
    • shaw's avatar
      feat(admin/usage): 优化管理员用量页面功能和体验 · 015974a2
      shaw authored
      后端改进:
      - 新增 GetStatsWithFilters 方法支持完整筛选条件
      - Stats 端点支持 account_id, group_id, model, stream, billing_type 参数
      - 统一使用 filters 结构体,移除冗余的分支逻辑
      
      前端改进:
      - 统计卡片添加"所选范围内"文字提示
      - 优化总消费显示格式,清晰展示实际费用和标准计费
      - Token 和费用列添加问号图标 tooltip 显示详细信息
      - API Key 搜索框体验优化:点击即显示下拉选项
      - 选择用户后自动加载该用户的所有 API Key
      015974a2
    • yangjianbo's avatar
      fix(并发): 修复 wrapReleaseOnDone goroutine 泄露问题 · 823497a2
      yangjianbo authored
      问题描述:
      - wrapReleaseOnDone 函数创建的 goroutine 会持续等待 ctx.Done()
      - 即使 release() 已被调用,goroutine 仍不会退出
      - 高并发场景下(1000 req/s)会产生 3000+ 个泄露 goroutine
      
      修复方案:
      - 添加 quit channel 作为退出信号
      - 正常释放时 close(quit) 通知 goroutine 立即退出
      - 使用 select 监听 ctx.Done() 和 quit 两个信号
      - 确保 goroutine 在正常流程中及时退出
      
      测试覆盖:
      - 新增 5 个单元测试验证修复效果
      - 验证 goroutine 不泄露
      - 验证并发安全性和多次调用保护
      - 性能影响:471.9 ns/op, 208 B/op
      
      影响范围:
      - gateway_handler.go: 每请求调用 2-4 次
      - openai_gateway_handler.go: 每请求调用 2-3 次
      - 修复后 goroutine 泄露数量从 3/req 降至 0
      
      🤖 Generated with [Claude Code](https://claude.com/claude-code
      
      )
      Co-Authored-By: default avatarClaude Sonnet 4.5 <noreply@anthropic.com>
      823497a2
    • Yuhao Jiang's avatar
      fix: 修复跨时区用户日期范围查询不准确的问题 · f5603b07
      Yuhao Jiang authored
      问题:当用户时区与服务器时区不同时,日期范围查询使用服务器时区解析,
      导致用户看到的数据与预期不符。
      
      修复方案:
      - 前端:所有 GET 请求自动携带用户时区参数
      - 后端:新增时区辅助函数,所有日期解析和默认日期范围计算都使用用户时区
      - 当用户时区为空或无效时,自动回退到服务器时区
      
      🤖 Generated with [Claude Code](https://claude.ai/code
      
      )
      Co-Authored-By: default avatarClaude <noreply@anthropic.com>
      f5603b07
  7. 05 Jan, 2026 6 commits
    • song's avatar
      fix: Antigravity 账户刷新 token 500 错误 · 6fa704d6
      song authored
      AccountHandler.Refresh 方法缺少对 Antigravity 平台的处理分支,
      导致刷新时错误地走进 Claude 刷新逻辑。
      6fa704d6
    • song's avatar
      fix: 图片计费代码审查问题修复 · 5b1907fe
      song authored
      - isImageGenerationModel 改为精确匹配/前缀匹配,避免误匹配
      - 新增 normalizePrice 函数,支持负数清除价格配置
      - 更新注释说明 Gemini API 每次请求只生成一张图片
      - 添加测试用例验证不会误匹配自定义模型名
      5b1907fe
    • song's avatar
      feat: 图片生成计费功能 · d4c2b723
      song authored
      - 新增 Group 图片价格配置(image_price_1k/2k/4k)
      - BillingService 新增 CalculateImageCost 方法
      - AntigravityGatewayService 支持识别图片生成模型并按次计费
      - UsageLog 新增 image_count 和 image_size 字段
      - 前端分组管理支持配置图片价格(antigravity 和 gemini 平台)
      - 图片计费复用通用计费能力(余额检查、扣费、倍率、订阅限额)
      d4c2b723
    • LLLLLLiulei's avatar
      feat: add account notes field · 94750fb6
      LLLLLLiulei authored
      94750fb6
    • yangjianbo's avatar
      feat(安全): 添加安全开关并完善测试流程 · 794a9f96
      yangjianbo authored
      实现安全开关默认关闭与响应头透传逻辑
      - URL 校验与响应头过滤支持开关并覆盖流式路径
      - 非流式 Content-Type 透传/默认值按配置生效
      - 接入 go test、golangci-lint 与前端 lint/typecheck
      - 补充相关测试与配置/文档说明
      794a9f96
    • Jiahao Luo's avatar
      feat(crs-sync): improve error messages and add private IP allowlist support · 204190f8
      Jiahao Luo authored
      ## Changes
      
      ### 1. Enhanced Error Messages
      - Modified CRS sync error handling to show detailed error messages
      - Changed from generic "internal error" to "CRS sync failed: <details>"
      - Helps diagnose connection issues with private CRS deployments
      
      ### 2. Security Configuration
      - Added SECURITY_URL_ALLOWLIST_ALLOW_PRIVATE_HOSTS environment variable
      - Allows administrators to enable/disable private IP access for CRS sync
      - Production default: false (secure)
      - Test environment default: true (convenient for internal testing)
      
      ### 3. Flexible Configuration Support
      - Added config.yaml mount support in both production and test environments
      - Supports dual configuration methods:
        * config.yaml for detailed/complex configurations
        * Environment variables for quick overrides
      - Priority: ENV vars > config.yaml > defaults
      
      ## Use Case
      Enables CRS sync from internal deployments where CRS resolves to private IPs
      (e.g., 10.x.x.x, 192.168.x.x) while maintaining security by default.
      
      ## Files Modified
      - backend/internal/handler/admin/account_handler.go
      - deploy/docker-compose.yml
      - deploy/docker-compose-test.yml
      204190f8