Skip to content

fix: require USD accounts for Ads launch and monitoring - #400

Closed
hamitarsln wants to merge 2 commits into
tin-computer:mainfrom
hamitarsln:codex/ads-account-currency
Closed

hamitarsln wants to merge 2 commits into
tin-computer:mainfrom
hamitarsln:codex/ads-account-currency

Conversation

@hamitarsln

@hamitarsln hamitarsln commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

What and why

Launch and monitor use USD budgets and costs, while Google Ads uses the account's currency. Require a confirmed USD account before campaign drafting or monitoring. Other or missing currencies stop the flow.

The first account read also saves its failure reason for the final message. A billing refusal stops without retrying; an unconfirmed provider result keeps its existing retry behavior.

Google's budget field reference defines the amount in the account's currency.

Verification

The missing currency guard was reproduced twice. Three follow-up checks also failed because account-read causes disappeared from the final message.

After the fix, 141 related tests passed with a disposable database, no skips. Both PRs #394 and #400 passed 185 tests together, including one-attempt replay, no model calls or campaign changes on a refused account read. Their combined code merges without conflict.

Ruff, formatting and diff checks passed.

Limits

Synthetic providers only; no live Ads account was used. USD is the supported currency. No exchange-rate conversion is added. Live account access and production deployment still need a separate check.

Copilot AI balanced review requested due to automatic review settings October 12, 2026 08:13
@hamitarsln
hamitarsln requested a review from a team as a code owner October 12, 2026 08:13

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The guards consistently stop unsafe flows and have focused coverage for launch, monitoring, and read failures.

0 open findings

What changed in this PR

Adds USD currency validation to prevent Google Ads budgets and costs from being misinterpreted.

Changes:

  • Blocks launch and monitoring unless the account confirms USD.
  • Preserves account-read failure reasons.
  • Adds currency guard tests and documentation.
File Description
src/​tin_lite/​paid_ads_launch.py Adds the unsupported-currency launch outcome.
src/​tin_lite/​paid_ads_monitor_activities.py Validates currency before monitoring.
tests/​test_paid_ads_currency.py Tests unsupported and unavailable currencies.
tests/​test_paid_ads_monitor_activities.py Adds account fixtures and updates read counts.
docs/​paid-ads-launch-implementation.md Documents the USD requirement.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@demegire

Copy link
Copy Markdown
Contributor

Closing in favour of #402, which supports other account currencies instead of requiring USD: one ECB rate is pinned at launch and amounts are converted onto Google's minimum unit, and currencies Tin cannot price stop with a named reason. It does not include this PR's account-read failure reasons in the monitor's final message; that can follow separately if still wanted.

@demegire demegire closed this Oct 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants