p3: no Tavily daily cap for restricted callers

Restricted searches skip the cap check. Credits land on
tavily:restricted so they never raise the fleet row. Fleet at cap
still falls through.
This commit is contained in:
2026-09-23 16:27:07 -07:00
parent 1c57845ebd
commit e62cfc8660
3 changed files with 60 additions and 7 deletions
+4 -1
View File
@@ -241,7 +241,10 @@ Digest/question-embedding keys are partitioned the same way in P2.6.
**Daily cap** (paid vendors, currently Tavily): calendar UTC day, in-process counter
plus a `search_cap` row in SQLite so a restart does not reset it. Hitting the cap
skips that source for the rest of the day (`warnings: tavily: daily cap`) and does
not fail the search. Brave LLM Context gets a cap too if the key is billed; default
not fail the search. **`permit_restricted` callers skip the cap check.** Their
credits are stored on a separate row (`tavily:restricted`) so they never raise the
fleet row, and the fleet cap never throttles them. Per-caller `search_credits`
still counts both. Brave LLM Context gets a cap too if the key is billed; default
off until the bake-off shows a rate.
Logs: one INFO line `search caller=… q_len=… sources=… n=… cache=hit|miss rerank_ms=…`.