-
Notifications
You must be signed in to change notification settings - Fork 9.2k
Comparing changes
Open a pull request
base repository: Wei-Shaw/sub2api
base: main
head repository: Sun-code-api/sub2api
compare: main
- 14 commits
- 60 files changed
- 2 contributors
Commits on Aug 10, 2026
-
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)
Configuration menu - View commit details
-
Copy full SHA for 859f4be - Browse repository at this point
Copy the full SHA 859f4beView commit details -
Configuration menu - View commit details
-
Copy full SHA for d889993 - Browse repository at this point
Copy the full SHA d889993View commit details -
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
Configuration menu - View commit details
-
Copy full SHA for 4353547 - Browse repository at this point
Copy the full SHA 4353547View commit details -
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).
Configuration menu - View commit details
-
Copy full SHA for a8b5812 - Browse repository at this point
Copy the full SHA a8b5812View commit details -
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
Configuration menu - View commit details
-
Copy full SHA for dc32bc6 - Browse repository at this point
Copy the full SHA dc32bc6View commit details -
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)
Configuration menu - View commit details
-
Copy full SHA for 0e58c00 - Browse repository at this point
Copy the full SHA 0e58c00View commit details -
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.
Configuration menu - View commit details
-
Copy full SHA for 905b9fd - Browse repository at this point
Copy the full SHA 905b9fdView commit details -
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.
Configuration menu - View commit details
-
Copy full SHA for 891e9f6 - Browse repository at this point
Copy the full SHA 891e9f6View commit details -
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.
Configuration menu - View commit details
-
Copy full SHA for 2b30bcc - Browse repository at this point
Copy the full SHA 2b30bccView commit details
Commits on Aug 11, 2026
-
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.
Configuration menu - View commit details
-
Copy full SHA for a2f44b7 - Browse repository at this point
Copy the full SHA a2f44b7View commit details -
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).
Configuration menu - View commit details
-
Copy full SHA for afaf6cd - Browse repository at this point
Copy the full SHA afaf6cdView commit details
Commits on Aug 13, 2026
-
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]>
Configuration menu - View commit details
-
Copy full SHA for 9722c5f - Browse repository at this point
Copy the full SHA 9722c5fView commit details -
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]>
Configuration menu - View commit details
-
Copy full SHA for f8ce0b7 - Browse repository at this point
Copy the full SHA f8ce0b7View commit details
Commits on Aug 14, 2026
-
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]>
Configuration menu - View commit details
-
Copy full SHA for 39300d8 - Browse repository at this point
Copy the full SHA 39300d8View commit details
This comparison is taking too long to generate.
Unfortunately it looks like we can’t render this comparison for you right now. It might be too big, or there might be something weird with your repository.
You can try running this command locally to see the comparison on your machine:
git diff main...main