- 05 Feb, 2026 20 commits
-
-
yangjianbo authored
-
yangjianbo authored
-
yangjianbo authored
-
Wesley Liddick authored
fix(gemini): 修复已注册用户 OAuth 授权问题并增强错误提示
-
shaw authored
问题原因:Redis Pipeline 执行 Lua 脚本时出现 NOSCRIPT 错误, 因为 redis.NewScript 使用 EVALSHA 执行脚本,当 Redis 重启或 脚本未被缓存时,Pipeline 模式无法自动回退到 EVAL。 解决方案:在 NewSessionLimitCache 初始化时预加载所有 Lua 脚本 到 Redis,确保后续 Pipeline 执行时脚本已被缓存。
-
shaw authored
支持管理员配置上游错误如何返回给客户端: - 新增 ErrorPassthroughRule 数据模型和 Ent Schema - 实现规则的 CRUD API(/admin/error-passthrough-rules) - 支持按错误码、关键词匹配,支持 any/all 匹配模式 - 支持按平台过滤(anthropic/openai/gemini/antigravity) - 支持透传或自定义响应状态码和错误消息 - 实现两级缓存(Redis + 本地内存)和多实例同步 - 集成到 gateway_handler 的错误处理流程 - 新增前端管理界面组件 - 新增单元测试覆盖核心匹配逻辑 优化: - 移除 refreshLocalCache 中的冗余排序(数据库已排序) - 后端 Validate() 增加匹配条件非空校验
-
ianshaw authored
-
ianshaw authored
当 Gemini for Google Cloud API 未启用时(SERVICE_DISABLED 错误), 系统现在会: - 自动检测 403 PERMISSION_DENIED 错误 - 从错误响应中提取 API 激活 URL - 向用户显示清晰的错误消息和可点击的激活链接 - 提供操作指引(启用后等待几分钟) 新增文件: - internal/pkg/googleapi/error.go: Google API 错误解析器 - internal/pkg/googleapi/error_test.go: 完整的测试覆盖 - GEMINI_API_ERROR_HANDLING.md: 实现文档 修改文件: - internal/repository/geminicli_codeassist_client.go: 在 LoadCodeAssist 和 OnboardUser 中增强错误处理 这大大改善了用户体验,用户不再需要手动从错误日志中查找激活 URL。
-
shaw authored
-
shaw authored
-
IanShaw027 authored
问题:Google One Ultra 等已注册用户在 OAuth 授权时,如果 LoadCodeAssist 返回了 currentTier/paidTier 但没有返回 cloudaicompanionProject,之前的 逻辑会继续调用 onboardUser,导致 INVALID_ARGUMENT 错误。 修复:对齐 Gemini CLI 的处理逻辑: - 当检测到用户已注册(有 currentTier/paidTier)时,不再调用 onboardUser - 先尝试从 Cloud Resource Manager 获取可用项目 - 如果仍无法获取,返回友好的错误提示,引导用户手动填写 Project ID 这个修复解决了 Google One 订阅用户无法正常授权的问题。
-
shaw authored
-
Wesley Liddick authored
feat(gateway): filter /v1/usage stats by API Key instead of UserID
-
Wesley Liddick authored
feat: add support for HTTP/2 Cleartext (h2c) connections
-
Lemon authored
-
Lemon authored
-
shaw authored
- 新增 Access Token + Refresh Token 双令牌认证 - 支持 Token 自动刷新和轮转 - 添加登出和撤销所有会话接口 - 前端实现无感刷新和主动刷新定时器
-
JIA-ss authored
Previously the /v1/usage endpoint aggregated usage stats (today/total tokens, cost, RPM/TPM) across all API Keys belonging to the user. This made it impossible to distinguish usage from different API Keys (e.g. balance vs subscription keys). Now the usage stats are filtered by the current request's API Key ID, so each key only sees its own usage data. The balance/remaining fields are unaffected and still reflect the user-level wallet balance. Changes: - Add GetAPIKeyDashboardStats to repository interface and implementation - Add getPerformanceStatsByAPIKey helper (also fixes TPM to include cache_creation_tokens and cache_read_tokens) - Add GetAPIKeyDashboardStats to UsageService - Update Usage handler to call GetAPIKeyDashboardStats(apiKey.ID) Co-Authored-By:Claude Opus 4.5 <noreply@anthropic.com>
-
shaw authored
未知工具名不再进行 PascalCase/snake_case 转换,保持原样透传。 修复 text_editor_20250728 等 Anthropic 特殊工具被错误转换的问题。
-
Wesley Liddick authored
fix: remove unsupported safety_identifier and previous_response_id fields from upstream requests
-
- 04 Feb, 2026 5 commits
-
-
Lemon authored
-
shaw authored
问题:normalizeClaudeModelForAnthropic 函数错误地将长模型ID截断为短ID, 导致 APIKey 账号的模型名被错误修改。 修复: - 删除错误的 normalizeClaudeModelForAnthropic 函数和 anthropicPrefixMappings 变量 - 直接使用 claude.NormalizeModelID(正确的短ID->长ID扩展) - APIKey 账号无显式映射时透传原始模型名
-
Wesley Liddick authored
fix(gemini): 优化 Gemini 接口认证兼容性,支持 Authorization: Bearer
-
柴叁 authored
调整 API key 提取优先级,让 /v1beta 接口同时支持 x-goog-api-key 和 Authorization: Bearer 两种认证方式,解决 OpenClaw 等使用 Bearer 认证 的客户端无法直接访问 Gemini 接口的问题。
-
Payne Fu authored
Co-Authored-By:Claude Opus 4.5 <noreply@anthropic.com>
-
- 03 Feb, 2026 15 commits
-
-
Wesley Liddick authored
fix(api): 修复 thinking 块被意外修改导致的 400 错误
-
Wesley Liddick authored
fix(gemini): 导出 DummyThoughtSignature 常量并修复跨账号签名验证
-
Wesley Liddick authored
fix(openai): 统一 OAuth instructions 处理逻辑,修复 Codex CLI 400 错误
-
shaw authored
-
Wesley Liddick authored
Antigravity 相关BUG修复及调度优化
-
Wesley Liddick authored
-
liuxiongfeng authored
- 将 dummyThoughtSignature 改为导出的 DummyThoughtSignature 常量,供跨包使用 - 修改 gemini_native_signature_cleaner.go 将删除签名改为替换为 dummy 签名 这样可以跳过 Gemini 3 的签名验证,解决粘性会话切换账号时的验证失败问题 - 更新相关测试文件 Fixes: 粘性会话切换账号时 thoughtSignature 验证失败导致 400 错误
-
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 指令覆盖
-
Wesley Liddick authored
feat(api-key): 添加API密钥独立配额和过期时间功能
-
bayma888 authored
-
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.
-
Wesley Liddick authored
fix(proxy): 增加代理探测的多 URL 回退机制
-
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
-
Wesley Liddick authored
feat(admin): 管理员可查看每个用户充值和并发变动记录、点击余额可直接查看、优化弹框UI
-
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)
-