1. 27 Apr, 2026 1 commit
  2. 23 Apr, 2026 5 commits
    • erio's avatar
      feat(monitor): proportion-based overall status + reusable auto-refresh · 0dcc0e05
      erio authored
      - Change overall status logic: >50% failed = UNAVAILABLE, any failed
        or degraded = DEGRADED, all ok = OPERATIONAL
      - Extract useAutoRefresh composable with localStorage persistence
      - Create AutoRefreshButton dropdown component (reusable)
      - Integrate auto-refresh into channel status page via MonitorHero
      0dcc0e05
    • 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
    • james-6-23's avatar
      feat(rpm): RPM 限流模块优化 · dc5d42ad
      james-6-23 authored
      P0:
      - rpm_override 嵌入 Auth Cache Snapshot,消除每请求 DB 查询 (snapshot v6→v7)
      - 429 RPM 响应返回 Retry-After 头(当前分钟剩余秒数)
      
      P1:
      - ClearAll 按钮直连 DELETE API,带 loading 防重复
      - 新增 GET /admin/users/:id/rpm-status 管理员 RPM 用量查询端点
      
      优化:
      - checkRPM 从级联互斥改为并行取最严,user.rpm_limit 作为全局硬上限始终生效
      - Override/Group 变更后自动失效 auth cache
      - fail-open 语义不变,Redis 故障不阻塞业务
      dc5d42ad
    • zhoukailian's avatar
      fix: clarify OpenAI OAuth proxy errors · 2489ea36
      zhoukailian authored
      2489ea36
  3. 22 Apr, 2026 4 commits
  4. 21 Apr, 2026 4 commits
  5. 22 Apr, 2026 1 commit
    • erio's avatar
      fix(available-channels): description as own column, fixed table layout · 25a50355
      erio authored
      - 描述独立成列:渠道名与描述各占一列,均用 rowspan 纵向合并
      - 渠道名单元格 text-center + align-middle,合并后视觉居中
      - table-fixed:给 name/description/platform 显式宽度,groups 和
        supported_models 在剩余空间均分。支持模型列此前在 table-auto 下
        不会换行导致横向溢出遮挡(反馈截图),加 table-fixed 后天然 flex-wrap
      - i18n 增加 availableChannels.columns.description(zh/en)
      25a50355
  6. 21 Apr, 2026 9 commits
  7. 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
    • IanShaw027's avatar
      c297d011
    • erio's avatar
      feat(channels): add "Available Channels" aggregate view · 654cfb64
      erio authored
      Add a read-only aggregate view per channel: its linked groups and a
      deterministic wildcard-free supported-model list with pricing details.
      
      Backend
      - service.Channel.SupportedModels(): combine ModelMapping keys with
        same-platform ModelPricing.Models; trailing "*" keys expand via
        pricing prefix match; platforms without a mapping produce no
        entries (intentional "no mapping = not shown" rule).
      - Extract splitWildcardSuffix() shared with toModelEntry.
      - Build a per-call pricing lookup map (platform+lowerName -> *pricing)
        to avoid O(N*M) scans in SupportedModels.
      - ChannelService.ListAvailable() aggregates channels + active groups;
        filters out group IDs no longer active.
      - Admin route GET /api/v1/admin/channels/available returns the full
        DTO (id, status, billing_model_source, restrict_models, groups,
        supported_models).
      - User route GET /api/v1/channels/available applies three filters:
        Status==active, visible-group intersection, and platform filter
        on supported_models (prevents cross-platform leak when a channel
        links to both a user-accessible group and an inaccessible one on
        another platform). Response is a plain array (matches the
        /groups/available sibling shape). Field whitelist omits
        billing_model_source, restrict_models, ids, status, sort_order.
      
      Frontend
      - New /admin/available-channels and /available-channels views backed
        by a shared AvailableChannelsTable component (admin adds status +
        billing-source columns via slots).
      - PricingRow extracted to its own SFC; SupportedModelChip references
        shared billing-mode constants in constants/channel.ts.
      - Sidebar: new entry above "渠道管理" for admin; matching entry in
        user nav.
      - i18n: zh + en coverage for both namespaces.
      
      Tests
      - SupportedModels: wildcard-only pricing skipped, prefix-matches-
        nothing, cross-platform bleed, case-insensitive dedup, empty
        platform mapping.
      - ListAvailable: nil groupRepo, inactive-group-ID dropped, stable
        case-insensitive name sort.
      - User handler: 401 on unauthenticated, visible-group intersection,
        platform filter on supported_models, JSON whitelist.
      - Admin handler: full DTO including default BillingModelSource
        fallback.
      
      Refs: issue #1729
      654cfb64
  8. 21 Apr, 2026 5 commits
    • erio's avatar
      feat(monitor): switch headers input to key-value rows · e1193212
      erio authored
      - AdvancedRequestConfig 把 headers textarea 换成行式:每行 name 输入 + value 输入
        + 删除按钮,底部「+ 添加 Header」。直观区分名/值,不用再一行 "Key: Value" 自己拆。
      - 校验下放到行级:name 含空格或冒号才报错,未填仅占位不报错(避免输入时频繁红字)。
      - 外部 props 同值不回写,避免 commit 后行被重排。
      - chore: 移除 CLAUDE.md 里 silentflower remote 行(不再追踪)。
      e1193212
    • erio's avatar
      feat(monitor): 30-day raw retention + timeline 4-tier style + CC template seed + JSON format button · a7415d4d
      erio authored
      - History retention 1d → 30d(60s × 30d ≈ 43200 行/model,PG 无压力);
        ComputeAvailability* 不再 UNION rollup 表,直接扫 histories 精度更高。
      - Timeline bar 四级高度+颜色双重编码:operational 高+绿 / degraded 中+黄 /
        failed+error 短+红 / 未测试 很短+灰。
      - migration 113 seed「Claude Code 伪装」模板(ON CONFLICT DO NOTHING)。
        user_id 用 legacy 格式(user_<64hex>_account_<uuid>_session_<uuid>),
        避免新版 JSON 字符串内嵌 JSON 在编辑器里一长串 \" 难读。
      - MonitorAdvancedRequestConfig 加「格式化」按钮 + white-space:pre
        让 body textarea 对长字符串不压扁。
      a7415d4d
    • erio's avatar
      feat(channel-monitor): apply template via subset picker; CC 2.1.114 baseline doc · 6925ac25
      erio authored
      Apply flow:
      - POST /admin/channel-monitor-templates/:id/apply now requires monitor_ids
        (non-empty array). Service applies the template only to the selected
        subset, gated by AND template_id = :id (so users can't sneak in
        unrelated monitor IDs).
      - New GET /admin/channel-monitor-templates/:id/monitors returns the
        associated monitor briefs (id/name/provider/enabled) for the picker.
      - ApplyToMonitors signature gains monitorIDs []int64; empty list returns
        ErrChannelMonitorTemplateApplyEmpty.
      
      Frontend:
      - New MonitorTemplateApplyPickerDialog.vue: list of associated monitors
        with checkboxes (default all checked), 全选 / 全不选 shortcuts, live
        selected/total count. Submit calls apply(id, ids).
      - MonitorTemplateManagerDialog replaces the old ConfirmDialog flow with
        the picker; onApplied refetches the list to refresh associated counts.
      
      i18n: applyPicker* + common.selectAll keys.
      
      chore: bump version to 0.1.114.33
      
      The CC 2.1.114 (sdk-cli) UA / APIKeyBetaHeader / JSON metadata.user_id
      baseline (already verified working via the in-process apply on prod
      template id=1) is documented in internal/pkg/claude/constants.go and
      is what the seed template in the manager UI should follow.
      6925ac25
    • erio's avatar
      feat(channel-monitor): request templates with snapshot apply + headers/body override · a2964259
      erio authored
      Problem:
      Upstream channels can reject monitor probes based on client fingerprint
      (e.g. "only Claude Code clients allowed"). The monitor had no way to
      customize the outgoing request to bypass such restrictions.
      
      Solution:
      Introduce reusable request templates that carry extra_headers plus an
      optional body override; monitors reference a template and receive a
      snapshot copy on apply. Template edits do NOT auto-propagate — users
      must click "apply to associated monitors" to refresh snapshots, so a
      bad template edit cannot instantly break all production monitors.
      
      Data model (migration 112):
      - channel_monitor_request_templates: id, name, provider, description,
        extra_headers jsonb, body_override_mode ('off'|'merge'|'replace'),
        body_override jsonb. Unique (provider, name).
      - channel_monitors: +template_id (FK, ON DELETE SET NULL), +extra_headers,
        +body_override_mode, +body_override (the three runtime snapshot fields).
      
      Checker (channel_monitor_checker.go):
      - callProvider + runCheckForModel accept a CheckOptions carrying the
        snapshot fields. mergeHeaders applies user headers on top of adapter
        defaults (forbidden list: Host / Content-Length / Transfer-Encoding /
        Connection / Content-Encoding).
      - buildRequestBody:
          off     -> adapter default body
          merge   -> shallow-merge over default; per-provider deny list
                     (model/messages/contents) protects the challenge contract
          replace -> user body verbatim
      - Replace mode skips challenge validation; instead HTTP 2xx + non-empty
        extracted response text = operational, empty = failed.
      - 4 new unit tests cover all three modes + replace/empty-response case.
      
      Admin API:
      - /admin/channel-monitor-templates CRUD + /:id/apply (overwrite snapshot
        on all template_id=id monitors, returns affected count).
      - channel_monitor request/response DTOs gain the 4 new fields.
      
      Frontend:
      - channelMonitorTemplate.ts API client.
      - MonitorAdvancedRequestConfig.vue shared component for headers textarea
        + body mode radio + body JSON editor; used by both template and monitor
        forms.
      - MonitorTemplateManagerDialog.vue: provider tabs, list/create/edit/
        delete/apply, live "associated monitors" count per row.
      - MonitorFiltersBar: new 模板管理 button next to 新增监控.
      - MonitorFormDialog: collapsible 高级 section with template dropdown
        (filtered by form.provider, clears on provider change) + embedded
        AdvancedRequestConfig. Picking a template copies its fields into the
        form (snapshot semantics mirrored on the client).
      - i18n zh/en entries for all new copy.
      
      chore: bump version to 0.1.114.32
      a2964259
    • erio's avatar
      refactor(channel-status): drop breadcrumb + subtitle from MonitorHero · 0c48f08f
      erio authored
      The "CHANNEL · STATUS" breadcrumb and the zh/en subtitles above the
      window-picker were redundant with the existing "渠道状态" page title
      shown in the layout header. Remove the left column and right-align the
      7d/15d/30d tabs + overall chip.
      
      Also drop the now-unreferenced channelStatus.hero.* i18n keys from both
      locales (grep confirms no remaining usage).
      
      chore: bump version to 0.1.114.31
      0c48f08f
  9. 20 Apr, 2026 8 commits
    • 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
      refactor(channel-monitor): remove INTELLIGENCE MONITOR hero title · 0d01bd90
      erio authored
      Subtitle + breadcrumb already convey context; the giant h1 was visual
      noise. Drops orphan i18n key `channelStatus.hero.title` and shrinks
      hero section vertical padding accordingly.
      
      Bump VERSION to 0.1.114.26
      0d01bd90
    • erio's avatar
      feat(channel-monitor): add feature switch settings + fix extra_models save · 7da51240
      erio authored
      Settings:
      - New "功能开关" tab between 通用设置 and 安全与认证
      - ChannelMonitorEnabled toggle: runner skips scheduling when false,
        user-facing list returns empty
      - ChannelMonitorDefaultIntervalSeconds (15-3600): pre-fills interval
        when creating a new monitor; each monitor can still override
      
      Bug fix:
      - ModelTagInput now commits pending input on blur, not just Enter/Tab.
        Previously clicking "save" with an un-Enter'd extra model would drop
        the value (DB stored extra_models=[] even when user typed entries).
      
      Backend:
      - domain_constants: SettingKeyChannelMonitor{Enabled,DefaultIntervalSeconds}
      - SettingService.GetChannelMonitorRuntime: lightweight getter used by
        runner tick + user handler per-request (fail-open on DB error)
      - Runner tickDueChecks: bails early when feature disabled
      - ChannelMonitorUserHandler: checks feature flag before serving
      - Comment on runner doc: scheduler state is implicit (every tick re-reads
        ListEnabled from DB), so CRUD ops on monitors self-maintain the schedule
      
      Bump VERSION to 0.1.114.25
      7da51240
    • IanShaw027's avatar
      Close profile identity and avatar loop · 92041457
      IanShaw027 authored
      92041457
    • IanShaw027's avatar
      Refine payment UX for wallet flows · f83fd59d
      IanShaw027 authored
      f83fd59d
    • erio's avatar
      feat(channel-monitor): redesign user dashboard as card grid · a1425b45
      erio authored
      Reference check-cx UI: INTELLIGENCE MONITOR hero + 3-column card grid
      with 60-point timeline bars.
      
      Backend:
      - Add PrimaryPingLatencyMs + Timeline[60] to UserMonitorView
      - ListRecentHistoryForMonitors: batch CTE + ROW_NUMBER() window query
      - indexLatestByModel / indexAvailabilityByModel helpers
      
      Frontend:
      - 7 new components: ProviderIcon, MonitorMetricPair, MonitorAvailabilityRow,
        MonitorTimeline, MonitorHero, MonitorCard, MonitorCardGrid
      - ChannelStatusView 381→~180 lines (delegated to subcomponents)
      - AbortController reload concurrency protection
      - HSL 0-120° availability color mapping
      - Replace emoji with Icon component (bolt / globe)
      - i18n: monitorCommon.* shared namespace, channelStatus.hero.*
      
      Bump VERSION to 0.1.114.24
      a1425b45
    • 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
    • erio's avatar
      feat(monitor): admin channel monitor MVP with SSRF protection and batch aggregation · 20a4e418
      erio authored
      新增 admin「渠道监控」模块(参考 BingZi-233/check-cx),独立于现有 Channel 体系。
      admin 配置 + 后台定时调用上游 LLM chat completions 健康检查 + 所有登录用户只读可见。
      
      后端:
      - ent: channel_monitor + channel_monitor_history(AES-256-GCM 加密 api_key)
      - service 按职责拆分:service/aggregator/validate/checker/runner/ssrf
      - provider strategy map 替代 switch(openai/anthropic/gemini)
      - repository batch 聚合(ListLatestForMonitorIDs + ComputeAvailabilityForMonitors)消除 N+1
      - runner: ticker(5s) + pond worker pool(5) + inFlight 防并发 + TrySubmit 防雪崩
        + 凌晨 3 点 cron 清理 30 天历史
      - SSRF 防护:强制 https + 私网/loopback/云元数据 IP 拒绝(127/8、10/8、172.16/12、
        192.168/16、169.254/16、100.64/10、::1、fc00::/7、fe80::/10)+ DialContext
        在 socket 层防 DNS rebinding
      - API key sanitize:擦除 url.Error 与上游响应 body 中的 sk-/sk-ant-/AIza/JWT 模式
      - APIKeyDecryptFailed 标志位 + 单 monitor 路径检测,避免空 key 调用上游
      
      handler:
      - admin: CRUD + 手动触发 + 历史接口(api_key 脱敏)
      - user: 只读列表 + 状态详情(去除 api_key/endpoint)
      - ParseChannelMonitorID 共用 + dto.ChannelMonitorExtraModelStatus 共用
      
      前端:
      - 路由 /admin/channels/{pricing,monitor} + /monitor(用户只读)
      - AppSidebar 父项 expandOnly 支持
      - ChannelMonitorView 拆为 8 个子组件 + ChannelStatusView 拆出 detail dialog
      - composables/useChannelMonitorFormat + constants/channelMonitor 共享
      - i18n monitorCommon namespace 消除 admin/user 两 view 重复
      
      合规:所有文件符合 CLAUDE.md(Go ≤ 500 行 / Vue ≤ 300 行 / 函数 ≤ 30 行)
      CI: go build / gofmt / golangci-lint(0 issues) / make test-unit / pnpm build 全绿
      20a4e418