Fix creative preview by auto-fetching from creative agent #379
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.
Summary
Fixes blank creative previews in the admin UI by automatically calling the creative agent's
preview_creativetool when creatives are synced without asset data.Problem
When creatives were synced via
sync_creativeswithout preview data (nourlorsnippet), they were stored with null values for all preview fields, resulting in blank previews in the admin UI review queue.Example: Creative
mp4videotesting_wp8rgi59showed "No preview available" with all null preview fields.Solution
The sales agent now automatically calls the creative agent's
preview_creativeMCP tool when:urlorsnippetis providedformat_idThe implementation:
preview_creativetoolpreview_url,width,height,durationChanges
File:
src/core/main.py_sync_creatives_impl()to auto-fetch previewsasyncio.run()to call async creative agent registry methodsTesting
✅ All unit tests pass (610 passed)
✅ All integration tests pass (192 passed)
✅ Pre-push validation successful
Architecture
Follows AdCP v2.4 architecture where creative agents are the authoritative source for preview rendering. Sales agents delegate preview generation rather than implementing format-specific rendering logic.
Next Steps
To test with the blank creative:
sync_creativesagain)[sync_creatives] Calling preview_creative for mp4...🤖 Generated with Claude Code