Skip to content

Make Assets image generation async completely#1638

Open
teleaziz wants to merge 6 commits into
mainfrom
fix-quality-1
Open

Make Assets image generation async completely#1638
teleaziz wants to merge 6 commits into
mainfrom
fix-quality-1

Conversation

@teleaziz

@teleaziz teleaziz commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

Motivation

Hosted agent actions have a ~40s soft timeout, but image generation could hold the action open for much longer: a single managed provider call had a 90s request ceiling plus an internal multi-minute in-flight poll loop, and batches waited across multiple slots. Slow or large batches could therefore time out even though the provider kept generating successfully in the background.

Summary

  • make generate-image / generate-image-batch return quickly when images are still processing
  • add shared image run finalization that replays provider idempotency keys, dedupes assets, and syncs variant slots
  • move slow image processing/storage work outside SQLite transactions
  • let the live candidate tray own image polling, while agent guidance avoids manual polling in normal chat
  • fix generated candidate previews to use stored CDN object URLs
  • update Assets image-generation skills, action descriptions, tests, and changelog

@netlify

This comment has been minimized.

@netlify

This comment has been minimized.

@netlify

This comment has been minimized.

@netlify

This comment has been minimized.

@netlify

This comment has been minimized.

@netlify

This comment has been minimized.

@netlify

This comment has been minimized.

@netlify

This comment has been minimized.

@netlify

This comment has been minimized.

@netlify

This comment has been minimized.

@netlify

This comment has been minimized.

@netlify

This comment has been minimized.

@netlify

This comment has been minimized.

@netlify

This comment has been minimized.

@github-actions

github-actions Bot commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

Here's a visual recap of what changed:

Visual recap

Open the full interactive recap

@netlify

This comment has been minimized.

@netlify

This comment has been minimized.

builder-io-integration[bot]

This comment was marked as outdated.

@builder-io-integration builder-io-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Builder reviewed your changes and found 2 potential issues 🔴

Review Details

This incremental update addresses the previously reported picker/session issues and tightens the async image-run lifecycle, but it also changes provider fallback behavior in a way that materially affects non-Builder-managed deployments. The shared finalization path is a sound direction overall: centralizing completion logic, keeping the UI on processing instead of blocking, and teaching the picker to retain processing run IDs all improve the architecture.

Risk assessment remains standard / medium because this is cross-cutting generation/session/runtime logic rather than a cosmetic UI tweak.

New findings in this revision

  • 🔴 HIGH The new single-shot helper now rejects manual Gemini/OpenAI fallback whenever a runId is present, but generate-image/generate-image-batch always create a run first. That effectively breaks BYOK/manual image generation for the normal action path.
  • 🟡 MEDIUM Refresh finalization reuses the same tiny budget for both the provider request and the image download, so completed provider runs can get stuck returning processing forever on slow downloads.

Good changes in this revision: the previous open issues around processing run IDs in the picker and missing session activation for all-processing batches now appear addressed, and the added tests cover those fixes.

🧪 Browser testing: Will run after this review (PR touches UI code)

Comment thread templates/assets/server/lib/generation.ts Outdated
Comment thread templates/assets/server/lib/image-runs.ts Outdated
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