YC (S26) | Open Computer History | Continuously record your company computer work, map your workflows, help you find work worth automating, and power your agents' context
Rust agentsagiaiai-memoryaudio-recordingcomputer-visionhermeshermes-agentllmlocal-ailocal-firstmachine-learningmcpmultimodalopenclawprivacyrewindscreen-recordingspeech-to-textycombinator
fix: allow free models (weight=0) even when daily quota exhausted
Louis Beaumontabb5e37cac93
diff --git a/packages/ai-gateway/src/services/usage-tracker.ts b/packages/ai-gateway/src/services/usage-tracker.tsindex 7946c3a98..82e97183f 100644--- a/packages/ai-gateway/src/services/usage-tracker.ts+++ b/packages/ai-gateway/src/services/usage-tracker.ts@@ -311,7 +311,8 @@ export async function trackUsage(dailyCount = weight;} else {// Check limit BEFORE incrementing — don't inflate counter on rejected requests- if (existing.daily_count >= limits.dailyQueries) {+ // Skip limit check for free models (weight=0) — they never count toward quota+ if (weight > 0 && existing.daily_count >= limits.dailyQueries) {// Daily free quota exhausted — try credit fallbackif (userId) {const credit = await tryDeductCredit(env, userId, 'ai_query');