Commit Graph
1923 Commits
Author SHA1 Message Date
erio 17397d3cc3 Merge branch 'release/custom-0.1.100' of github.com:touwaeriol/sub2api into release/custom-0.1.100
# Conflicts:
#	backend/internal/pkg/antigravity/client.go
#	backend/internal/service/antigravity_credits_overages.go
#	backend/internal/service/antigravity_credits_overages_test.go
#	frontend/src/components/account/__tests__/AccountStatusIndicator.spec.ts
2026-03-16 05:22:22 +08:00
erio 99845d0af9 Merge remote-tracking branch 'origin/pr/antigravity-credits-overages' into release/custom-0.1.100
# Conflicts:
#	frontend/src/components/account/AccountStatusIndicator.vue
2026-03-16 05:21:12 +08:00
erio 552a4b998a fix: resolve golangci-lint issues (gofmt, errcheck)
- Fix gofmt alignment in admin_service.go and trailing newline in
  antigravity_credits_overages.go
- Suppress errcheck for fmt.Sscanf in client.go GetMinimumAmount
2026-03-16 05:15:27 +08:00
erio 0d2061b268 fix: remove ClaudeMax references not yet in upstream/main
Remove SimulateClaudeMaxEnabled field and related logic from
admin_service.go, and remove applyClaudeMaxCacheBillingPolicyToUsage,
applyClaudeMaxNonStreamingRewrite, setupClaudeMaxStreamingHook calls
from antigravity_gateway_service.go. These symbols are not yet
available in upstream/main.
2026-03-16 05:01:42 +08:00
erio 8a260defc2 refactor: replace sync.Map credits state with AICredits rate limit key
Replace process-memory sync.Map + per-model runtime state with a single
"AICredits" key in model_rate_limits, making credits exhaustion fully
isomorphic with model-level rate limiting.

Scheduler: rate-limited accounts with overages enabled + credits available
are now scheduled instead of excluded.

Forwarding: when model is rate-limited + credits available, inject credits
proactively without waiting for a 429 round trip.

Storage: credits exhaustion stored as model_rate_limits["AICredits"] with
5h duration, reusing SetModelRateLimit/isRateLimitActiveForKey.

Frontend: show credits_active (yellow ⚡) when model rate-limited but
credits available, credits_exhausted (red) when AICredits key active.

Tests: add unit tests for shouldMarkCreditsExhausted, injectEnabledCreditTypes,
clearCreditsExhausted, and update existing overages tests.
2026-03-16 04:58:58 +08:00
SilentFlower f3f19d35aa feat: enhance Antigravity account overages handling and improve UI credit display 2026-03-16 04:58:35 +08:00
SilentFlower ced90e1d84 feat: add AI Credits balance handling and update model status indicators 2026-03-16 04:58:23 +08:00
SilentFlower 17e4033340 feat: implement resolveCreditsOveragesModelKey function to stabilize model key resolution for credit overages 2026-03-16 04:58:12 +08:00
erio 897c93528d feat: optimize Antigravity AI Credits scheduling - use AICredits rate limit key
Replace sync.Map + per-model runtime state with a single AICredits key in
model_rate_limits. Rate-limited accounts with available credits are now
scheduled directly and credits injected without a 429 round trip.

