Repository navigation
fix(training-agent): reject creative_assignments: [] on active/paused buys - #3286
Merged
bokelley merged 2 commits intoApr 30, 2026
Merged
Conversation
… buys update_media_buy with an empty creative_assignments array on a live buy caused deriveStatus to return pending_creatives (hasCreatives === false), emitting an active → pending_creatives transition not in MEDIA_BUY_TRANSITIONS. Guard added in the pre-validation pass: if the buy is in active, paused, or pending_start status, clearing all assignments on any package returns VALIDATION_ERROR before any mutation occurs. Updated the comment at the mutation site to reflect that the empty-array case is now pre-empted. Closes #2835 https://claude.ai/code/${CLAUDE_CODE_REMOTE_SESSION_ID}
bokelley
force-pushed
the
claude/issue-2835-reject-creative-clear-on-active-buy
branch
from
April 30, 2026 19:51
2dd6d4a to
420e17f
Compare
…/paused Updates the existing pending_start test to assert rejection (matching the new guard in handleUpdateMediaBuy) and adds coverage for active and paused arms. Adds a positive test confirming pending_creatives stays a no-op (guard list correctly excludes it). Per javascript-protocol-expert review of #3286. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
bokelley
marked this pull request as ready for review
April 30, 2026 19:58
bokelley
enabled auto-merge (squash)
April 30, 2026 19:59
bokelley
deleted the
claude/issue-2835-reject-creative-clear-on-active-buy
branch
April 30, 2026 20:05
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.
Closes #2835
update_media_buywithcreative_assignments: []on a package of an active buy causedderiveStatusto returnpending_creatives(becausehasCreatives === false), emitting anactive → pending_creativestransition that is not inMEDIA_BUY_TRANSITIONS. Thestatus.monotonicinvariant assertion would reject this transition the moment any storyboard exercises the "buyer replaces all creatives" path.Fix: Validation guard added in the pre-validation pass (
handleUpdateMediaBuy, pre-pass loop). If the buy's derived status isactive,paused, orpending_start, clearing all assignments on any package returnsVALIDATION_ERRORbefore any mutation occurs. This is Option 2 from the issue — cleaner than thecreaturesWereAttachedbit (Option 1) because it keepsderiveStatusandMEDIA_BUY_TRANSITIONSuntouched and produces a clear API error the agent under test can observe.Non-breaking justification: Server-only change in
task-handlers.ts; no protocol schema, task definition, or published API surface touched. Changeset--empty.Pre-PR review:
Session: https://claude.ai/code/${CLAUDE_CODE_REMOTE_SESSION_ID}
Generated by Claude Code