Repository navigation
Conversation
Embeddings 入口调用 SelectAccountWithSchedulerForCapability 时未传平台, 调度器默认按 openai 平台选号;分组平台为 zhipu 等国产平台时选不到账号, 无可用账号的错误分类也按 openai 判断。改为与 chat completions 一致, 使用 openAICompatibleRequestPlatform 解析的请求平台。
xiaoguai1818
pushed a commit
to xiaoguai1818/sub2api
that referenced
this pull request
Nov 21, 2026
Restore Antigravity Responses custom-tool roundtrips and correct Embeddings platform scheduling. Harden OAuth probe fencing, request-scoped Gemini 403 behavior, OpenAI stream failover and WebSocket current-turn safety. Preserve Claude/GPT-6.2/Grok protocol details and model observations; correct Fable/Kimi quota refreshes and user-vs-account cost reporting. Bound scheduler fallback, request memory retention and shutdown/stream lifecycles without unapproved pricing or schema changes. Local checks: complete Go unit packages, PostgreSQL 18.1/Redis 8.4 repository and audit integration, focused -race, frontend typecheck/lint/1858 Vitest/build, backend lint 0 issues and embedded server build. Remote CI/Security Scan remain pending. Upstream references: Wei-Shaw/sub2api Wei-Shaw#8833 Wei-Shaw#8875 Wei-Shaw#8856 Wei-Shaw#8730 Wei-Shaw#8990 Wei-Shaw#8806 Wei-Shaw#8832 Wei-Shaw#8809 Wei-Shaw#8164 Wei-Shaw#8804 Wei-Shaw#8773 Wei-Shaw#8309.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Resubmission of #8353. The original pull request was automatically closed when its head fork was accidentally deleted. This pull request restores the original head
3ae308590f33and carries over the original validation below.问题
/v1/embeddings入口(handler/openai_embeddings.go)调用SelectAccountWithSchedulerForCapability时没有传平台,调度器默认按openai平台选号。分组平台为 zhipu、deepseek 等国产平台时,组内账号都选不到,请求返回无可用账号;无可用账号的错误分类也写死成PlatformOpenAI。chat completions、responses 等入口已经用openAICompatibleRequestPlatform解析请求平台,只有 embeddings 漏掉了。复现
POST /v1/embeddings,例如{"model":"embedding-3","input":"hi"}。修改内容
openAICompatibleRequestPlatform(ctx, apiKey)解析请求平台,通过platformOverride传给调度器。classifyNoAccountErrorFromGin改用同一个请求平台。测试
TestEmbeddingsDomesticGroupSelectsGroupPlatformAccount:zhipu 分组里同时有 openai 和 zhipu 账号时,请求只会打到 zhipu 账号,URL 为<base_url>/embeddings。不加修复时这个用例失败。go test -tags unit ./internal/handler/...通过。