Skip to content

fix(billing): do not auto-retry billed tool Seer requests - #75

Closed
cursor[bot] wants to merge 1 commit into
mainfrom
cursor/critical-bug-investigation-ca0e
Closed

cursor[bot] wants to merge 1 commit into
mainfrom
cursor/critical-bug-investigation-ca0e

Conversation

@cursor

@cursor cursor Bot commented Sep 11, 2026

Copy link
Copy Markdown

What changed

  • Face Reading, Runes, KP, Horary, Feng Shui, and Dream Symbols Ask-the-Seer chats no longer auto-retry after a 5xx or a thrown fetch.
  • A single Send now posts the billed request once. Failures show the existing unavailable message so the user can retry deliberately.

Why this change is safe

  • Root cause: enforceToolSeerGate calls consumeBillingAction before the LLM. These UIs retried 500/502 and catch-path network/stream errors, so one click could consume the per-tool free instance and then debit a PAYG credit.
  • Trigger: PAYG user asks Face Reading (or the other five tools) with a valid analysis. The route returns 500 after the gate (Groq/handler error) or the stream throws. The UI waited 1.5s and posted again.
  • Scope is limited to removing those retries. 401 token refresh in fetchWithFirebaseAuthRequired is unchanged (auth fails before debit).
  • Distinct from empty-question (Fix Seer billing for empty questions #59) and missing-chart (Fix Seer billing when natal chart context is missing #64Fix Medical Seer billing when chart context is missing #66) billing. Complementary to “no refund when a valid LLM call fails” — this stops the extra unsolicited debit.

Verification

  • pnpm exec eslint on the six chat files + new test (pre-existing warnings only; 0 errors)
  • pnpm test — 74 suites / 399 tests, including tests/unit/seerBilledRetry.test.ts
  • Playwright smoke not run (unauthenticated E2E cannot exercise signed-in Seer debit)

Regression prevention

  • tests/unit/seerBilledRetry.test.ts fails if those UIs restore RETRY_DELAY_MS / isRetryableStatus / a second await performFetch()
  • Other Seer chats were already single-post.

Release checklist (solo-friendly)

Open in Web View Automation 

Ask-the-Seer gates debit PAYG credits (or consume the per-tool free
instance) before the LLM runs. Face Reading, Runes, KP, Horary, Feng
Shui, and Dream Symbols auto-retried 5xx and thrown fetches, so one
send could burn the free instance and then charge a credit.

Co-authored-by: Andy Oliver Rozario <andyrozario7@gmail.com>
@vercel

vercel Bot commented Sep 11, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
future-seer Ready Ready Preview Sep 11, 2026 11:34am UTC

@AndyOliverR

Copy link
Copy Markdown
Owner

Superseded by #78 — unique fix cherry-picked onto current main (billed tool Seer UIs no longer auto-retry after debit).

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.

2 participants