Skip to content

Fix Medical Seer billing when chart context is missing - #66

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

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

Conversation

@cursor

@cursor cursor Bot commented Sep 2, 2026

Copy link
Copy Markdown

What changed

Why this change is safe

  • Root cause: MedicalSeerChat is always rendered on /tools/medical-astrology (Ask the Seer tab). Starter questions fire with analysis: null. The gate billed, then the route 400'd with "Generate your medical astrology analysis first."
  • Trigger: Authenticated PAYG user opens Medical Astrology → Ask the Seer before a report exists → clicks a starter chip (e.g. "What health tendencies does my chart show?").
  • Scope is focused: gate option + Medical Seer route. Does not change Vedic/Western (Fix Seer billing when natal chart context is missing #64) or Hellenistic (Fix Hellenistic Seer billing when chart context is missing #65) routes.
  • Valid questions with a chart still debit (locked by test).

Verification

  • ESLint on touched files
  • pnpm test — 70 suites / 386 tests
  • pnpm run lint:security passed
  • Playwright smoke (not required: no UI/routing change; billing is API-only)

Pre-existing pnpm run security high browserslist advisories are unchanged.

Regression prevention

  • tests/unit/medicalSeerMissingChart.test.ts: missing analysis → 400 and consumeBillingAction not called; valid chart still bills.
  • tests/unit/enforceToolSeerGate.test.ts: missingContextError returns 400 before debit.

Release checklist (solo-friendly)

Not in this PR: LLM/stream failure after a valid question with chart still debits with no refund helper.

Open in Web View Automation 

PAYG users were charged a tool_seer credit when Ask the Seer on
Medical Astrology ran without a chart (starter questions fire with
analysis=null). Reject missing chart context in the Seer gate before
rate-limit and consumeBillingAction.

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

vercel Bot commented Sep 2, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated
future-seer Error Error Sep 2, 2026 11:14am UTC

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.

1 participant