feat: createEntitlement accepts optional quota overrides - #1914
Open
cwjwisse wants to merge 1 commit into
Open
Conversation
createEntitlement(tier) hardcoded quotas.llmo_trial_prompts to 200 on every new
entitlement, so callers could not store the real contracted prompt quota. Add an
optional createEntitlement(tier, quotaOverrides = {}) that merges the overrides over
the default quotas on new-entitlement creation only. llmo_trial_prompts_consumed is
pinned to 0 (not caller-overridable) and a non-object override is ignored. Existing
callers passing only tier are byte-for-byte unaffected.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
cwjwisse
force-pushed
the
fix-tier-client-quota-override
branch
from
September 7, 2026 13:02
0659ace to
d5dc53b
Compare
|
This PR will trigger a minor release when merged. |
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.
1. Abstract
Adds an optional
quotaOverridesparameter toTierClient.createEntitlementso a caller can store a non-default prompt quota when a new entitlement is created.2. Reasoning
createEntitlement(tier)hardcodesquotas.llmo_trial_prompts: 200on every new entitlement, so consumers can never persist the real contracted quota. Downstream, the ABV Semrush provisioning message and the stored LLMO entitlement therefore always read200, even for a 1000-prompt offer. This change unblocks the fulfillment-worker sourcing the real contracted cap from the UPP event (companion PR).3. High-level overview of the changes
createEntitlement(tier)→createEntitlement(tier, quotaOverrides = {}).llmo_trial_prompts) wins.llmo_trial_prompts_consumedis pinned to0after the merge — a brand-new entitlement has consumed nothing, so it is never caller-overridable.quotaOverridesis ignored (defends the shared-library boundary).tier→ default{}→ byte-for-byte identical behavior.4. Required information
7. Test plan
llmo_trial_prompts_consumednot overridable; a non-object override ignored; the existing-entitlement path ignores overrides. Ran the package unit tests + lint locally.8. Deployment & merge order
@adobe/spacecat-shared-tier-clientminor (1.7.0).spacecat-fulfillment-workerPR https://github.com/adobe/spacecat-fulfillment-worker/pull/657 (which pins1.7.0) pass CI / deploy. Order: this PR → release → worker PR feat: tracing fetch timeout #657.🤖 Generated with Claude Code