Meter every authenticated request and apply shared guest cooldowns - #62
Merged
Merged
Conversation
TeoSlayer
enabled auto-merge (squash)
September 17, 2026 19:34
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
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.
Authenticated requests currently use the per-minute free allowance before spending credits, so a successful Research request can leave the displayed balance unchanged. This change reserves 1 credit for Search, 2 for Answer, or 3 for Research before engine work, blocks insufficient balances, and refunds failed requests. Every account keeps its 1,000 free monthly credits.
Guests share a persistent cooldown of 30/60/90 minutes after Search/Answer/Research. Switching modes or aliases cannot bypass it. The website explains the cooldown and invites guests to sign in for 1,000 free credits each month.
OTP remains the primary login. Optional password login and OTP-authorized password enrollment use the same shared account; the gateway capability is enabled only after the companion auth service is deployed.
Validation: 26 browser-logic tests; race-tested first-request charging, concurrent spending, refunds, guest persistence/proxy handling, and shared password contracts; real MCP-to-gateway integration; Linux ARM64 build. Production rollout uses the dedicated community binary and leaves the running search engine in place.
Production verification at deployed source
b7792f0: Research debited 3 credits, Answer 2, Search 1, and MCP search 1. Guest Search succeeded and blocked both Answer and Research during the same 30-minute cooldown. Guest contributions returned 401. The live UI was inspected at 1440×900 and 390×844, including OTP/password switching, the free-credit sign-in offer, billing, monthly activity, and form padding. The engine process remained unchanged during the gateway switch. Temporary QA credentials were revoked after verification.