Repository navigation
Add draft_dismiss_recommendations - #110
Merged
Merged
Conversation
Dismiss Google recommendations the user has decided not to take, through the usual draft, preview and confirm_and_apply flow. get_recommendations now returns each recommendation's ID and resource name, which the new tool takes. DismissRecommendation has no validate_only field, so the dry run re-reads the account and checks every recommendation is still active, the way the Reddit, Tag Manager and GA4 writes do. Closes kLOsk#108.
kLOsk
reviewed
Oct 27, 2026
kLOsk
left a comment
Owner
There was a problem hiding this comment.
Thanks, this is careful work. The re-read dry run is the right answer to the missing validate_only, and pinning that ValidateOnlyClient refuses the call is exactly the kind of test we want. Single confirmation is fine with us. We'll regenerate the docs tool reference ourselves after the release. Approving once CI is green.
Contributor
Author
|
Thanks for the review and the merge. |
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 #108.
Adds
draft_dismiss_recommendations, so recommendations the user has decided not to take can be turned down through the usual draft → preview →confirm_and_applyflow.API:
RecommendationService.DismissRecommendation(DismissRecommendationRequest{customer_id, operations[], partial_failure}).What changed
get_recommendationsnow returnsrecommendation.idandrecommendation.resource_nameon each row. It already selected the resource name but dropped it, so there was no way to say which recommendation you meant.ads/recommendations.pywith the draft, the dry-run check and the applier.estimated_improvementthatget_recommendationsalready computes.partial_failure=Trueand reports any failed recommendation by ID, the same wayattach_shared_set_to_campaignsdoes.confirm_and_apply, dry run.DismissRecommendationRequesthas novalidate_onlyfield, so this op can't use_validate_with_google. It gets anis_ads_rereadbranch next to the Reddit/GTM/GA4 ones instead.server.pyand added to the rules (viascripts/sync-rules.py) and to the README write table. The rules' recommendations pattern gains a step 7: dismiss only what the user turned down.Safety reasoning
ValidateOnlyClientstill refusesdismiss_recommendationbecause it isn't amutate*/upload*method. Even if a dry run somehow reached the applier, nothing would be dismissed; a test pins that.blocked_operationsguard applies under the op namedismiss_recommendations.Tests
There are 18 new tests in
tests/test_recommendations_dismiss.py, none of them hitting the live API:_validate_with_google;partial_failure;get_recommendationsexposes the ID.I mutation-checked the dry-run test: with the "still active" check disabled, it fails.
Baseline on
mainwas 1624 passed, 2 skipped.I haven't touched
adloop-docs/reference/tools.mdx.CLAUDE.mdsays it's regenerated withscripts/generate_tools.pyafter a tool change, and I'm happy to open that PR inadloop-docsonce this one is settled.