Skip to content

fix(billing): gate investigations on a real allowance, not balance presence - #835

Merged
izadoesdev merged 1 commit into
mainfrom
staging
Sep 18, 2026
Merged

izadoesdev merged 1 commit into
mainfrom
staging

Conversation

@izadoesdev

@izadoesdev izadoesdev commented Sep 18, 2026

Copy link
Copy Markdown
Member

Promote the investigation access gate fix from staging.

After the Autumn config push every plan carries an investigation_runs item, so checking that the balance key exists let free, hobby, and pro organizations enable investigations that then failed in the worker. Access now requires an unlimited balance, overage terms, or a positive grant. The same rule drives the dashboard access and fixed-price flags, and the analysis reply gate.

Surfaced by the review of #789. AI-assisted implementation and review under the maintainer workflow.


Summary by cubic

Fixes investigation access gating so free, hobby, and pro orgs no longer see investigations enabled when they'd fail in the worker. Access now requires an unlimited balance, overage terms, or a positive grant, instead of just checking the investigation_runs balance key, which all plans have after the Autumn config push. The same rule now consistently drives the dashboard access, fixed-price flag, and analysis reply gate.

Written for commit bc76ef1. Summary will update on new commits.

Review in cubic

…esence

Every plan carries an investigation_runs item after the Autumn config
push, so checking that the balance key exists let free, hobby, and pro
orgs enable investigations that then failed in the worker. Access now
requires an unlimited balance, overage terms, or a positive grant, and
the same rule drives the dashboard access and fixed-price flags.
@vercel

vercel Bot commented Sep 18, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated
dashboard (staging) Ready Ready Preview Sep 18, 2026 1:53pm UTC
databuddy-status Ready Ready Preview Sep 18, 2026 1:53pm UTC
documentation (staging) Ready Ready Preview Sep 18, 2026 1:53pm UTC

@coderabbitai

coderabbitai Bot commented Sep 18, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: ASSERTIVE

Plan: Advanced

Run ID: 69e5b45b-6394-4f1f-ac42-c91faa0680e4

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@greptile-apps

greptile-apps Bot commented Sep 18, 2026

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 5/5

The PR appears safe to merge, with the shared entitlement predicate consistently applied and no actionable regression identified.

Summary

This PR centralizes the hosted investigation entitlement rule and applies it consistently across dashboard access, investigation generation, and analysis replies.

  • Adds hasInvestigationAllowance, accepting unlimited balances, overage terms, or a positive plan grant.
  • Replaces feature-key-presence checks in both RPC investigation gates.
  • Uses the shared rule for dashboard access and fixed-price state while retaining the current-balance usability check.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart LR
    A[Autumn investigation balance] --> B[hasInvestigationAllowance]
    B --> C[Dashboard access and fixed-price state]
    B --> D[Generation RPC access gate]
    B --> E[Analysis reply access gate]
    C --> F[summarizeInvestigationBalance]
    F --> G[Current dashboard canUse state]
    D --> H[Investigation worker]
    E --> H
    H --> I[Authoritative required-balance check]
Loading

Reviews (1) · Last reviewed commit: "fix(billing): gate investigations on a r..."

@izadoesdev
izadoesdev merged commit 629c154 into main Sep 18, 2026
29 checks passed
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