feat(generator): standardize all reference image passing to inline Base64 data URLs - #364
Merged
JuhaoChen666 merged 7 commits intoAug 28, 2026
Conversation
…l providers Previously, normalizePrototypeReference passed raw remote S3 URLs to AI model providers if the image did not require upscaling. Remote AI providers (such as QNA) often encounter network timeouts or authentication errors when attempting to download private S3 URLs. Always convert normalized reference images to inline base64 data URLs to eliminate outbound image downloads by model providers.
…se64 prototype test Ensure scenery generation resolves and converts references to inline Base64 data URLs. Add live end-to-end character prototype generation test with Base64 reference.
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
Codecov Report❌ Patch coverage is
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 14 files with indirect coverage changes 🚀 New features to boost your workflow:
|
No-op reference normalization can return an existing image data URL. Reuse normalized data URLs and wrap only raw Base64 payloads. Prevent duplicate data URL prefixes and cover the behavior with a regression test.
Prototype reference downloads can stall while reading object-storage responses. Retry transient transport and HTTP failures up to three attempts and extend each attempt to two minutes. Preserve deterministic failures while logging redacted attempt diagnostics.
Reference download retries introduced uncovered timeout, size-limit, and logging paths. Add focused tests for transient and permanent failures, empty responses, oversized content, cancellation, and retry classification. Restore generator coverage to 90.6% and protect download observability behavior.
Codecov still reported uncovered branches when retry waits were canceled. Add deterministic tests for default-client cancellation and canceled request/read retries. Raise downloader coverage to 90.5% and the generator package to 90.7%.
cqhasy
approved these changes
Aug 28, 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.
Change Description (Required)
data:image/png;base64,...).[BadRequestError] Unable to download content from the provided URL before the timeouton remote AI model providers (such as QNA) caused when providers attempt to fetch private S3/object storage URLs from external data centers.generateSceneryLayers), prototype generation (normalizePrototypeReference), tileset generation, and tileset editing always pass self-contained Base64 data URLs in generation requests.TestLiveBase64CharacterPrototypeGenerationverifying real end-to-end Character Prototype generation using Base64 reference inputs.Implementation Approach (Required)
normalizePrototypeReferenceinexecutor_prototype.go:generatedImageDataURL(...)(data:image/png;base64,...) instead of returning raw remote object storage URLs when the image does not require upscaling.generateSceneryLayersinexecutor_scenery.go:e.resolveReferences(ctx, GenerateScenery, ...)to ensure scenery references are also converted to Base64 data URLs.executor_prototype_test.gotest expectations to reflect normalized Base64 data URLs.TestLiveBase64CharacterPrototypeGenerationinexecutor_tileset_live_test.goverifying real model execution.Related Issue (Required)
None
Testing (Required)
go test -v ./internal/module/generator/...- PASSHOLONIC_LLM_INTEGRATION=1 go test -v ./internal/module/generator -run TestLiveBase64CharacterPrototypeGeneration -timeout 5m- PASS (Real model generation succeeded in 75.55s)Screenshots or Recordings (Optional)
Character Prototype generation verified with Base64 reference image input.
Risks and Follow-ups (Optional)
None identified.
Checklist (Required)