1. 11 Jan, 2026 15 commits
    • IanShaw027's avatar
      feat(ops): 增强上游错误追踪和新增定时报告服务 · 73b62bb1
      IanShaw027 authored
      - 优化错误日志中间件,即使请求成功也记录上游重试/故障转移事件
      - 新增OpsScheduledReportService支持定时报告功能
      - 使用Redis分布式锁确保定时任务单实例执行
      - 完善依赖注入配置
      - 优化前端错误趋势图表展示
      73b62bb1
    • IanShaw027's avatar
      feat(ops): 优化健康评分算法和智能诊断机制 · 8fffcd80
      IanShaw027 authored
      - 采用分层加权评分(业务70% + 基础设施30%),避免重复扣分
      - 新增延迟诊断(P99 > 2s critical, > 1s warning)
      - 新增资源诊断(CPU/内存/DB/Redis状态)
      - 调整诊断阈值(上游错误率5% critical,请求错误率3% critical)
      - 为每个诊断项添加可操作建议
      - 添加完整的单元测试覆盖(30+测试用例)
      - 完善中英文国际化文本
      8fffcd80
    • IanShaw027's avatar
      chore(ops): 更新依赖注入配置 · 76484bd5
      IanShaw027 authored
      76484bd5
    • IanShaw027's avatar
      e4ed35fe
    • IanShaw027's avatar
    • IanShaw027's avatar
      a2f83ff0
    • IanShaw027's avatar
      feat(ops): 添加分组和账号级别监控指标 · dd59e872
      IanShaw027 authored
      - 后端新增 GetAccountAvailability 方法获取账号可用性数据
      - 添加分组可用率和限流率计算辅助函数
      - 前端支持分组和账号级别的监控指标类型
      - 优化警报规则指标选择器,按类别分组显示
      dd59e872
    • 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
    • IanShaw027's avatar
      feat(ops): 增强错误详情弹窗与API支持 · e5857161
      IanShaw027 authored
      **前端改动**:
      1. OpsErrorDetailModal.vue:
         - 新增上游错误详情展示功能
         - 支持查看上游错误的请求头、响应体等调试信息
         - 改进错误信息格式化与可读性
      
      2. ops.ts API:
         - 新增getUpstreamErrors接口调用上游错误查询API
      
      **后端配置**:
      - config.go/config.yaml/deploy/config.example.yaml:
        - 更新配置支持上游错误事件记录开关
        - 添加相关配置项文档说明
      e5857161
    • 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): 添加上游错误事件数据库表 · c2962752
      IanShaw027 authored
      - 新建ops_upstream_error_events表存储上游服务错误详情
      - 记录上游错误的请求ID、平台、模型、状态码等信息
      - 支持索引优化查询性能(request_id, platform, status_code, created_at)
      c2962752
    • 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
    • shaw's avatar
      chore: remove accidentally committed test binary · 56fc2764
      shaw authored
      56fc2764
  2. 10 Jan, 2026 14 commits
  3. 09 Jan, 2026 11 commits
    • yangjianbo's avatar
      fix(分组): 防止降级环并校验上下文分组 · 2597fe78
      yangjianbo authored
      - 增加降级链路环检测并拦截配置
      
      - 仅复用合法分组上下文并必要时回退查询
      
      - 标注 GetByIDLite 轻量语义并补充测试
      2597fe78
    • IanShaw027's avatar
      feat(运维监控): 重构仪表板布局和增强数据展示 · c48dc097
      IanShaw027 authored
      主要改动:
      - 重构仪表板为左右布局(5:7比例)
      - 左侧:健康评分 + 实时信息(当前/峰值/平均 QPS/TPS)
      - 右侧:6个卡片展示详细指标(3列x2行)
        - 总请求:请求数、Token数、平均QPS/TPS、平均延迟/TTFT
        - SLA:百分比、异常数、进度条
        - 延迟:P99/P95/P90/P50/Avg/Max(带颜色编码)
        - TTFT:P99/P95/P90/P50/Avg/Max(带颜色编码)
        - 请求错误:错误率、错误数、业务限制数
        - 上游错误:错误率、错误数(排除429/529)、429/529数
      - 添加延迟/TTFT颜色编码(<500ms绿色,<1s黄色,<2s橙色,≥2s红色)
      - 添加实时窗口选择器(1min/5min/30min/1h)
      - 优化时间段选择器标签("近5分钟"等)
      - 完善中英文i18n翻译
      - 数据库:添加Redis连接池字段(redis_conn_total, redis_conn_idle)
      c48dc097
    • IanShaw027's avatar
      feat(运维监控): 增强监控功能和健康评分系统 · 585257d3
      IanShaw027 authored
      后端改进:
      - 新增健康评分计算服务(ops_health_score.go)
      - 添加分布式锁支持(ops_advisory_lock.go)
      - 优化指标采集和聚合逻辑
      - 新增运维指标采集间隔配置(60-3600秒)
      - 移除未使用的WebSocket查询token认证中间件
      - 改进清理服务和告警评估逻辑
      
      前端改进:
      - 简化OpsDashboard组件结构
      - 完善国际化文本(中英文)
      - 新增运维监控相关API类型定义
      - 添加运维指标采集间隔设置界面
      - 优化错误详情模态框
      
      测试:
      - 添加健康评分单元测试
      - 更新API契约测试
      585257d3
    • yangjianbo's avatar
      perf(网关): 复用分组上下文减少热路径查询 · 67554324
      yangjianbo authored
      新增 GetByIDLite 并在网关与 Gemini 选择流程复用上下文 group,避免 COUNT 触发
      更新 API key 中间件注入 group 上下文,减少重复查库
      补充 gateway/gemini 中间件与仓库层回归测试
      
      测试: make test
      67554324
    • Song Siyu's avatar
      feat: antigravity 配额域限流 + SSE 上限 (#222) · 7d1fe818
      Song Siyu authored
      * fix: 添加 gemini-3-flash 前缀映射支持 gemini-3-flash-preview
      
      * feat(antigravity): 增强请求参数和注入 Antigravity 身份 system prompt
      
      * feat: antigravity 配额域限流
      
      * chore: 调整 SSE 单行上限到 25MB
      
      * chore: 提升 SSE 单行上限到 40MB
      7d1fe818
    • 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
      fix: update API contract tests for ip_whitelist/ip_blacklist fields · e83f644c
      Edric Li authored
      Add ip_whitelist and ip_blacklist fields to expected JSON responses
      in API contract tests to match the new API key schema.
      e83f644c
    • 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
      test(后端): 更新 API 契约测试支持 ops 监控端点 · e8464580
      IanShaw027 authored
      - 更新 api_contract_test.go 包含 ops 相关端点测试
      e8464580
    • 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