1. 27 Apr, 2026 7 commits
    • keh4l's avatar
      chore(claude): bump mimicked CLI to 2.1.92 and extend anthropic-beta list · 8412785c
      keh4l authored and 陈曦's avatar 陈曦 committed
      Align Claude Code mimicry constants with the latest real CLI traffic
      (see Parrot's src/transform/cc_mimicry.py). Anthropic now uses the full
      set of anthropic-beta tokens to decide whether a request counts as
      "official Claude Code"; requests missing tokens that real CLI ships
      today are demoted to third-party usage:
      
        Third-party apps now draw from your extra usage, not your plan limits.
      
      Changes:
        - claude/constants.go: add new beta tokens (prompt-caching-scope,
          effort, redact-thinking, context-management, extended-cache-ttl) and
          expose FullClaudeCodeMimicryBetas() for the OAuth mimicry path.
        - claude/constants.go: bump default User-Agent to claude-cli/2.1.92.
        - identity_service.go: bump defaultFingerprint User-Agent accordingly.
      
      No behavioral change for clients that already send a newer UA (fingerprint
      merge still prefers the incoming value).
      8412785c
    • shaw's avatar
      refactor(affiliate): tighten DI and harden inviter code validation · f97e866b
      shaw authored and 陈曦's avatar 陈曦 committed
      - Drop SetAffiliateService setters and ProvideAuthService /
        ProvidePaymentService / ProvideUserHandler wrappers in favor of direct
        Wire constructor injection. AffiliateService has no back-edge to
        Auth/Payment/User, so the indirection was never required.
      - Change RegisterWithVerification's variadic affiliateCode to a fixed
        parameter; adjust all call sites.
      - Validate aff_code length and charset in BindInviterByCode before any
        DB lookup, eliminating timing-side-channel and useless DB roundtrips
        on malformed input.
      - Make affiliate cache invalidation synchronous; surface Redis errors
        via the project logger instead of swallowing them in a detached
        goroutine.
      - Add an integration test guarding cross-layer tx propagation in
        AccrueQuota and a unit test pinning the aff_code format rules.
      f97e866b
    • VpSanta33's avatar
      feat: add affiliate invite rebate flow and admin rebate-rate setting · 2b67e632
      VpSanta33 authored and 陈曦's avatar 陈曦 committed
      2b67e632
    • gaoren002's avatar
      fix(openai): preserve mcp tool call ids · 98c3fb35
      gaoren002 authored and 陈曦's avatar 陈曦 committed
      98c3fb35
    • gaoren002's avatar
      fix(openai): normalize codex responses payloads · 2add09e6
      gaoren002 authored and 陈曦's avatar 陈曦 committed
      2add09e6
    • gaoren002's avatar
      fix(openai): handle codex spark model limitations · 40b643d6
      gaoren002 authored and 陈曦's avatar 陈曦 committed
      40b643d6
    • song's avatar
      fix(openai): preserve codex tool call ids · 302fec12
      song authored and 陈曦's avatar 陈曦 committed
      302fec12
  2. 24 Apr, 2026 4 commits
  3. 23 Apr, 2026 19 commits
    • gaoren002's avatar
      5f418997
    • erio's avatar
    • 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
    • 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
    • erio's avatar
      test(payment): cover ErrOrderNotFound sentinel contract · d5dac84e
      erio authored
      Service layer (payment_fulfillment_order_not_found_test.go):
      - TestHandlePaymentNotification_UnknownOrder_ReturnsSentinel: in-memory
        sqlite ent client, query for a non-existent out_trade_no → errors.Is
        must recognise ErrOrderNotFound (handler relies on this to ack 200).
      - TestHandlePaymentNotification_NonSuccessStatus_Skips: non-success
        notification short-circuits before DB lookup → nil error.
      - TestErrOrderNotFound_DistinctFromOtherErrors: generic errors must not
        match the sentinel (prevents silently swallowing DB failures).
      
      Handler layer (payment_webhook_handler_test.go):
      - TestUnknownOrderWebhookAcksWithSuccess: locks the two ingredients the
        handleNotify ack path depends on — fmt.Errorf %w wrapping preserves
        errors.Is recognition, and writeSuccessResponse(stripe) returns an
        empty 200 body that Stripe treats as acknowledged.
      d5dac84e
    • erio's avatar
      fix(payment): ack unknown-order webhooks with 2xx to stop provider retries · 75e1b40f
      erio authored
      Introduce a sentinel ErrOrderNotFound in the payment service layer so the
      webhook handler can distinguish "the out_trade_no does not exist in our DB"
      from other fulfillment failures, and downgrade the former to a WARN log +
      success response.
      
      Background
      - Providers (Stripe, Alipay, Wxpay, EasyPay, ...) retry webhooks whenever
        we answer non-2xx. When a webhook endpoint is misconfigured (e.g. a
        foreign environment points at us) or our orders table has been wiped,
        we return 500 forever and the provider retries for days, spamming logs.
      - The old code also collapsed "order not found" and "DB query failed" into
        the same branch — a DB blip would be reported as "order not found" and
        swallowed.
      
      Service layer (payment_fulfillment.go)
      - Add `var ErrOrderNotFound = errors.New("payment order not found")`.
      - In HandlePaymentNotification, distinguish the two error paths:
        * dbent.IsNotFound(err) → wrap with ErrOrderNotFound so callers can
          errors.Is(...) it.
        * anything else → wrap the original err with %w so it still bubbles up
          as 500 and the provider retries (DB hiccup should be retried).
      
      Handler layer (payment_webhook_handler.go)
      - Before returning 500, check errors.Is(err, service.ErrOrderNotFound):
        emit a WARN (with provider / outTradeNo / tradeNo for discoverability),
        then call writeSuccessResponse so the provider sees its expected 2xx
        body (Stripe empty body / Wxpay JSON / others "success").
      - Other errors retain the existing 500 behavior.
      
      Monitoring note: because this path now swallows unknown-order webhooks
      silently from the provider's perspective, the WARN log line is the only
      signal. Alert on "unknown order, acking to stop retries" if you want
      visibility into misrouted webhooks or accidental data loss.
      75e1b40f
    • erio's avatar
      fix(dto): drop obsolete public settings drift test · 1949425a
      erio authored
      The drift test referenced service.PublicSettingsInjectionPayload, a
      named type introduced by a5b05538 but dropped when we cherry-picked
      that commit into feat/channel-insights (we kept the inline struct from
      HEAD to avoid pulling fork-only helpers from setting_service.go). The
      test therefore could not compile. The 2 new public-settings fields
      (channel_monitor_enabled, available_channels_enabled) are still covered
      by manual wiring in GetPublicSettingsForInjection.
      1949425a
    • github-actions[bot]'s avatar
      0a80ec80
    • shaw's avatar
      chore: add model gpt-5.5 · 3fe4fd4c
      shaw authored
      3fe4fd4c
    • 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
    • shaw's avatar
      fix: 修复 golangci-lint 报告的 36 个问题 · ef967d8f
      shaw authored
      ef967d8f
    • wx-11's avatar
      修复计费问题以及模型回显 · 9e5a6351
      wx-11 authored
      9e5a6351
    • wucm667's avatar
      bcf4aedc
    • wx-11's avatar
    • wx-11's avatar
      使用codex的生图接口代替web2api · eea6f388
      wx-11 authored
      eea6f388
    • zhoukailian's avatar
      fix: clarify OpenAI OAuth proxy errors · 2489ea36
      zhoukailian authored
      2489ea36
    • shaw's avatar
      fix: add io.LimitReader bounds to prevent OOM in image handling · 0b85a8da
      shaw authored
      Limit image download and multipart upload reads to 20MB to prevent
      unbounded memory allocation from abnormal upstream responses.
      0b85a8da
    • meteor041's avatar
      fix openai image request handling · 00778dca
      meteor041 authored
      00778dca
  4. 22 Apr, 2026 10 commits