fix: preserve editorial image URLs in content callbacks

Merged
SI
1mo ago
+166-10

Release boundary: merging this PR to main triggers the existing production Trigger.dev deployment workflow. It is not source-only housekeeping. No manual deployment or real job is run by this work; coordinator must account for the worker release when approving merge.

The existing create-content task returns its editorial imageUrl, but pollContentRuns drops it before sendContentCallback serializes results. Preserve an optional present image URL on completed results so the API #438 successor can deliver that existing artifact. Keep video/caption/run association, failed results and legacy video-only JSON unchanged.

No new job, task payload, generation, provider call, schedule, retry/poll/concurrency or billing change. Use canonical @trigger.dev/sdk import in the touched mapper; installed 4.3.3 maps root and /v3 to the same implementation. No dependency upgrade. The API receiver companion is needed for delivery; recommend releasing it first. Existing Tasks deprecation and held audio/lipsync/provider/commercial/SDKv7/original651 gates remain.

Validation:

  • New regression tests failed 2/passed 2 before implementation, then 134 content tests/28 files pass.
  • Real mapper and callback serializer tested with mocked runs.poll/fetch and fixture callback URL/secret. Per-run image association, omission for legacy and failed results, existing poll options and serialized image field checked.
  • Changed-file formatting/diff checks pass. Whole-project local TypeScript retains 14 baseline diagnostics byte-identically; no clean typecheck claim.
  • No live Trigger/provider/Slack/customer/database/key/credit operation, environment/permission change, secret inspection or manual deploy. Independent exact-head review and CI tracked before coordinator handoff.

Head f9509b899ff70b4cf24ccb6917332615111cfa7c, tree 56039b3868bb61aee9dab817f80160c41791484f, base a01874b1c9db58f9cf19612a15df8b8162cd9545.

Receiver companion: https://github.com/recoupable/api/pull/1097