Repository navigation
[Engine] fix(images): retain every URL in a response batch - #339
Merged
linyubupa merged 1 commit intoNov 22, 2026
Merged
Conversation
linyubupa
approved these changes
Nov 22, 2026
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.
What & why
Fixes #324, following the agreed batch-retention approach.
With
keep_files=1, a successful URL response containing two generated images currently deletes its first image while storing its second. The response therefore includes a URL that is already unavailable.Write the complete response batch before pruning, and protect every filename in that batch during the single pruning pass. Older images fill only the remaining retention budget. This also protects the current response when older files have equal or future timestamps. A later response can replace the earlier batch as usual. Base64 responses do not write or prune files.
Area
edge0-strata/How was it tested?
On Linux x86_64 with Python 3.12.14:
python -m unittest serve.test_images -vfromedge0-strata/: 24 passed, including the existing HTTP tests with a fake image-generation CLI.main, three of these fail because returned images have already been deleted; all five pass with the fix. Tests check the stored bytes for every returned URL filename.git diff --check: passed.ctest --preset cpu -L 'L0|L1' -j 1, with a writableTMPDIRand local tools onPATH: 96 passed, 3 skipped, 7 failed. All seven also failed in the unchanged-base run. Four require missing Python dependencies in their own runner environments; the remaining failures aremoe_test_app_generation,moe_test_platform_memory, andmoe_test_ordered_json. The focused image-service suite is fully passing. No GPU or model-quality test was run.Checklist