Skip to content

Add resumable image batch generation - #114

Merged
astandrik merged 2 commits into
mainfrom
codex/generation-image-batch
Nov 7, 2026
Merged

astandrik merged 2 commits into
mainfrom
codex/generation-image-batch

Conversation

@astandrik

@astandrik astandrik commented Nov 7, 2026 •

Copy link
Copy Markdown
Owner

Add an image-only batch mode to /generate: select up to 100 PNG/JPEG/WebP images (5 MiB each), review the list, and create one independent generation per image. Progress counts server-confirmed admissions, with a private result link for every accepted image.

The batch keeps original files and per-image UUIDs in IndexedDB. It sends one POST at a time up to the existing server admission limits; it does not wait for earlier character reviews. Queue-full responses back off with the same UUID, while uncertain outcomes pause the batch. Closing the page preserves the remaining work for explicit resume.

Safety and recovery:

  • Web Locks prevent concurrent senders; transactional snapshot checks reject stale start, resume, and delete actions.
  • Receipts, input deletion, and pending history delivery commit together. Interrupted history updates resume without another generation request or extending result expiry.
  • Expired inputs cannot erase still-live result links. Saved results remain readable when new image generation is disabled.
  • Switching modes preserves the single-generation draft and recovery UUID. A pause before HTTP restores the prior attempt deadline.

No public HTTP contract, worker, YDB schema, quota, or budget changes.

Validation:

  • Full test suite: 3,486 passed, 4 skipped; typecheck, lint, mock production build, and diff checks passed.
  • Real local browser with IndexedDB/Web Locks and synthetic API: 100 independent admissions, cross-tab stale-start/deletion checks, all result links, and read-only/empty-mode transitions.
  • Desktop/mobile viewport checks in both themes. Physical Android hardware and a maximum-size 500 MiB batch stress test were not available.

No production deployment or paid generation runs were performed.

RetriggerView in GreptileConfidence Score: 5/5 Tier: plus

The PR appears safe to merge; all three previous findings are addressed and no new actionable issue was found.

Summary

Adds a resumable, image-only batch mode to /generate.

  • The generate page lets people prepare an image batch beside the single-pet form.
  • Each image in a batch gets its own request and progress.
  • Accepted batch images keep their private result links and history.

This review inspected the code and tests; it did not run the test suite.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[Select images] --> B[Save files and request IDs]
  B --> C[Explicit start or resume]
  C --> D[Acquire browser lock and check saved batch]
  D --> E[Send one image]
  E --> F{Server response}
  F -->|Accepted| G[Save receipt and remove input together]
  G --> H[Save history]
  H --> E
  F -->|Queue full| I[Wait and retry same request ID]
  I --> E
  F -->|Known rejection| J[Pause with image ready]
  F -->|Uncertain| K[Pause and keep original request]
Loading

Reviews (2) · Last reviewed commit: "fix: preserve batch retries and release ..." · Reviewed by Greptile

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 7, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-07T11:36:41.997980Z caa9ff7 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@astandrik
astandrik merged commit 30a4cbb into main Nov 7, 2026
7 of 8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant