- 13 Mar, 2026 1 commit
-
-
Rose Ding authored
新增管理员专属的数据库备份与恢复功能: - 全量 PostgreSQL 备份(pg_dump),gzip 压缩后上传到 S3 兼容存储 - 支持手动备份和 cron 定时备份 - 支持从备份恢复(psql --single-transaction) - 备份文件自动过期清理(默认 14 天) - 前端完整管理页面(S3 配置、定时配置、备份列表、恢复/下载/删除) - 内置 Cloudflare R2 配置教程弹窗 - Dockerfile 从 postgres 镜像多阶段复制 pg_dump/psql,确保版本一致 Co-Authored-By:Claude Opus 4.6 <noreply@anthropic.com>
-
- 12 Mar, 2026 1 commit
-
-
QTom authored
-
- 11 Mar, 2026 7 commits
-
-
shaw authored
将 /v1/chat/completions 端点从 ResponseWriter 劫持模式重构为独立的 类型安全转换路径,与 Anthropic Messages 端点架构对齐: - 在 apicompat 包新增 Chat Completions 完整类型定义和双向转换器 - 新增 ForwardAsChatCompletions service 方法,走 Responses API 上游 - Handler 改为独立的账号选择/failover 循环,不再劫持 Responses handler - 提取 handleCompatErrorResponse 为 Chat Completions 和 Messages 共用 - 删除旧的 forwardChatCompletions 直传路径及相关死代码
-
ius authored
-
Rose Ding authored
-
ius authored
-
ius authored
-
7976723 authored
1. 修复 WriteFilteredHeaders API 不兼容(2处): 将 s.cfg.Security.ResponseHeaders 改为 s.responseHeaderFilter, 因为 main 分支已将函数签名改为接受 *responseheaders.CompiledHeaderFilter 2. 修复 writer 生命周期导致的 nil pointer panic: ChatCompletions handler 替换了 c.Writer 但未恢复,导致 OpsErrorLogger 中间件的 defer 释放 opsCaptureWriter 后, Logger 中间件调用 c.Writer.Status() 触发空指针解引用。 通过保存并恢复 originalWriter 修复。 3. 为 chatCompletionsResponseWriter 添加防御性 Status() 和 Written() 方法,包含 nil 安全检查 4. 恢复 gateway.go 中被误删的 net/http import
-
7976723 authored
基于 @yulate 在 PR #648 (commit 0bb6a392) 的工作,解决了与最新 main 分支的合并冲突。 原始功能(@yulate): - 添加 /v1/chat/completions 和 /chat/completions 兼容端点 - 将 Chat Completions 请求转换为 Responses API 格式并转换回来 - 添加 API Key 直连转发支持 - 包含单元测试 Co-authored-by:yulate <yulate@users.noreply.github.com>
-
- 10 Mar, 2026 3 commits
-
-
wucm667 authored
新增以下运维告警指标类型: - group_available_accounts: 组内可用账户数 - group_available_ratio: 组内可用账户比例 - group_rate_limit_ratio: 组内限速账户比例 - account_rate_limited_count: 限速账户数 - account_error_count: 错误账户数 - account_error_ratio: 错误账户比例 - overload_account_count: 过载账户数 包含比例和计数类指标的评估逻辑,并注册新的百分比类指标用于阈值校验。
-
haruka authored
- Add AdminResetQuota service method to reset daily/weekly usage windows - Add POST /api/v1/admin/subscriptions/:id/reset-quota handler and route - Add resetQuota API function in frontend subscriptions client - Add reset quota button, confirmation dialog, and handlers in SubscriptionsView - Add i18n keys for reset quota feature in zh and en locales Co-Authored-By:Claude Sonnet 4.6 <noreply@anthropic.com>
-
shaw authored
-
- 09 Mar, 2026 6 commits
-
-
QTom authored
- 提取 refreshSingleAccount 私有方法复用单账号刷新逻辑 - 新增 BatchClearError handler (POST /admin/accounts/batch-clear-error) - 新增 BatchRefresh handler (POST /admin/accounts/batch-refresh) - 前端 AccountBulkActionsBar 添加批量重置状态/刷新令牌按钮 - AccountsView 添加 handler 支持 partial success 反馈 - i18n 中英文补充批量操作相关翻译
-
QTom authored
提取 DecodeIDToken(跳过过期校验)供导入场景使用, ParseIDToken 复用它并保留原有过期检查行为。 导入 OpenAI/Sora OAuth 账号时自动补充缺失的 email、 plan_type、chatgpt_account_id 等字段,不覆盖已有值。
-
erio authored
When the service restarts, concurrency slots from the old process remain in Redis, causing phantom occupancy. On startup, scan all concurrency sorted sets and remove members with non-current process prefix, then clear orphaned wait queue counters. Uses Go-side SCAN to discover keys (compatible with Redis client prefix hooks in tests), then passes them to a Lua script for atomic member-level cleanup. Co-Authored-By:Claude Opus 4.6 <noreply@anthropic.com>
-
shaw authored
-
shaw authored
-
yangjianbo authored
- 打通 service_tier 在 OpenAI HTTP、WS、passthrough 与 usage 记录中的传递 - 修正 priority/flex 计费逻辑,并将 fast 归一化为 priority - 在用户端和管理端补齐服务档位与计费明细展示 - 补齐前后端测试,并修复 WS 限流信号重复持久化导致的全量回归失败 Co-Authored-By:Claude Opus 4.6 <noreply@anthropic.com>
-
- 08 Mar, 2026 3 commits
- 07 Mar, 2026 9 commits
-
-
kyx236 authored
- 为定时测试计划增加 auto_recover 配置,补齐前后端类型、接口、仓储与数据库迁移 - 在定时测试成功后自动恢复账号 error、rate-limit 等可恢复运行时状态 - 新增 /admin/accounts/:id/recover-state 接口,合并原有重置状态与清限流操作 - 更新账号管理菜单与定时测试面板,补充自动恢复开关、说明提示和状态展示 - 补充账号恢复、限流清理与仓储同步相关测试
-
shaw authored
Align struct field assignments and fix indentation detected by golangci-lint v2.9's gofmt checker.
-
shaw authored
-
erio authored
Extend the existing total quota limit with daily and weekly periodic dimensions. Each dimension is independently configurable and uses lazy reset — when the period expires, usage is automatically reset to zero on the next increment. Any dimension exceeding its limit will pause the account from scheduling. Backend: - Add GetQuotaDailyLimit/Used, GetQuotaWeeklyLimit/Used, HasAnyQuotaLimit - Rewrite IncrementQuotaUsed with atomic CTE SQL for 3-dimension update - Rewrite ResetQuotaUsed to clear all dimensions and period timestamps - Update postUsageBilling to use HasAnyQuotaLimit() - Preserve daily/weekly used values on account edit Frontend: - Refactor QuotaLimitCard from single v-model to 3-dimension props - Add QuotaBadge component for compact D/W/$ display - Update AccountCapacityCell with per-dimension badges - Update Create/Edit modals with daily/weekly quota fields - Update AccountActionMenu hasQuotaLimit to check all dimensions - Add i18n strings for daily/weekly/total quota labels Co-Authored-By:Claude Opus 4.6 <noreply@anthropic.com>
-
shaw authored
-
shaw authored
-
shaw authored
后端UpdateAccountRequest.Status的oneof验证缺少error状态, 前端编辑表单也未处理error状态,导致编辑异常账号时无法保存
-
shaw authored
-
shaw authored
对齐/v1/responses的Forward方法,修复两处不一致: - 成功响应时从响应头提取OAuth账号的Codex使用量数据 - 非failover错误场景下应用管理员配置的错误透传规则
-
- 06 Mar, 2026 7 commits
-
-
shaw authored
-
神乐 authored
-
神乐 authored
-
wioos authored
commit 80ae592c 引入 lite 模式优化首次加载性能,但将窗口费用查询也一起跳过了。 commit 491a7444 尝试用 30 秒快照缓存修复,但缓存过期后问题复现。 移除窗口费用查询的 lite/非 lite 区分,始终执行 PostgreSQL 聚合查询。 同时删除不再需要的 account_window_cost_cache.go 文件。 Co-Authored-By:
Claude Opus 4.6 <noreply@anthropic.com>
-
alfadb authored
- Add recoverAnthropicMessagesPanic for Messages handler to return Anthropic-formatted errors instead of OpenAI Responses format on panic - Add nil check for rateLimitService.HandleUpstreamError in ForwardAsAnthropic to match defensive pattern used elsewhere Co-Authored-By:Claude Opus 4.6 <noreply@anthropic.com>
-
alfadb authored
Add Anthropic Messages API support for OpenAI platform groups, enabling clients using Claude-style /v1/messages format to access OpenAI accounts through automatic protocol conversion. - Add apicompat package with type definitions and bidirectional converters (Anthropic
↔ Chat, Chat↔ Responses, Anthropic↔ Responses) - Implement /v1/messages endpoint for OpenAI gateway with streaming support - Add model mapping UI for OpenAI OAuth accounts (whitelist + mapping modes) - Support prompt caching fields and codex OAuth transforms - Fix tool call ID conversion for Responses API (fc_ prefix) - Ensure function_call_output has non-empty output field Co-Authored-By:Claude Opus 4.6 <noreply@anthropic.com>
-
shaw authored
lite 模式下从快照缓存读取窗口费用,非 lite 模式查询后写入缓存
-
- 05 Mar, 2026 3 commits
-
-
erio authored
-
erio authored
- Add configurable spending limit (quota_limit) for apikey-type accounts - Atomic quota accumulation via PostgreSQL JSONB operations on TotalCost - Scheduler filters out over-quota accounts with outbox-triggered snapshot refresh - Display quota usage ($used / $limit) in account capacity column - Add "Reset Quota" action in account menu to reset usage to zero - Editing account settings preserves quota_used (no accidental reset) - Covers all 3 billing paths: Anthropic, Gemini, OpenAI RecordUsage chore: bump version to 0.1.90.4
-
程序猿MT authored
-