Skip to content

Fix Hellenistic Seer billing when chart context is missing - #65

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

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

Conversation

@cursor

@cursor cursor Bot commented Sep 1, 2026

Copy link
Copy Markdown

What changed

  • Hellenistic Ask the Seer no longer debit PAYG credits (or consume the free tool-seer instance) when the chart payload is missing.
  • The shared tool Seer gate now accepts missingContextError and returns 400 before rate-limit and consumeBillingAction.
  • Added a unit test that a real question with no Hellenistic chart returns 400 and does not call billing.

Why this change is safe

  • Root cause: enforceToolSeerGate billed first; /api/hellenistic/ask-seer then 400’d for missing hellenisticContext.
  • Trigger: Signed-in PAYG user opens Ask the Hellenistic Seer before a reading exists (the tab is shown even without a chart; starter chips send immediately), submits a real question. UI already mapped that 400 to “Generate your Hellenistic chart first…” after the debit.
  • Scope is the gate plus the Hellenistic Seer route. Vedic/Western remain open PR Fix Seer billing when natal chart context is missing #64. Complementary to Fix Seer billing for empty questions #59 (empty-question debit) and Fix Seer billing when natal chart context is missing #64 (natal missing-chart debit), not a duplicate.
  • Auth still runs first (401 before missing-context 400).

Verification

  • pnpm exec eslint on touched files (0 errors)
  • pnpm test — 69 suites / 382 tests passed
  • pnpm run security passed
  • Playwright smoke not required (API billing gate only; no UI/routing change)

Regression prevention

  • tests/unit/enforceToolSeerGate.test.ts — missing Hellenistic chart context → 400 and consumeBillingAction not called; valid questions still bill; injection blocks still skip debit.
  • Existing empty-question pass-through behavior in the gate is unchanged (still covered by open Fix Seer billing for empty questions #59).

Release checklist (solo-friendly)

  • CI is green
  • Ready to merge to main
  • Post-merge: ask Hellenistic Seer before generating a chart — should 400 with no credit change
Open in Web View Automation 

Ask the Seer billed PAYG credits before returning 400 for a missing
Hellenistic chart. The chat tab is usable without a reading, so a real
question could consume a credit and then fail. Reject missing context
in the shared gate before consumeBillingAction.

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

vercel Bot commented Sep 1, 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 1, 2026 11:13am 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