Conversation
…y layer (#9663) AsyncOpenAI/AsyncAzureOpenAI inherit the SDK default max_retries=2, which nests underneath AstrBot's tenacity-based retry_provider_request(). As a result provider_settings.request_max_retries no longer reflects the true attempt count (e.g. request_max_retries=1 still sends up to 3 HTTP requests) and delays fallback-provider switchover. Pass max_retries=0 so AstrBot's retry layer is the single source of truth for retries.
…retry tests Address review feedback on #9669: merge the near-identical official/Azure client construction tests into a parametrized test, and add a regression test asserting _query() performs exactly request_max_retries attempts through retry_provider_request() when the call keeps failing, guarding against multiplicative retries being reintroduced.
Contributor
There was a problem hiding this comment.
Sorry @w31r4, your pull request is larger than the review limit of 150,000 diff characters
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
astrbot-docs | 843f171 | Commit Preview URL Branch Preview URL |
Sep 17 2026, 11:15 AM |
为模型图片输入与聊天附件上传增加大小护栏 / Add size guards for model image inputs and chat attachment uploads: - _convert_image_bytes_sync 复用原始编码字节的分支增加 2MB 上限;更大的 输入重编码,输出始终受像素尺寸与质量约束 - prepare_model_image 在读入前检查文件大小,超过 32MB 跳过并记录日志 - 聊天附件上传上限 100MB:路由先检查 Content-Length,服务层落盘后复核 实际大小 - Reuse the original encoded bytes in _convert_image_bytes_sync only for stills up to 2MB; larger inputs are re-encoded so the output stays bounded by pixel size and quality. - prepare_model_image checks the file size before reading and skips inputs above 32MB with a warning log. - Chat attachment uploads are capped at 100MB: the route checks Content-Length first, and save_uploaded_file re-checks the on-disk size after saving. Tests: tests/test_media_utils.py, tests/test_chat_route.py
w31r4
force-pushed
the
perf/image-memory-lifecycle
branch
from
September 17, 2026 11:13
533d64e to
843f171
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.
Summary
Why
An image could pass the pixel limit while still creating a large encoded payload. Some producers also decoded data before the shared preparation path, so one image could occupy several full-size representations at once. The change rejects known oversized inputs before decoding, avoids duplicate size-limit logic, and keeps prepared image bytes out of ordinary conversation history.
Memory and lifecycle
No new runtime dependency is added. Full streaming transport remains outside this change.
Validation
The two full-suite failures are inherited from the rebased #9669 changes: the Azure OpenAI test fixture has no endpoint, and the upload-format fixture does not define content_length. Native Windows and macOS runs remain unverified.