- 31 Dec, 2025 30 commits
-
-
NepetaLemon authored
* refactor: 迁移初始化 db 和 redis 到 repository * refactor: 迁移 errors 到 pkg
-
shaw authored
- NeedsRefresh 判断为 true 时输出 expires_at、time_until_expiry、window - 修正注释中的刷新窗口描述(10分钟 → 15分钟)
-
shaw authored
- 添加 normalizeLimit 函数,将 0 或负数限额规范化为 nil(无限制) - 简化 IncrementUsage,移除冗余的配额检查逻辑 - 配额检查已在请求前由中间件和网关完成 - 消费记录应无条件执行,确保数据完整性 - 删除测试限额超出行为的无效集成测试
-
shaw authored
-
shaw authored
-
shaw authored
GoReleaser 不支持 lower 模板函数,改为: - 在 GitHub Actions 中预处理小写 owner - 传递 GITHUB_REPO_OWNER_LOWER 环境变量给 GoReleaser
-
shaw authored
-
shaw authored
-
程序猿MT authored
-
yangjianbo authored
问题:软删除的记录仍占用唯一约束位置,导致删后无法重建同名/同邮箱/同订阅 修复方案:使用 PostgreSQL 部分唯一索引(WHERE deleted_at IS NULL) - User.email: 移除字段级 Unique(),改用部分唯一索引 - Group.name: 移除字段级 Unique(),改用部分唯一索引 - UserSubscription.(user_id, group_id): 移除组合唯一索引,改用部分唯一索引 - ApiKey.key: 保留普通唯一约束(安全考虑,已删除的 Key 不应重用) 安全性: - 应用层已有 ExistsByXxx 检查,自动过滤软删除记录 - 数据库层部分唯一索引提供最后一道防线
🤖 Generated with [Claude Code](https://claude.com/claude-code ) Co-Authored-By:Claude Opus 4.5 <noreply@anthropic.com>
-
shaw authored
新增 Account.GetCredentialAsTime 方法,统一处理凭证中的时间戳字段, 兼容 RFC3339 字符串、Unix 时间戳字符串和数字类型。 - 重构 Claude/Gemini/Antigravity TokenRefresher.NeedsRefresh - 移除重复的 parseExpiresAt/parseAntigravityExpiresAt 函数 - 简化 GetOpenAITokenExpiresAt 实现 - 新增 RFC3339 格式单元测试用例
-
yangjianbo authored
在以下端点添加 model 参数的必填验证,缺失时直接返回 400 错误: - /v1/messages - /v1/messages/count_tokens - /openai/v1/responses 修复前:空 model 会进入账号选择流程,最终由上游 API 返回错误 修复后:入口处直接拒绝,避免浪费资源和不明确的错误信息
🤖 Generated with [Claude Code](https://claude.com/claude-code ) Co-Authored-By:Claude Opus 4.5 <noreply@anthropic.com>
-
shaw authored
Remove redundant alignment whitespace before comments.
-
-
yangjianbo authored
问题: 1. Setting.value 字段设置了 NotEmpty() 约束,导致保存空字符串值时验证失败 2. 数据库 settings 表缺少 key 字段的唯一约束,导致 ON CONFLICT 语句执行失败 修复: - 移除 ent/schema/setting.go 中 value 字段的 NotEmpty() 约束 - 新增迁移 015_fix_settings_unique_constraint.sql 添加缺失的唯一约束 - 添加3个回归测试确保空值保存功能正常
🤖 Generated with [Claude Code](https://claude.com/claude-code ) Co-Authored-By:Claude Opus 4.5 <noreply@anthropic.com>
-
yangjianbo authored
补齐 Redis ZSET 前缀处理,确保并发释放计数正确 删除时改用 Client().Mutate 走更新逻辑,保留软删除记录 测试: make test-integration
-
yangjianbo authored
- errcheck: 修复类型断言未检查返回值的问题 - pool.go: 添加 sync.Map 类型断言安全检查 - req_client_pool.go: 添加 sync.Map 类型断言安全检查 - concurrency_cache_benchmark_test.go: 显式忽略断言返回值 - gateway_service.go: 显式忽略 WriteString 返回值 - gofmt: 修复代码格式问题 - redis.go: 注释对齐 - api_key_repo.go: 结构体字段对齐 - concurrency_cache.go: 字段对齐 - http_upstream.go: 注释对齐 - unused: 删除未使用的代码 - user_repo.go: 删除未使用的 sql 字段 - usage_service.go: 删除未使用的 calculateStats 函数
🤖 Generated with [Claude Code](https://claude.com/claude-code ) Co-Authored-By:Claude Opus 4.5 <noreply@anthropic.com>
-
程序猿MT authored
-
-
shaw authored
-
shaw authored
项目已有 BaseDialog.vue 组件提供相同功能,此组件属于误提交。
-
shaw authored
-
yangjianbo authored
冲突解决: - wire_gen.go: 合并 antigravityGatewayService 和 ProvideConcurrencyCache - user_repo_integration_test.go: 保留 NotFound 测试 - antigravity_gateway_service.go: 适配 httpUpstream.Do 新签名
🤖 Generated with [Claude Code](https://claude.com/claude-code ) Co-Authored-By:Claude Opus 4.5 <noreply@anthropic.com>
-
yangjianbo authored
## 数据完整性修复 (fix-critical-data-integrity) - 添加 error_translate.go 统一错误转换层 - 修复 nil 输入和 NotFound 错误处理 - 增强仓储层错误一致性 ## 仓储一致性修复 (fix-high-repository-consistency) - Group schema 添加 default_validity_days 字段 - Account schema 添加 proxy edge 关联 - 新增 UsageLog ent schema 定义 - 修复 UpdateBalance/UpdateConcurrency 受影响行数校验 ## 数据卫生修复 (fix-medium-data-hygiene) - UserSubscription 添加软删除支持 (SoftDeleteMixin) - RedeemCode/Setting 添加硬删除策略文档 - account_groups/user_allowed_groups 的 created_at 声明 timestamptz - 停止写入 legacy users.allowed_groups 列 - 新增迁移: 011-014 (索引优化、软删除、孤立数据审计、列清理) ## 测试补充 - 添加 UserSubscription 软删除测试 - 添加迁移回归测试 - 添加 NotFound 错误测试
🤖 Generated with [Claude Code](https://claude.com/claude-code ) Co-Authored-By:Claude Opus 4.5 <noreply@anthropic.com>
-
yangjianbo authored
超限且无可淘汰条目时拒绝新建 规范化代理地址并更新失败时的访问时间 补充连接池上限与代理规范化测试
-
Wei Shaw authored
-
yangjianbo authored
新增隔离策略与连接池缓存回收 连接池大小跟随账号并发并处理代理切换 同步配置默认值与示例并补充测试
-
shaw authored
-
yangjianbo authored
- system 字段存在即视为显式提供,避免 null 触发默认注入 - 日统计分组显式使用应用时区,缺失时从 TZ 回退到 UTC - 缓存写入队列丢弃日志节流汇总,关键任务同步回退 测试: go test ./internal/service -run TestBillingCacheServiceQueueHighLoad
-
yangjianbo authored
新增 DB/Redis 连接池配置与校验,并补充单测 网关请求体大小限制与 413 处理 HTTP/req 客户端池化并调整上游连接池默认值 并发槽位改为 ZSET+Lua 与指数退避 用量统计改 SQL 聚合并新增索引迁移 计费缓存写入改工作池并补测试/基准 测试: 在 backend/ 下运行 go test ./...
-
- 30 Dec, 2025 10 commits
-
-
song authored
-
song authored
-
song authored
- LoadCodeAssist/FetchAvailableModels 返回原始 JSON - extra 新增 load_code_assist 和 available_models 保存原始响应 - 前端 tier 从 load_code_assist.paidTier.id 提取 - 删除冗余的 updateAccountTier 函数
-
song authored
旧账户可能没有 project_id,在刷新配额时自动生成并保存。
-
song authored
部分账户类型(如 g1-pro-tier)API 不返回 cloudaicompanionProject, 但实际接受任意格式的 project_id,故添加随机生成逻辑作为兜底。
-
song authored
- 移除 project_id 强制检查,部分账户类型 API 不返回此字段 - 重构:提取 antigravity.NewAPIRequest() 统一创建 API 请求 - quota_refresher: 无 project_id 时仍可更新 tier 信息
-
shaw authored
在原生 SQL 的 CASE WHEN 语句中,PostgreSQL 无法自动推断占位符参数类型, 导致 time.Time 被当作 text 类型处理,与 last_used_at 列的 timestamptz 类型不匹配。 添加显式类型转换 ::timestamptz 解决此问题。
-
shaw authored
-
song authored
- 新增 AntigravityGatewayService.TestConnection 方法,支持 Claude/Gemini 双协议测试 - AccountTestService 改用 AntigravityGatewayService 进行测试连接 - GetAvailableModels 为 Antigravity 账号返回 Claude + Gemini 模型列表
-
yangjianbo authored
调整原因: - 防止高并发下出现 "too many open files" 错误 - 统一测试与生产环境的 ulimits 配置 改动内容: - 为 sub2api、postgres、redis 设置 nofile - 软硬限制均为 100000 测试: 未运行
-