Skip to content

[Engine] fix(images): retain every URL in a response batch - #339

Merged
linyubupa merged 1 commit into
Edge0-AI:mainfrom
Afloat16:fix/image-response-retention-20261122
Nov 22, 2026
Merged

linyubupa merged 1 commit into
Edge0-AI:mainfrom
Afloat16:fix/image-response-retention-20261122

Conversation

@Afloat16

Copy link
Copy Markdown
Contributor

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 -v from edge0-strata/: 24 passed, including the existing HTTP tests with a fake image-generation CLI.
  • Five new cases cover oversized batches, ordinary retention, replacement by a later batch, older files with future timestamps, and unchanged base64 storage behavior. Against unchanged 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.
  • Native CPU CMake configure/build also completed. ctest --preset cpu -L 'L0|L1' -j 1, with a writable TMPDIR and local tools on PATH: 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 are moe_test_app_generation, moe_test_platform_memory, and moe_test_ordered_json. The focused image-service suite is fully passing. No GPU or model-quality test was run.

Checklist

  • Linked an agreed issue.
  • Related response-batch retention cases are in this pull request.
  • This is one of at most two open pull requests from me.
  • Added regression tests for the behavior.
  • Native CPU L0/L1 suite is fully passing; unchanged-base failures are reported above.

@Afloat16
Afloat16 requested a review from linyubupa as a code owner November 22, 2026 14:29
@github-actions github-actions Bot added the strata edge0-strata label Nov 22, 2026
@linyubupa
linyubupa merged commit a2c38bf into Edge0-AI:main Nov 22, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

strata edge0-strata

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Engine] Image URL batches lose files before the response when n exceeds keep_files

2 participants