"backend/ent/vscode:/vscode.git/clone" did not exist on "a738688287c6faa0834cad770c4a34a2c0f38696"
  1. 29 Apr, 2026 1 commit
    • shaw's avatar
      fix(scheduler): resolve SetSnapshot race conditions and remove usage throttle · 8bf2a7b8
      shaw authored
      Backend: Fix three race conditions in SetSnapshot that caused account
      scheduling anomalies and broken sticky sessions:
      - Use Lua CAS script for atomic version activation, preventing version
        rollback when concurrent goroutines write snapshots simultaneously
      - Add UnlockBucket to release rebuild lock immediately after completion
        instead of waiting 30s TTL expiry
      - Replace immediate DEL of old snapshots with 60s EXPIRE grace period,
        preventing readers from hitting empty ZRANGE during version switches
      
      Frontend: Remove serial queue throttle (1-2s delay per request) from
      usage loading since backend now uses passive sampling. All usage
      requests execute immediately in parallel.
      8bf2a7b8
  2. 26 Apr, 2026 1 commit
    • shaw's avatar
      feat(affiliate): 完善邀请返利系统 · 9b6dcc57
      shaw authored
        - 修复返利不到账的根因:tryClaimAffiliateRebateAudit 中 PostgreSQL 参数类型推断冲突
        - 补全 OAuth 注册路径(LinuxDo/OIDC/WeChat/Pending Flow)的邀请码绑定
        - 前端 OAuth 注册页面传递 aff_code 参数
        - 新增返利冻结期机制:可配置冻结时间,到期后自动解冻(懒解冻)
        - 新增返利有效期:绑定后 N 天内有效,过期不再产生返利
        - 新增单人返利上限:超出上限部分精确截断
        - 增强返利流程 slog 结构化日志,便于排查问题
        - 已邀请用户列表增加返利明细列
      9b6dcc57
  3. 25 Apr, 2026 1 commit
    • shaw's avatar
      feat(affiliate): add feature toggle and per-user custom invite settings · 4e1bb2b4
      shaw authored
      - 在系统设置「功能开关」中新增邀请返利总开关,默认关闭;
        关闭态:菜单隐藏、注册忽略 aff、新充值不返利,但已有 quota 仍可转余额
      - 支持管理员为指定用户设置专属邀请码(覆盖随机码,全局唯一)
      - 支持管理员为指定用户设置专属返利比例(覆盖全局比例,可单条/批量调整)
      - 在系统设置邀请返利卡片内嵌入专属用户管理表格(搜索/编辑/批量/删除),
        删除采用项目通用 ConfirmDialog,会同时清除专属比例并把邀请码重置为系统随机码
      - /affiliate 用户页新增「我的返利比例」卡片与动态使用说明,让用户直观看到
        分享后能拿到多少(同源 resolveRebateRatePercent 计算,与实际充值一致)
      - 新增数据库迁移 132 添加 aff_rebate_rate_percent 与 aff_code_custom 列
      - 新增 admin 路由组 /api/v1/admin/affiliates/users/* 共 5 个端点
      - AffiliateService 改为只依赖 *SettingService,去除冗余的 SettingRepository
      - 邀请码格式校验放宽到 [A-Z0-9_-]{4,32},兼容旧 12 位系统码与新自定义码
      - 补充单元测试与集成测试覆盖新方法、冲突路径与边界值
      4e1bb2b4
  4. 23 Apr, 2026 2 commits
    • erio's avatar
      revert: remove fork-only changes from release sync · 67518a59
      erio authored
      Revert payment/wechat, sora/claude-max cleanup, fork-only migrations,
      and cosmetic changes that were brought in by the release sync commit.
      Keep only channel-monitor related improvements:
      - PublicSettingsInjectionPayload named struct with drift test
      - ChannelMonitorRunner graceful shutdown in wire
      - image_output_price in SupportedModelChip
      - Simplified buildSelfNavItems in AppSidebar
      - Gateway WARN logs for 503 branches
      67518a59
    • erio's avatar
      sync: bring over remaining release/custom-0.1.115 changes · 748a84d8
      erio authored
      - Extract PublicSettingsInjectionPayload named struct with drift test
      - Add channel_monitor_default_interval_seconds to SSR injection
      - Add image_output_price to SupportedModelChip
      - Simplify AppSidebar buildSelfNavItems (admins see available channels)
      - Add gateway WARN logs for 503 no-available-accounts branches
      - Wire ChannelMonitorRunner into provideCleanup for graceful shutdown
      - Add migrations 130/131 (CC template userid fix + mimicry field cleanup)
      - Clean up fork-only features (sora, claude max simulation, client affinity)
      - Remove ~320 obsolete i18n keys
      - Add codexUsage utility, WechatServiceButton, BulkEditAccountModal
      - Tidy go.sum
      748a84d8
  5. 21 Apr, 2026 3 commits
    • IanShaw027's avatar
      Fix mobile payment launch detection · 906802ab
      IanShaw027 authored
      906802ab
    • IanShaw027's avatar
      Fix mobile payment launch detection · a13ae5a0
      IanShaw027 authored
      a13ae5a0
    • erio's avatar
      fix(settings): inject channel_monitor & available_channels into SSR payload · 84b03efa
      erio authored
      Root cause: GetPublicSettingsForInjection used an inline struct that silently
      drifted from dto.PublicSettings and omitted channel_monitor_enabled /
      available_channels_enabled. On refresh window.__APP_CONFIG__ lacked these
      keys, so cachedPublicSettings.available_channels_enabled resolved to
      undefined and the opt-in sidebar entry (=== true) disappeared.
      
      Backend: extract PublicSettingsInjectionPayload as a named type with all
      feature-flag fields wired, and add a reflect-based drift test in the dto
      package so forgetting a future flag fails CI instead of the browser.
      
      Frontend: introduce utils/featureFlags.ts as the single registry for
      public-settings-driven toggles, with explicit opt-in / opt-out modes that
      encode the pre-load fallback. AppSidebar switches to makeSidebarFlag() so
      adding a new switch only touches the registry.
      84b03efa
  6. 20 Apr, 2026 3 commits
    • erio's avatar
      refactor(channels): consolidate pricing index, tighten types, polish DTOs · 365ef1fd
      erio authored
      Follow-up to the available-channels review pass. No behavior change for
      end users; tightens internals based on three independent code reviews.
      
      Backend
      - service/channel.go: collapse buildPricingLookup + pricedNamesFor
        into a single platformPricingIndex (byLower + originalCase + ordered
        names), built once per SupportedModels call. Fixes a casing-
        consistency bug where the same logical model appeared with mapping
        case in the exact branch but pricing case in the wildcard branch —
        pricing's original case now wins everywhere.
      - service/channel.go: doc that a mapping key of just "*" expands to
        every priced model on the platform (intentional "passthrough all").
      - service/channel_available.go: normalize empty BillingModelSource to
        channel_mapped at construction time, removing the same fallback
        duplicated in the admin DTO mapper and the admin Vue template.
      - handler/admin/available_channel_handler.go: unexport
        availableChannelToAdminResponse (same-package usage only); mapper
        is now a pure passthrough.
      - handler/available_channel_handler.go: drop the middleware2 alias
        (no name collision in this file).
      
      Frontend
      - utils/pricing.ts: extract formatScaled, used by SupportedModelChip
        and PricingRow.
      - api/admin/channels.ts: re-export BillingMode from constants/channel;
        tighten Channel.status / billing_model_source to ChannelStatus /
        BillingModelSource (and same for AvailableChannel).
      - components/channels/AvailableChannelsTable.vue: drop dead
        withDefaults wrapper (loading is required, both call sites pass it).
      - views/admin/AvailableChannelsView.vue: drop the redundant
        || BILLING_MODEL_SOURCE_CHANNEL_MAPPED fallback (now applied in
        service layer); remove unused import.
      - i18n zh + en: delete unused tierLabel and tokenRange keys from
        both availableChannels.pricing and admin.availableChannels.pricing.
      
      Tests
      - New: SupportedModels_ExactKeyUsesPricedCaseWhenAvailable locks the
        pricing-case-wins rule.
      - New: SupportedModels_AsteriskOnlyMappingExpandsAllPriced documents
        the "*" expansion rule.
      - Admin handler: existing tests adjusted to pass an explicit
        BillingModelSource (default-fill is now exercised by service tests).
      365ef1fd
    • erio's avatar
      feat(channel-monitor): gate UI by feature switch + polish form UX · ba98243c
      erio authored
      - AppSidebar 三处菜单项(管理端渠道监控、用户端/个人页渠道状态)按
        channel_monitor_enabled 条件展开,关闭时隐藏
      - ChannelStatusView setInterval 随开关启停:关闭 clearInterval,
        开启/未知态自动启动,避免禁用功能后仍在轮询
      - MonitorFormDialog provider Select 改为 3 色单选按钮
        (openai=emerald / anthropic=orange / gemini=sky),i18n 文案
        供应商 → 平台 / Provider → Platform
      - MonitorKeyPickerDialog 按钮列表改为 name/key/group 三列表格 +
        搜索框,按 key.group.platform === provider 过滤,避免跨平台误选
      - form.provider 变化时清空 api_key,修复切换平台仍保留旧 key 的
        错配 bug
      - providerPickerClass 抽取到 useChannelMonitorFormat composable,
        统一 emerald/orange/sky 颜色语义,消除硬编码 Tailwind class 重复
      - maskApiKey 工具函数统一(utils/maskApiKey.ts),KeysView 与
        MonitorKeyPickerDialog 共用 slice(0,6)...slice(-4) 策略
      - bump version to 0.1.114.27
      ba98243c
    • erio's avatar
      feat(payment): i18n payment error codes and label localization · 40d4e167
      erio authored
      Pairs with the backend structured payment errors (reason + metadata). The
      frontend now maps reason codes to localized messages with metadata as
      interpolation variables, and automatically localizes raw config-field names
      (e.g. "certSerial" → "证书序列号") using the existing UI-label i18n
      namespace.
      
      - frontend/src/utils/apiError.ts
        - extractApiErrorCode now prefers the string `reason` over the numeric HTTP
          `code`; reason is granular enough to drive i18n lookup, HTTP code is not.
        - New extractApiErrorMetadata to pull interpolation params off the error.
        - New extractI18nErrorMessage(err, t, namespace, fallback): looks up
          `<namespace>.<REASON>` in i18n and substitutes metadata. Before
          substitution, `metadata.key` and `metadata.keys` (slash-joined) are
          re-translated through `admin.settings.payment.field_<key>` so users see
          "缺少必填项:证书序列号" instead of "缺少必填项:certSerial".
      
      - frontend/src/i18n/locales/{zh,en}.ts
        - Add payment.errors entries for every structured reason code returned by
          the backend (PAYMENT_DISABLED, INVALID_AMOUNT, TOO_MANY_PENDING,
          DAILY_LIMIT_EXCEEDED, NO_AVAILABLE_INSTANCE, PAYMENT_PROVIDER_MISCONFIGURED,
          WXPAY_CONFIG_MISSING_KEY / INVALID_KEY_LENGTH / INVALID_KEY, NOT_FOUND,
          FORBIDDEN, CONFLICT, INVALID_ORDER_TYPE, INVALID_STATUS,
          BALANCE_NOT_ENOUGH, REFUND_AMOUNT_EXCEEDED, REFUND_FAILED, and more),
          with placeholders for template variables.
      
      - 13 payment-related Vue files
        - Migrate catch-block error reporting from extractApiErrorMessage to
          extractI18nErrorMessage(err, t, 'payment.errors', fallback).
        - Remove the ad-hoc paymentErrorMap computed in SettingsView.vue, which the
          new helper supersedes (it reads i18n directly via t).
      
      - frontend/src/components/payment/providerConfig.ts
        - wxpay: publicKey and publicKeyId are now required (was optional), matching
          the pubkey-only verifier direction; certSerial is already required.
      
      This PR is drop-in safe: reason-preferring extractApiErrorCode is backward
      compatible with callers that pass their own i18nMap, and error codes missing
      from i18n fall back to the existing message-based path.
      40d4e167
  7. 19 Apr, 2026 1 commit
  8. 14 Apr, 2026 2 commits
    • erio's avatar
      fix: flaky WebSocket test, usage request queue, and test improvements · 3fa5b8bc
      erio authored
      - Fix flaky WebSocket passthrough test: allow StatusNormalClosure after
        client close instead of requiring NoError (race condition fix)
      - Fix ratelimit 401 test: use PlatformOpenAI instead of PlatformGemini
        for OAuth token cache invalidation scenario (more accurate)
      - Add usageLoadQueue: Anthropic OAuth/setup-token accounts sharing the
        same proxy exit are serialized with 1-2s jitter to prevent upstream 429
      - AccountUsageCell: add module-level usage cache (5min TTL), unmounted
        safety guard, and integrate enqueueUsageRequest for throttled fetching
      3fa5b8bc
    • erio's avatar
      fix: address audit findings across websearch, notify, and channel pricing · a68df457
      erio authored
      Backend fixes:
      - Fix balance notify ignoring percentage threshold type (was treating
        percentage value as fixed USD amount)
      - Remove dead code parseJSONStringArray
      - Add ImageOutputTokens to tryModelFilePricing calculation
      - Unify zero-value check: cost == 0 → cost <= 0 in calculateTokenStatsCost
      - Use MarshalNotifyEmails instead of json.Marshal for consistency
      - Rename quotaDim.oldUsed → currentUsed for clarity
      - Extract HTML email templates to const variables (function ≤30 lines)
      
      Test fixes:
      - Rewrite account_websearch_test.go for GetWebSearchEmulationMode tri-state
      - Add 6 tryModelFilePricing test cases
      
      Frontend fixes:
      - Replace hardcoded '未命名' with i18n key
      - Extract getBillingModeLabel/getBillingModeBadgeClass to shared utils
      - Replace inline type with imported NotifyEmailEntry
      - Pass platform to AccountStats pricing rules via inferRulePlatform()
      - Add billing mode constants (BILLING_MODE_TOKEN/PER_REQUEST/IMAGE)
      a68df457
  9. 11 Apr, 2026 2 commits
    • erio's avatar
      feat(payment): add H5/mobile payment support · 75155903
      erio authored
      Backend:
      - Parse EasyPay `payurl2` field, prefer H5 link on mobile
      - Add `device=mobile` to EasyPay submit.php (popup) mode
      - Expand isMobile detection keywords (add ipad/ipod)
      
      Frontend:
      - Add `isMobileDevice()` utility (userAgentData + UA regex)
      - Mobile + pay_url: direct redirect instead of QR/popup
      - Popup blocked fallback: auto-redirect when window.open fails
      - Stripe WeChat Pay: dynamic client param (mobile_web vs web)
      75155903
    • erio's avatar
      feat(payment): add complete payment system with multi-provider support · 63d1860d
      erio authored
      Add a full payment and subscription system supporting EasyPay (Alipay/WeChat),
      Stripe, and direct Alipay/WeChat Pay providers with multi-instance load balancing.
      63d1860d
  10. 10 Apr, 2026 1 commit
  11. 09 Apr, 2026 1 commit
  12. 05 Apr, 2026 1 commit
  13. 04 Apr, 2026 1 commit
  14. 16 Mar, 2026 2 commits
  15. 09 Mar, 2026 2 commits
  16. 07 Mar, 2026 1 commit
  17. 05 Mar, 2026 1 commit
    • yangjianbo's avatar
      feat(openai-ws): 合并 WS v2 透传模式与前端 ws mode · 1d0872e7
      yangjianbo authored
      
      
      新增 OpenAI WebSocket v2 passthrough relay 数据面与服务适配层,
      支持按账号 ws mode 在 ctx_pool 与 passthrough 间路由。
      
      同步调整前端 OpenAI ws mode 选项为 off/ctx_pool/passthrough,
      并补充 i18n 文案与对应单测。
      
      新增 Caddyfile.dmit 与 docker-compose-aicodex.yml 部署配置,
      用于宿主机场景下的反向代理与服务编排。
      Co-Authored-By: default avatarClaude Opus 4.6 <noreply@anthropic.com>
      1d0872e7
  18. 04 Mar, 2026 1 commit
  19. 02 Mar, 2026 2 commits
    • erio's avatar
      fix: custom menu security hardening and code quality improvements · bf6fe5e9
      erio authored
      
      
      - Add admin menu permission check in CustomPageView (visibility + role)
      - Sanitize SVG content with DOMPurify before v-html rendering (XSS prevention)
      - Decouple router.go from dto package using anonymous struct
      - Consolidate duplicate parseCustomMenuItems into dto.ParseCustomMenuItems
      - Enhance menu item validation (count, length, ID uniqueness limits)
      - Add audit logging for purchase_subscription and custom_menu_items changes
      - Update API contract test to include custom_menu_items field
      Co-Authored-By: default avatarClaude Opus 4.6 <noreply@anthropic.com>
      bf6fe5e9
    • erio's avatar
      feat: custom menu pages with iframe embedding and CSP injection · 067810fa
      erio authored
      
      
      Add configurable custom menu items that appear in sidebar, each rendering
      an iframe-embedded external page. Includes shared URL builder with
      src_host/src_url tracking, CSP frame-src multi-origin deduplication,
      admin settings UI, and i18n support.
      
      chore: bump version to 0.1.87.19
      Co-Authored-By: default avatarClaude Opus 4.6 <noreply@anthropic.com>
      067810fa
  20. 28 Feb, 2026 1 commit
  21. 22 Feb, 2026 1 commit
    • yangjianbo's avatar
      fix(codex): 修复额度窗口过期展示并补齐高覆盖测试 · 10636d8a
      yangjianbo authored
      - 后端新增绝对重置时间字段计算(codex_5h_reset_at/codex_7d_reset_at)
      
      - 前端统一窗口解析逻辑:绝对时间优先,updated_at+seconds 回退,过期自动归零
      
      - 新增后端与前端单元测试,覆盖关键边界与异常场景
      10636d8a
  22. 14 Feb, 2026 1 commit
  23. 11 Feb, 2026 1 commit
  24. 07 Feb, 2026 1 commit
  25. 03 Feb, 2026 1 commit
  26. 02 Feb, 2026 2 commits
    • song's avatar
      merge upstream main · 0170d19f
      song authored
      0170d19f
    • shaw's avatar
      feat: 重新设计公告系统为Header铃铛通知 · bbdc8663
      shaw authored
      - 新增 AnnouncementBell 组件,支持 Modal 弹窗和 Markdown 渲染
      - 移除 Dashboard 横幅和独立公告页面
      - 铃铛位置在 Header 文档按钮左侧,显示未读红点
      - 支持点击查看详情、标记已读、全部已读等操作
      - 完善国际化,移除所有硬编码中文
      - 修复 AnnouncementTargetingEditor watch 循环问题
      bbdc8663
  27. 23 Jan, 2026 1 commit
  28. 07 Jan, 2026 1 commit
  29. 06 Jan, 2026 1 commit
    • shaw's avatar
      fix: Token 统计支持 M 单位并修复 lint 错误 · 752882a0
      shaw authored
      - 用户仪表盘 Token 统计卡片支持 K/M 单位自动切换
      - 更新 formatTokensK 工具函数支持百万级显示
      - 修复 setup.go 中未检查返回值的 errcheck 错误
      752882a0