Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: Wei-Shaw/sub2api
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: main
Choose a base ref
...
head repository: Sun-code-api/sub2api
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: main
Choose a head ref
Checking mergeability… Don’t worry, you can still create the pull request.
  • 14 commits
  • 60 files changed
  • 2 contributors

Commits on Aug 10, 2026

  1. feat(opencode): add OpenCode Go platform support to gateway and pool

    - Add PlatformOpencode constant (domain + service), account accessors
      (IsOpencode/GetOpencodeBaseURL/GetOpencodeAPIKey), extend
      IsOpenAICompatible and normalizeOpenAICompatiblePlatform
    - Route opencode groups to the OpenAI-compatible Chat Completions
      gateway; guard messages/responses with a clear 404
    - Resolve upstream URL to opencode.ai/zen/go/v1 (credentials base_url
      override supported), strip opencode-go/ model prefix
    - Add opencode liveness probe (1-token deepseek-v4-flash chat
      completion) reusing the chat-completions test path
    - Add config-gated non-streaming response cache for OpenAI-compatible
      chat completions (X-Cache: HIT on repeat requests, ~0 first token)
    luohui1 committed Aug 10, 2026
    Configuration menu
    Copy the full SHA
    859f4be View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    d889993 View commit details
    Browse the repository at this point in the history
  3. feat(opencode): add OpenCode Go platform to admin frontend

    - GroupsView: opencode option in platform select + filter
    - CreateAccountModal/EditAccountModal: opencode platform button,
      base_url/api_key placeholders (opencode.ai/zen/go/v1), credentials
      builder fallback
    - PlatformIcon: opencode terminal icon
    - useModelWhitelist: opencode preset with 11 chat-completions models
      (grok-4.5, glm-5.1/5.2, kimi-k3/k2.7-code/k2.6, deepseek-v4-pro/flash,
      mimo-v2.5/pro, hy3)
    - i18n en/zh: admin.groups.platforms.opencode
    - types: opencode added to GroupPlatform/AccountPlatform
    luohui1 committed Aug 10, 2026
    Configuration menu
    Copy the full SHA
    4353547 View commit details
    Browse the repository at this point in the history
  4. ci: build with -tags embed so frontend is served from the binary

    embed_on.go carries //go:build embed; without the tag the binary has no
    frontend hosting and / returns gin's default 404 (page not found).
    luohui1 committed Aug 10, 2026
    Configuration menu
    Copy the full SHA
    a8b5812 View commit details
    Browse the repository at this point in the history
  5. feat(opencode): group platform validation + quota-aware status probe

    - group_handler: allow opencode in Create/UpdateGroupRequest platform
      oneof (admin UI can create OpenCode Go groups via API)
    - opencode_quota.go: fetch OpenCode Go dashboard usage windows
      (5H/weekly/monthly percent + reset) via auth_cookie, ported from
      account-pool's RSC parsing; tolerant of SolidJS unquoted keys
    - account_test_service: opencode probe now refreshes quota windows into
      account.extra (opencode_quota_* fields) when workspace_id +
      auth_cookie are present; quota fetch failure never blocks liveness
    - frontend: OpencodeQuotaBadge shows 5H/W/M utilization in the
      accounts list for opencode accounts
    luohui1 committed Aug 10, 2026
    Configuration menu
    Copy the full SHA
    dc32bc6 View commit details
    Browse the repository at this point in the history
  6. fix(opencode): complete platform type support across admin/user UI

    - platformColors: opencode added to Platform type + all 13 style records
      (teal accent) + isPlatform()
    - i18n: opencode labels in admin.accounts.platforms (en/zh) and
      landing providers (en/zh)
    - channel-monitor MonitorSettingsPanel, user PlatformUsageBreakdown and
      UserDashboardStats platform label maps
    - ErrorPassthroughRulesModal: opencode platform option (backend
      error_passthrough_rule.AllPlatforms now includes opencode)
    luohui1 committed Aug 10, 2026
    Configuration menu
    Copy the full SHA
    0e58c00 View commit details
    Browse the repository at this point in the history
  7. fix(opencode): PlatformTypeBadge no longer falls back to Gemini label

    PlatformTypeBadge defaulted unknown platforms to 'Gemini', so opencode
    accounts rendered as Gemini in the admin account list. Add explicit
    opencode label (OpenCode Go) + teal badge class; also add opencode to
    platformColors.platformLabel and ProxiesView probe-target label.
    luohui1 committed Aug 10, 2026
    Configuration menu
    Copy the full SHA
    905b9fd View commit details
    Browse the repository at this point in the history
  8. feat(opencode): support pricing sync for opencode channel platform

    SyncPricingModels now aggregates LiteLLM catalog models across the
    providers behind OpenCode Go (xai/zhipu/moonshot/deepseek/mimo/hunyuan)
    instead of failing with unsupported platform.
    luohui1 committed Aug 10, 2026
    Configuration menu
    Copy the full SHA
    891e9f6 View commit details
    Browse the repository at this point in the history
  9. fix(opencode): force raw chat-completions path for opencode accounts

    OpenCode Go accounts with empty extra resolve ResponsesSupport=Unknown,
    so ForwardAsChatCompletions skipped the raw path and forwarded to the
    default api.openai.com URL, producing 401 (Incorrect API key). opencode
    accounts now always take forwardAsRawChatCompletions, which resolves the
    upstream to opencode.ai/zen/go/v1/chat/completions.
    luohui1 committed Aug 10, 2026
    Configuration menu
    Copy the full SHA
    2b30bcc View commit details
    Browse the repository at this point in the history

