Repository navigation
fix: fallback to inline media when Drive storage quota is exceeded - #144
Open
w33tardthewise wants to merge 1 commit into
Open
w33tardthewise wants to merge 1 commit into
w33tardthewise wants to merge 1 commit into
Conversation
w33tardthewise
force-pushed
the
fix/drive-quota-inline-fallback
branch
from
November 11, 2026 22:42
3f8b1b0 to
efda79b
Compare
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.
改动 / Changes
internal/aistudio/upload.go: 新增driveStorageQuotaExceeded辅助函数,在 Google Drive 上传返回 HTTP 403 且原因包含storageQuotaExceeded、quota has been exceeded或servicedisabled时识别为存储配额超限或服务未启用。internal/aistudio/upload.go: 在UploadInlineMediaToLease中,当 Drive 上传遇到存储配额不足或无法写入时,清理临时副本并保持原始inlineData发送,避免因上游配额耗尽而陷入无限循环切换账户并导致请求超时。internal/aistudio/compatibility_test.go: 在TestRPCErrorCompatibility中补充driveStorageQuotaExceeded的单元测试,覆盖真实 403 错误响应与非 403 / 其他原因的边界情况。README.md、README_en.md与docs/protocol.md中关于内联附件配额不足时保持内联数据发送的描述。验证 / Verification
go test ./internal/aistudio/...全部通过。stream: true发送携带 base64 图片的/v1/chat/completions请求:服务检测到storageQuotaExceeded后正确回退至inlineData发送,Gemini 正常以流式返回识别结果,未触发循环账户轮换与超时。