[fix] Raise the free-credits per-key tpm cap to 1,000,000 - #6363
Conversation
Mirrors the proxy-side raise in agenta_cloud (upperbound + default mint bounds): the 200k tokens-per-minute per-key cap fired on ordinary large-context agent turns (12 refusals in 72h on EU cloud). Cloud reads the PostHog payload, which is raised separately after the proxy deploy; this keeps the no-PostHog development policy consistent. Claude-Session: https://claude.ai/code/session_014s6jqKCsVKsNMmnrJVJkZt
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
📝 WalkthroughSummary by CodeRabbit
WalkthroughThe development fallback policy raises ChangesDevelopment Policy Limit
Estimated code review effort: 1 (Trivial) | ~5 minutes Merge Risk: 🔵 Low · up to New starter-credit keys request a 1,000,000 TPM limit, but issuing them can fail with HTTP 400 if the proxy’s matching upper bound is not deployed first. The change is otherwise mergeable with explicit owner awareness of this deployment-order requirement. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository YAML (base), Organization UI (inherited)
Review profile: CHILL
Plan: Pro Plus
Run ID: a485f1ba-1db3-4bb4-abe9-74e38182c455
📒 Files selected for processing (3)
api/ee/src/core/starter_credits_bridge/service.pyapi/ee/src/core/starter_credits_bridge/types.pyapi/ee/tests/pytest/unit/test_starter_credits_bridge_seeding.py
Included review availability: Your plan provides up to 8 included reviews per hour; 6 remain after this review.
Context
The free-credits proxy refused 12 calls in 72 hours on EU cloud with "Rate limit exceeded ... Limit type: tokens. Current limit: 200000", including 4 in a row for one account. Every free-credits key is minted with a 200,000 tokens-per-minute cap, and a single Gemini Flash turn can carry close to its 1M-token context, so ordinary first-run use trips the cap. The user sees a failed run.
Changes
The per-key cap becomes 1,000,000 tokens per minute. The $5 key budget and the 30 requests-per-minute limit stay as the real bounds on spend and rate.
This PR carries the agenta side:
DEVELOPMENT_POLICY_VALUES(the policy a deployment without PostHog runs on) and the mint-path comment. The value lives in three more places, in a forced order:agenta_cloudhosting/docker-compose/litellm/config.yaml: the proxy's mint bounds (upperbound + default). Committed onfeat/litellm-proxy(99f417a3c); must deploy FIRST, because a PostHog payload above the proxy's upperbound fails every mint with HTTP 400.starter-credits-bridge-policy: raisekey_tpm_limitafter that deploy. Cloud reads only this./key/updatepass on the proxy admin route.Tests
ee/tests/pytest/unit/test_starter_credits_bridge_seeding.py: 72 passed. The development-policy assertion follows the new value; the fixtures that feed arbitrary payloads keep their own numbers.https://claude.ai/code/session_014s6jqKCsVKsNMmnrJVJkZt