1. 11 Jan, 2026 13 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): 添加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 11 commits
  3. 09 Jan, 2026 16 commits
    • yangjianbo's avatar
      fix(分组): 防止降级环并校验上下文分组 · 2597fe78
      yangjianbo authored
      - 增加降级链路环检测并拦截配置
      
      - 仅复用合法分组上下文并必要时回退查询
      
      - 标注 GetByIDLite 轻量语义并补充测试
      2597fe78
    • 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
    • IanShaw027's avatar
      feat(路由): 集成运维监控路由到服务器 · e0d12b46
      IanShaw027 authored
      - 更新路由器注册 ops 监控路由
      - 添加 ops 管理路由(dashboard, alerts, realtime, settings, ws)
      - 更新 gateway 路由支持请求追踪
      - 集成 ops 服务到 HTTP 服务器
      e0d12b46
    • 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
      feat(service): 实现运维监控业务逻辑层 · 5baa8b56
      IanShaw027 authored
      - 新增 ops 主服务(ops_service.go)和端口定义(ops_port.go)
      - 实现账号可用性检查服务(ops_account_availability.go)
      - 实现数据聚合服务(ops_aggregation_service.go)
      - 实现告警评估服务(ops_alert_evaluator_service.go)
      - 实现告警管理服务(ops_alerts.go)
      - 实现数据清理服务(ops_cleanup_service.go)
      - 实现并发控制服务(ops_concurrency.go)
      - 实现仪表板服务(ops_dashboard.go)
      - 实现错误处理服务(ops_errors.go)
      - 实现直方图服务(ops_histograms.go)
      - 实现指标采集服务(ops_metrics_collector.go)
      - 实现查询模式服务(ops_query_mode.go)
      - 实现实时监控服务(ops_realtime.go)
      - 实现请求详情服务(ops_request_details.go)
      - 实现重试机制服务(ops_retry.go)
      - 实现配置管理服务(ops_settings.go)
      - 实现趋势分析服务(ops_trends.go)
      - 实现窗口统计服务(ops_window_stats.go)
      - 添加 ops 相关领域常量
      - 注册 service 依赖注入
      5baa8b56
    • IanShaw027's avatar
      feat(repository): 实现运维监控数据访问层 · bb530327
      IanShaw027 authored
      - 新增 ops 主仓库(ops_repo.go)
      - 实现告警数据访问(ops_repo_alerts.go)
      - 实现仪表板数据访问(ops_repo_dashboard.go)
      - 实现直方图数据访问(ops_repo_histograms.go)
      - 实现延迟直方图桶逻辑(ops_repo_latency_histogram_buckets.go)
      - 新增延迟直方图桶测试(ops_repo_latency_histogram_buckets_test.go)
      - 实现指标数据访问(ops_repo_metrics.go)
      - 实现预聚合数据访问(ops_repo_preagg.go)
      - 实现请求详情数据访问(ops_repo_request_details.go)
      - 实现趋势数据访问(ops_repo_trends.go)
      - 实现窗口统计数据访问(ops_repo_window_stats.go)
      - 更新并发缓存支持 ops 场景
      - 注册 repository 依赖注入
      bb530327
    • IanShaw027's avatar
      feat(数据库): 添加运维监控数据模型和数据库迁移脚本 · d55866d3
      IanShaw027 authored
      - 新增 ops 监控数据库迁移脚本(表结构定义)
      - 定义核心数据模型(ops_models.go)
      - 定义告警相关模型(ops_alert_models.go)
      - 定义仪表板数据模型(ops_dashboard_models.go)
      - 定义实时监控数据模型(ops_realtime_models.go)
      - 定义配置相关模型(ops_settings_models.go)
      - 定义趋势分析数据模型(ops_trend_models.go)
      d55866d3
    • IanShaw027's avatar
      feat(基础设施): 添加运维监控功能的基础配置和依赖 · 4b9e47ce
      IanShaw027 authored
      - 更新 .gitignore 排除临时文件
      - 添加 ops 监控相关配置项到 config.yaml
      - 更新 Go 依赖包(go.mod/go.sum)
      - 扩展 config.go 支持 ops 监控配置
      - 新增上下文键定义(ClientRequestID)
      4b9e47ce