- 09 Mar, 2026 1 commit
-
-
yangjianbo authored
- 打通 service_tier 在 OpenAI HTTP、WS、passthrough 与 usage 记录中的传递 - 修正 priority/flex 计费逻辑,并将 fast 归一化为 priority - 在用户端和管理端补齐服务档位与计费明细展示 - 补齐前后端测试,并修复 WS 限流信号重复持久化导致的全量回归失败 Co-Authored-By:Claude Opus 4.6 <noreply@anthropic.com>
-
- 07 Mar, 2026 11 commits
-
-
shaw authored
-
shaw authored
-
shaw authored
- 移除staticcheck 470+冗余检查项,all已包含全部 - unused: generated-is-used改为true,跳过ent 13万行生成代码分析 - unused: exported-fields-are-used改为true,避免全项目导出字段引用追踪 - unused: field-writes-are-uses改为true
-
shaw authored
-
admin authored
-
shaw authored
后端UpdateAccountRequest.Status的oneof验证缺少error状态, 前端编辑表单也未处理error状态,导致编辑异常账号时无法保存
-
shaw authored
-
shaw authored
-
shaw authored
-
shaw authored
GO-2026-4602 (os), GO-2026-4601 (net/url), GO-2026-4600 and GO-2026-4599 (crypto/x509). The crypto/x509 fixes are only available in go1.26.1+, not backported to go1.25.x.
-
shaw authored
对齐/v1/responses的Forward方法,修复两处不一致: - 成功响应时从响应头提取OAuth账号的Codex使用量数据 - 非failover错误场景下应用管理员配置的错误透传规则
-
- 06 Mar, 2026 19 commits
-
-
JIA-ss authored
- Fix gofmt: align struct field comments in UsageCache, trim trailing whitespace on const comments - Fix errcheck: use comma-ok on type assertion for singleflight result Co-Authored-By:Claude Opus 4.6 <noreply@anthropic.com>
-
JIA-ss authored
Prevents 429 rate-limit retry storms and reduces upstream correlation risk for Anthropic usage API queries. Three changes: 1. Negative caching (1 min TTL) — 429/error responses are now cached, preventing every subsequent page load from re-triggering failed API calls. 2. singleflight dedup — concurrent requests for the same account are collapsed into a single upstream call, preventing cache stampede. 3. Random jitter (0–800 ms) — staggers multi-account cache-miss bursts so requests from different accounts don't hit upstream simultaneously with identical TLS fingerprints, reducing anti-abuse correlation risk. Co-Authored-By:Claude Opus 4.6 <noreply@anthropic.com>
-
shaw authored
-
神乐 authored
-
神乐 authored
-
FizzlyCode authored
从响应头 anthropic-ratelimit-unified-5h-utilization 获取并存储真实 utilization 值,解决进度条始终显示 0% 的问题。窗口重置时清除旧值, 避免残留上个窗口的数据。 Co-Authored-By:Claude Opus 4.6 <noreply@anthropic.com>
-
神乐 authored
-
神乐 authored
-
Elysia authored
-
神乐 authored
-
yangjianbo authored
移除订阅扣费 stub 中未被使用的状态字段与赋值, 消除 golangci-lint 的 unused 告警,保持回归测试语义不变。 Co-Authored-By:Claude Opus 4.6 <noreply@anthropic.com>
-
yangjianbo authored
抽取共享的用户分组专属倍率解析器,统一缓存、singleflight 与回退逻辑。\n\n让 OpenAI 独立计费链路复用专属倍率解析,修复 usage 记录与实际扣费未命中用户专属倍率的问题。\n\n补齐 OpenAI 计费与解析器单元测试,并修复全量回归中暴露的 lint 阻塞项。\n\nCo-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
-
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>
-
erio authored
透传模式账号仅替换认证,应允许所有模型通过。之前调度阶段的 isModelSupportedByAccount 不感知透传模式,导致 model_mapping 中未配置的新模型(如 gpt-5.4)被拒绝返回 503。
-
shaw authored
lite 模式下从快照缓存读取窗口费用,非 lite 模式查询后写入缓存
-
yangjianbo authored
补齐 gpt-5.4 fallback 的长上下文计费元信息,\n确保超过 272000 输入 token 时对整次会话应用\n2x 输入与 1.5x 输出计费规则。\n\n同时将官方快照 gpt-5.4-2026-03-05 加入前端\n白名单候选与回归测试,避免 whitelist 模式误拦截。\n\nCo-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> (cherry picked from commit d95497af87f608c6dadcbe7d6e851de9413ae147)
-
yangjianbo authored
- 接入 gpt-5.4 模型识别与规范化,补充默认模型列表 - 增加 gpt-5.4 输入/缓存命中/输出价格与计费兜底逻辑 - 同步前端模型白名单与 OpenCode 上下文窗口(1050000/128000) Co-Authored-By:Claude Opus 4.6 <noreply@anthropic.com> (cherry picked from commit 924476dcac6181cd0f3ee731ec7b73672ff03793)
-
- 05 Mar, 2026 9 commits
-
-
erio authored
LoadFactor should only affect scheduling weight, not load rate reporting.
-
erio authored
-
erio authored
- Fix bulk edit: send 0 instead of null/NaN to clear load_factor - Fix edit modal: explicit NaN check instead of implicit falsy - Fix create modal: use ?? instead of || for load_factor - Add load_factor upper limit validation (max 10000) - Add //go:build unit tag and self-contained intPtrHelper in test - Add design intent comments on WaitPlan.MaxConcurrency
-
erio authored
-
erio authored
-
erio authored
The test could flake depending on exact execution time near midnight boundaries. Use a range check (29 or 30) instead of exact equality.
-
erio authored
- Extract postUsageBilling() to consolidate billing logic across GatewayService.RecordUsage, RecordUsageWithLongContext, and OpenAIGatewayService.RecordUsage, eliminating ~120 lines of duplicated code - Fix account quota to use TotalCost × accountRateMultiplier (was using raw TotalCost, inconsistent with account cost stats) - Fix RecordUsageWithLongContext API Key quota only updating in balance mode (now updates regardless of billing type) - Fix WebSocket client disconnect detection on Windows by adding "an established connection was aborted" to known disconnect errors
-
erio authored
Antigravity APIKey accounts were incorrectly routed to testAntigravityAccountConnection which calls AntigravityTokenProvider, but the token provider only handles OAuth and Upstream types, causing "not an antigravity oauth account" error. Extract routeAntigravityTest to route APIKey accounts to native Claude/Gemini test paths based on model prefix, matching the gateway_handler routing logic for normal requests.
-
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
-