- Scheduler: rate-limited + overages + credits available = allow scheduling
- Forwarding: inject credits proactively when model rate limited
- Storage: credits exhaustion stored as model_rate_limits["AICredits"]
- Frontend: show credits_active (yellow ⚡) vs credits_exhausted states
- Bump version to 0.1.100.4
2026-03-16 03:51:34 +08:00
erio 0158cb8aa8 chore: bump version to 0.1.100.3 2026-03-16 02:11:09 +08:00
erio d6f549d025 feat: merge PR #1041 - Antigravity AI Credits overages handling & balance display
Merge upstream PR #1041 with fix: restore `len(input.Extra) > 0` guard
in UpdateAccount to prevent empty Extra map from accidentally clearing
existing Extra fields on non-Antigravity accounts.
2026-03-16 02:09:31 +08:00
erio 88dde89142 Merge branch 'feat/unified-oauth-refresh-api' into release/custom-0.1.100
# Conflicts:
#	backend/internal/service/token_refresh_service.go
2026-03-16 01:41:52 +08:00
erio 044d3a013d fix: suppress SA4006 unused value warning in Path A branch 2026-03-16 01:38:06 +08:00
erio 1fc9dd7b68 feat: unified OAuth token refresh API with distributed locking
Introduce OAuthRefreshAPI as the single entry point for all OAuth token
refresh operations, eliminating the race condition where background
refresh and inline refresh could simultaneously use the same
refresh_token (fixes #1035).

Key changes:
- Add OAuthRefreshExecutor interface extending TokenRefresher with CacheKey
- Add OAuthRefreshAPI.RefreshIfNeeded with lock → DB re-read → double-check flow
- Add ProviderRefreshPolicy / BackgroundRefreshPolicy strategy types
- Simplify all 4 TokenProviders to delegate to OAuthRefreshAPI
- Rewrite TokenRefreshService.refreshWithRetry to use unified API path
- Add MergeCredentials and BuildClaudeAccountCredentials helpers
- Add 40 unit tests covering all new and modified code paths
2026-03-16 01:31:54 +08:00
erio d844f3b6b5 feat: unified OAuth token refresh API to fix refresh_token race condition (#1035)
Introduce OAuthRefreshAPI as the single entry point for all OAuth token
refresh operations (both background TokenRefreshService and inline
TokenProvider), eliminating the race condition where two independent
refresh paths consume the same one-time-use refresh_token.

Key changes:
- New OAuthRefreshAPI with distributed lock + DB re-read + double-check
- All 4 platform refreshers implement OAuthRefreshExecutor (CacheKey)
- TokenRefreshService and TokenProviders share the same lock key
- Add errRefreshSkipped sentinel for accurate refresh statistics
- 7 new Path A unit tests covering all RefreshIfNeeded branches

chore: bump version to 0.1.100.2
2026-03-16 01:00:20 +08:00
SilentFlower 1137a7e60b feat: enhance Antigravity account overages handling and improve UI credit display 2026-03-16 00:45:38 +08:00
SilentFlower d3826fcb94 feat: add AI Credits balance handling and update model status indicators 2026-03-16 00:45:38 +08:00
SilentFlower 00553e00a3 feat: implement resolveCreditsOveragesModelKey function to stabilize model key resolution for credit overages 2026-03-16 00:45:09 +08:00
erio fa7d5be25b chore: bump version to 0.1.100.1 2026-03-15 20:08:25 +08:00
erio db5b206b22 Merge branch 'main' into release/custom-0.1.100 2026-03-15 20:07:02 +08:00
erio e72ea822c9 Merge branch 'release/custom-0.1.99' 2026-03-15 19:26:31 +08:00
erio 8688e4b78e chore: bump version to 0.1.99.7 2026-03-15 19:26:04 +08:00
erio ec9dfb0d3f feat(web): support local file override for embedded static assets
Add override directory (data/public/) that takes precedence over
embed FS, allowing per-deployment static file customization via
docker volume mounts without rebuilding the image.
2026-03-15 19:25:43 +08:00
Wesley Liddick d3a9f5bb88 Merge pull request #1027 from touwaeriol/feat/ignore-insufficient-balance-errors
feat(ops): add ignore insufficient balance errors toggle and extract error constants
2026-03-15 19:10:18 +08:00
Wesley Liddick 7eb0415a8a Merge pull request #1028 from IanShaw027/fix/open-issues-cleanup
fix: 修复多个issues - Gemini schema 兼容性、批量编辑白名单、Docker 工具支持和限额字段处理Fix/open issues cleanup
2026-03-15 19:09:49 +08:00
erio a0c6525d6f Merge branch 'release/custom-0.1.99' 2026-03-15 19:05:38 +08:00
erio ccffa0640a chore: bump version to 0.1.99.6 2026-03-15 19:05:13 +08:00
erio 1394ae6535 fix(ops): align constant declarations for gofmt compliance 2026-03-15 19:05:02 +08:00
erio bdbc8fa08f fix(ops): align constant declarations for gofmt compliance 2026-03-15 18:55:14 +08:00
erio 63f3af0f94 fix(ops): match "insufficient account balance" in error filter
The upstream Gemini API returns "Insufficient account balance" which
doesn't contain the substring "insufficient balance". Add explicit
match for the full phrase to ensure the filter works correctly.
2026-03-15 18:45:48 +08:00
erio 5c1afd4f75 Merge branch 'release/custom-0.1.99' 2026-03-15 18:44:53 +08:00
erio 3caa91985c chore: bump version to 0.1.99.5 2026-03-15 18:44:38 +08:00
erio 5f60a1ad27 fix(ops): match "insufficient account balance" in error filter
The upstream Gemini API returns "Insufficient account balance" which
doesn't contain the substring "insufficient balance". Add explicit
match for the full phrase to ensure the filter works correctly.
2026-03-15 18:44:25 +08:00
erio 1b67a02371 fix(ops): match "insufficient account balance" in error filter
The upstream Gemini API returns "Insufficient account balance" which
doesn't contain the substring "insufficient balance". Add explicit
match for the full phrase to ensure the filter works correctly.
2026-03-15 18:44:13 +08:00
IanShaw027 686f890fbf style: 修复 gofmt 格式问题 2026-03-15 18:42:32 +08:00
shaw ae44a94325 fix: 重置密码功能新增UI配置发送邮件域名 2026-03-15 17:52:29 +08:00
IanShaw 3718d6dcd4 Merge branch 'Wei-Shaw:main' into fix/open-issues-cleanup 2026-03-15 17:49:20 +08:00
IanShaw027 90b3838173 fix: 移除 Gemini 不支持的 patternProperties 字段 #795 2026-03-15 17:46:58 +08:00
IanShaw027 c31974c913 fix: 兼容部分限额字段为空的情况 #1021
修复在填写限额时,如果不填写完整的三个限额额度(日限额、周限额、月限额)就会报错的问题。

变更内容:
- 后端:添加 optionalLimitField 类型处理空值和空字符串,兼容部分限额字段为空的情况
- 前端:添加 normalizeOptionalLimit 函数规范化限额输入,将空值、空字符串和无效数字统一处理为 null
2026-03-15 17:46:58 +08:00
erio 79590b7d11 Merge branch 'release/custom-0.1.99' 2026-03-15 17:42:33 +08:00
erio 9f573fed55 chore: bump version to 0.1.99.4 2026-03-15 17:42:18 +08:00
erio 978a2cd915 Merge branch 'release/custom-0.1.99' 2026-03-15 17:35:37 +08:00
erio 77a9b4f420 chore: bump version to 0.1.99.3 2026-03-15 17:35:10 +08:00
erio 6ba6fa5873 feat(ops): add ignore insufficient balance errors toggle and extract error constants
- Add 5th error filter switch IgnoreInsufficientBalanceErrors to suppress
  upstream insufficient balance / insufficient_quota errors from ops log
- Extract hardcoded error strings into package-level constants for
  shouldSkipOpsErrorLog, normalizeOpsErrorType, classifyOpsPhase, and
  classifyOpsIsBusinessLimited
- Define ErrNoAvailableAccounts sentinel error and replace all
  errors.New("no available accounts") call sites
- Update tests to use require.ErrorIs with the sentinel error
2026-03-15 17:34:57 +08:00
erio cfe72159d0 feat(ops): add ignore insufficient balance errors toggle and extract error constants
- Add 5th error filter switch IgnoreInsufficientBalanceErrors to suppress
  upstream insufficient balance / insufficient_quota errors from ops log
- Extract hardcoded error strings into package-level constants for
  shouldSkipOpsErrorLog, normalizeOpsErrorType, classifyOpsPhase, and
  classifyOpsIsBusinessLimited
- Define ErrNoAvailableAccounts sentinel error and replace all
  errors.New("no available accounts") call sites
- Update tests to use require.ErrorIs with the sentinel error
2026-03-15 17:26:18 +08:00
erio 3439a6ab75 feat(ops): add ignore insufficient balance errors toggle and extract error constants
- Add 5th error filter switch IgnoreInsufficientBalanceErrors to suppress
  upstream insufficient balance / insufficient_quota errors from ops log
- Extract hardcoded error strings into package-level constants for
  shouldSkipOpsErrorLog, normalizeOpsErrorType, classifyOpsPhase, and
  classifyOpsIsBusinessLimited
- Define ErrNoAvailableAccounts sentinel error and replace all
  errors.New("no available accounts") call sites
- Update tests to use require.ErrorIs with the sentinel error
2026-03-15 17:25:35 +08:00
Wesley Liddick 8321e4a647 Merge pull request #1023 from YanzheL/fix/claude-output-effort-logging
fix: extract and log Claude output_config.effort in usage records
2026-03-15 16:45:37 +08:00
Wesley Liddick 3084330d0c Merge pull request #1019 from Ethan0x0000/feat/usage-endpoint-distribution
feat: add endpoint metadata and usage endpoint distribution insights
2026-03-15 16:42:03 +08:00
Wesley Liddick b566649e79 Merge pull request #1025 from touwaeriol/fix/rate-limit-nil-window-reset
fix(billing): treat nil rate limit window as expired to prevent usage accumulation
2026-03-15 16:33:14 +08:00
Wesley Liddick 10a6180e4a Merge pull request #1026 from touwaeriol/fix/group-quota-clear
fix(billing): allow clearing group quota limits and treat 0 as zero-limit
2026-03-15 16:33:00 +08:00