feat(llm-gateway): drop posthog_code free valve to $20 - #70947
Merged
Conversation
Contributor
Author
This stack of pull requests is managed by Graphite. Learn more about stacking. |
2 tasks
Contributor
|
Reviews (1): Last reviewed commit: "feat(llm-gateway): drop posthog_code fre..." | Re-trigger Greptile |
charlesvien
approved these changes
Jul 15, 2026
adboio
force-pushed
the
posthog-code/gateway-free-valve-20
branch
from
July 15, 2026 03:50
b661233 to
7feec83
Compare
adboio
force-pushed
the
posthog-code/gateway-org-subscription-cap
branch
from
July 15, 2026 03:53
441e610 to
37af628
Compare
adboio
force-pushed
the
posthog-code/gateway-free-valve-20
branch
2 times, most recently
from
July 15, 2026 04:28
eb69e21 to
7fa79f5
Compare
richardsolomou
approved these changes
Jul 15, 2026
adboio
force-pushed
the
posthog-code/gateway-free-valve-20
branch
2 times, most recently
from
July 15, 2026 14:51
12911a4 to
b97596c
Compare
adboio
changed the base branch from
posthog-code/gateway-org-subscription-cap
to
graphite-base/70947
July 15, 2026 15:19
adboio
force-pushed
the
posthog-code/gateway-free-valve-20
branch
from
July 15, 2026 15:20
b97596c to
d5214fa
Compare
adboio
force-pushed
the
graphite-base/70947
branch
from
July 15, 2026 15:20
87329f6 to
5ec77d2
Compare
The per-user free-plan cap is an abuse valve, not billing logic: the org-level monthly free allowance (billing's free plan, enforced through the quota pipeline) is the real ceiling for non-paying orgs. $20 matches that allowance, so no single user can burn past the org's entire month alone - the valve only has to bound burn during the quota pipeline's ~20-minute blocking lag. Plain constant on purpose: nothing needs a no-deploy flip here (the valve has no ordering relationship with the seat-deletion cutover), so a settings knob would be machinery without a load. Changing the number again is a one-line PR. Generated-By: PostHog Code Task-Id: e6d23925-2a64-452b-aeea-fd349077f904
adboio
force-pushed
the
posthog-code/gateway-free-valve-20
branch
from
July 15, 2026 15:21
d5214fa to
49b3ef5
Compare
Contributor
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Problem
Free-tier posthog_code users are capped at $75/day. Under usage-based billing the org-level free allowance is $20/month, enforced through the quota pipeline within ~20 minutes, so the per-user cap only has to bound burn inside that window. $75 is far past the thing it protects.
Changes
FREE_PLAN_COST_LIMITdrops to $20 burst/day and $20 sustained/30d, matching the org allowance so one user can't burn past an org's month alone. Takes effect for free-tier users on deploy.How did you test this code?
Existing free-cap boundary tests moved to the new value ($20 blocks, $19 sustained allowed). Full gateway suite green.
Automatic notifications
Docs update
None.
🤖 Agent context
Autonomy: Human-driven (agent-assisted)
PostHog Code session (Claude). Skill: /writing-tests.
Created with PostHog Code