Skip to content

fix: keep keyword billing refusal reasons - #393

Closed
hamitarsln wants to merge 1 commit into
tin-computer:mainfrom
hamitarsln:codex/keyword-billing-failure-reason
Closed

hamitarsln wants to merge 1 commit into
tin-computer:mainfrom
hamitarsln:codex/keyword-billing-failure-reason

Conversation

@hamitarsln

Copy link
Copy Markdown
Collaborator

What and why

Keyword planning called every billing refusal a spending limit. A missing model price or an already attempted operation could therefore get the wrong explanation.

Keep actual run/project limits as spending limits. Other billing refusals keep their fixed code, and the failure message names it. Raw exception text stays private. Existing call replay and spending guards stay in place.

Verification

  • Six non-limit regression cases failed before the fix.
  • 163 keyword-plan tests passed; 11 tests skipped.
  • Tests cover real limit codes, pricing/recovery refusals, safe error text and retries making only one model call.
  • Ruff, format and diff checks passed.

Notes

Verification uses local test providers. The changed worker has not been deployed or tested with a live billing refusal. No pricing or spending authority changed.

@hamitarsln
hamitarsln requested a review from a team as a code owner October 11, 2026 22:27
Copilot AI balanced review requested due to automatic review settings October 11, 2026 22:27

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 implementation matches the stated billing, privacy, and replay requirements with focused regression coverage.

0 open findings

What changed in this PR

Preserves specific billing refusal codes while keeping sensitive diagnostics private and preventing duplicate model calls.

Changes:

  • Distinguishes spending limits from other billing refusals.
  • Adds safe, cause-specific failure messages and regression coverage.
File Description
src/​tin_lite/​keyword_plan_activities.py Preserves and reports safe billing refusal codes.
tests/​test_keyword_plan.py Tests refusal classification, privacy, and retry behavior.

🧠 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

Superseded by #403: keyword plan billing refusals now use the shared billing_refusal wording, so only real run/project limits read as spending limits.

@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