Commits on Aug 11, 2026

  1. feat(opencode): route /v1/messages and /v1/responses through OpenAI g…

    …ateway
    
    OpenCode Go accounts now serve Anthropic Messages and OpenAI Responses
    requests via the raw chat-completions conversion path (opencode.ai only
    exposes /v1/chat/completions), so Claude Code can use opencode models
    (e.g. deepseek-v4-flash, 1M context). Remove the opencode 404 guards and
    force the raw conversion branch for opencode APIKey accounts in both
    ForwardAsAnthropic and the responses forwarder.
    luohui1 committed Aug 11, 2026
    Configuration menu
    Copy the full SHA
    a2f44b7 View commit details
    Browse the repository at this point in the history
  2. fix(opencode): resolve CC fallback credential for opencode accounts

    resolveCCFallbackTarget used GetOpenAIApiKey which returns empty for
    opencode accounts, breaking the messages/responses raw chat conversion
    path (account missing api_key).
    luohui1 committed Aug 11, 2026
    Configuration menu
    Copy the full SHA
    afaf6cd View commit details
    Browse the repository at this point in the history

Commits on Aug 13, 2026

  1. Merge upstream v0.1.176 into opencode fork

    Brings Grok 4.6 support, JWT subscription tier detection, per-group
    per-model pricing, the x_search endpoint and ~10 upstream bug fixes on
    top of the OpenCode Go platform patches.
    
    Only conflict was group_handler.go, where upstream added
    LongContextPricingEnabled/ModelPricing to the create/update group
    requests while the fork had added "opencode" to the platform oneof
    validation. Kept both.
    
    Verified: backend builds clean, handler/admin/dto/quotaview tests pass.
    The one failing service test (ContentModerationRuntimeSnapshotRefresh
    FailureKeepsStaleConfig) fails identically on pre-merge fork main, so it
    is pre-existing and not a merge regression.
    
    Co-authored-by: Cursor <[email protected]>
    luohui1 and cursoragent committed Aug 13, 2026
    Configuration menu
    Copy the full SHA
    9722c5f View commit details
    Browse the repository at this point in the history
  2. fix(opencode): close platform-support gaps in quotas, routes and badges

    The OpenCode Go platform was wired into groups and accounts but never into
    the subsystems that keep their own platform list, so several features were
    silently unavailable for it.
    
    Per-user platform quotas (was unusable end to end):
    - service.AllowedQuotaPlatforms, the ent build-time validator and the
      user_platform_quotas CHECK all omitted opencode, so a DeepSeek limit was
      rejected at the DB even if the UI had offered it
    - the frontend duplicated the platform list in three places; replace them
      with one exported PLATFORM_QUOTA_PLATFORMS constant that the type, both
      components and the spec derive from, so adding a platform is one edit
    
    Composite routes:
    - the handler binding and CHECK constraint rejected opencode while the
      frontend typed target_platform as Exclude<GroupPlatform,'composite'>,
      which includes it — picking OpenCode returned a 400
    
    Badges:
    - GroupBadge had no opencode branch and GroupOptionItem's default branch
      painted opencode with antigravity's violet; both now use the teal already
      assigned to opencode in platformColors.ts
    
    Tests that hardcoded "5 platforms" now derive the count from the constant.
    
    Co-authored-by: Cursor <[email protected]>
    luohui1 and cursoragent committed Aug 13, 2026
    Configuration menu
    Copy the full SHA
    f8ce0b7 View commit details
    Browse the repository at this point in the history

Commits on Aug 14, 2026

  1. feat(opencode): query live Go quota from the official usage API

    Dashboard HTML scrape stays stale after weekly 401/429, so admin accounts could not refresh 5H/week/month windows. Query GET /zen/go/v1/usage and persist the snapshot.
    
    Co-authored-by: Cursor <[email protected]>
    luohui1 and cursoragent committed Aug 14, 2026
    Configuration menu
    Copy the full SHA
    39300d8 View commit details
    Browse the repository at this point in the history
Loading