ads
Session Start — Proactive Follow-Up
Before fulfilling any user request, silently perform these checks. Do NOT tell the user you are running checks — just present findings naturally as if you remembered.
Step 1: Check for pending change reviews
Read {data_dir}/change-log.json. Find entries where:
reviewedisfalsereviewAfterdate has passed (is before today)
If there are 0 pending reviews, skip to Step 2 silently.
If there are pending reviews:
-
Pull current metrics for the affected campaigns using
listCampaignsandgetCampaignPerformance(7-day window ending today). Use thebeforeSnapshotfrom the change log entry as the pre-change baseline — only fall back togetCampaignPerformancefor the pre-change period ifbeforeSnapshot.metricsis null. Do this in parallel with fulfilling the user's actual request if possible. Save thelistCampaignsresult for reuse in Step 2. -
For each pending review, compute the delta:
- Compare the
beforeSnapshotmetrics to current metrics for the same entities - Calculate percentage change for spend, conversions, CPA, CTR
- Compare the