You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jun 13, 2026. It is now read-only.
From local storefront E2E against ghcr.io/bokelley/salesagent:latest (image id 8d9a7d94b344), sync_creatives can return INTERNAL_ERROR when a creative fails validation but the request also includes assignments.
Repro shape:
create_media_buy succeeds and returns a package.
sync_creatives sends one new creative with an unsupported format_id.agent_url, plus an assignment to the package.
Creative validation fails, so no row is inserted into creatives.
_process_assignments still inserts creative_assignments for that creative.
Observed DB error:
psycopg2.errors.ForeignKeyViolation: insert or update on table "creative_assignments" violates foreign key constraint "fk_creative_assignments_creative_composite"
DETAIL: Key (creative_id, tenant_id, principal_id)=(strict-e2e-creative-..., tenant_5b0bec3d, principal_1951e7c9) is not present in table "creatives".
Expected:
If a creative fails validation, assignment processing should skip it and return a per-creative action: failed response with an assignment/validation error.
No FK violation or INTERNAL_ERROR should leak to the buyer.
Likely area: src/core/tools/creatives/_sync.py processes assignments after creative processing, and _assignments.py does not appear to check that the creative exists before upserting the assignment.
From local storefront E2E against
ghcr.io/bokelley/salesagent:latest(image id8d9a7d94b344),sync_creativescan returnINTERNAL_ERRORwhen a creative fails validation but the request also includes assignments.Repro shape:
create_media_buysucceeds and returns a package.sync_creativessends one new creative with an unsupportedformat_id.agent_url, plus an assignment to the package.creatives._process_assignmentsstill insertscreative_assignmentsfor that creative.Observed DB error:
Expected:
action: failedresponse with an assignment/validation error.INTERNAL_ERRORshould leak to the buyer.Likely area:
src/core/tools/creatives/_sync.pyprocesses assignments after creative processing, and_assignments.pydoes not appear to check that the creative exists before upserting the assignment.