Skip to content
This repository was archived by the owner on Jul 27, 2026. It is now read-only.

fix(admanage): write ad sets with direct campaignId to state via id->name map (replay of 71eecb4) - #33

Open
antfleet-ops wants to merge 4 commits into
mainfrom
replay/admanage-71eecb4
Open

fix(admanage): write ad sets with direct campaignId to state via id->name map (replay of 71eecb4)#33
antfleet-ops wants to merge 4 commits into
mainfrom
replay/admanage-71eecb4

Conversation

@antfleet-ops

Copy link
Copy Markdown

Bench replay of upstream aaronjmars/aeon#204 (commit 71eecb4) — canary re-validation run #2 for Patch Agent v1.5.

This PR re-runs the AntFleet pipeline after PR aeonfun#47 fixed the per-install override disambiguation bug discovered in canary run #1 (bench PR #32). Expecting the Patch Agent to fire on this review — if both reviewers (Opus + GPT-5) agree on at least one finding with a localized patch, a <details>Proposed patch subsection should appear in the review comment.

Source: https://github.com/aaronjmars/aeon/pull/204
Related: AntFleet PR aeonfun#47 (per-install override fix), bench PR #32 (canary run #1, patch lane disabled by the bug)

antfleet-ops and others added 4 commits May 22, 2026 10:11
…name map (aeonfun#204)

Phase 2 of `scripts/postprocess-admanage-create.sh` builds the
state-file entry for a newly created ad set using
`select(.configName == $parent)`, where `$parent` is the
`parentCampaignConfigName` from the payload. When a payload supplies a
direct `campaignId` instead of a `parentCampaignConfigName` (the script
allows this path — only the `__RESOLVE_FROM_PARENT__` sentinel or an
empty id triggers the name-based resolution branch), `$parent` ends up
empty, the jq `select` matches no campaign, and the ad set is never
appended to `.admanage-state/campaigns.json`.

Symptom: an ad set creates successfully in AdManage and an `adSetId`
is recorded in `creates-results/adset-<basename>.json`, but the same
ad set is missing from `.admanage-state/campaigns.json`. Next Claude
run reads stale state and may re-queue the same ad set, leading to
duplicate provisioning in AdManage.

This change:

- Builds a reverse `ID_TO_NAME` map from `STATE_FILE` alongside the
  existing `NAME_TO_ID` preload (one extra `jq` pass).
- Before the state-write `jq` call, resolves the campaign's
  `configName` from the reverse map when `parent_name` is empty. The
  resolved name (`state_parent`) is what the `select` filters on.
- If the campaignId in the payload isn't in the reverse map either
  (e.g. it references a campaign that was created outside this skill's
  state), the ad set is still created via the API call above, but the
  state-write is skipped with a `WARNING` log line and a summary entry
  noting "state SKIPPED: parent campaign unknown". The script does not
  silently drop the ad set — the operator sees the missing-state
  message in the post-run notification.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: antfleet-ops <285575208+antfleet-ops@users.noreply.github.com>
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant