Repository navigation
Conversation
同一请求的首次 403 只换号并暂缓账号处理;另一账号成功后再按原有策略回补,两个不同账号都返回 403 时判为请求级,返回固定 400 INVALID_ARGUMENT,账号状态保持不变。原生、Messages 兼容和 Chat Completions 兼容入口均适用;403 不再在重试循环内写入临时不可调度状态。
Contributor
|
All contributors have signed the CLA. ✅ |
Contributor
Author
|
I have read the CLA Document and I hereby sign the CLA |
Warren-W
pushed a commit
to Warren-W/sub2api
that referenced
this pull request
Nov 20, 2026
Upstream PR: Wei-Shaw#8730 (squashed from d121edd)
Warren-W
added a commit
to Warren-W/sub2api
that referenced
this pull request
Nov 20, 2026
Warren-W
pushed a commit
to Warren-W/sub2api
that referenced
this pull request
Nov 20, 2026
Upstream PR: Wei-Shaw#8730 (squashed from d121edd)
Warren-W
added a commit
to Warren-W/sub2api
that referenced
this pull request
Nov 20, 2026
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.
Fixes #8442
问题
Gemini 入口把上游 403 一律当作账号错误:首次 403 就
SetError,而 403 又在可换号状态码里,于是同一个坏请求会逐个账号重放,把分组内 Gemini 账号依次停用。请求内容导致的 403(例如fileData.fileUri指向私有/已删除的 YouTube 视频)与账号鉴权/额度 403 在上游文案上无法区分。改动
INVALID_ARGUMENT,不透传上游原文,两个账号状态都不变。gin.Context,覆盖原生/v1beta、/v1/messages、/v1/chat/completions三条入口。CachedContent not found等已知请求级 403 的原有直返逻辑。测试
go test -tags=unit ./internal/service/ -run 'TestGemini403|TestGeminiForwardNative_OtherForbiddenDefersAccountPenalty|TestGeminiForwardNative_CachedContent' -count=1通过go test -tags=unit ./internal/handler/ -run 'Gemini|Failover' -count=1通过go vet -tags=unit ./internal/service/通过go test -tags=unit ./...在本机仍有与本次改动无关的既有失败:TestAliyunCaptchaVerifier_TransportError、TestPgDumper*(环境缺少sh)、TestOllamaProbeCallback_StaleLongDoesNotOverrideNewShort;这些用例在未修改的main上同样失败。