Repository navigation
feat(usage): per-request token ledger and measured bucket capacity (2.5.0) - #74
Merged
Merged
Conversation
JoshRob297
force-pushed
the
feat/usage-ledger
branch
from
October 31, 2026 16:47
31eaeb4 to
fc0d000
Compare
….5.0) Google publishes no token allowance per bucket, so measure it: every streaming response appends one JSONL row with account, model and usageMetadata, every quota check appends its percentages, and pairing both yields tokens and calls per percentage point. Measured on Argon 2026-10-31: two 32k-token calls moved the bucket 1.01 points, two 15k-token calls moved it 0.00. Consumption is not linear in tokens, so the report shows TOKENS/1%, CALLS/1% and the MOVED ratio of windows, and labels the linear estimate as informational instead of asserting an allowance. Adds antigravity_usage tool and /antigravity-usage command.
JoshRob297
force-pushed
the
feat/usage-ledger
branch
from
October 31, 2026 16:49
fc0d000 to
8062a44
Compare
Automated verification
typechecktestsbuild |
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.
Responde a "cuanto ofrece Google por cuenta", que no tiene cifra oficial: lo mide.
Que hace
antigravity-usage.jsonlcon cuenta, modelo, variante y los conteos deusageMetadata(entrada, salida, razonamiento, lectura de cache). Append-only, sin prompts.antigravity-quotaagrega sus porcentajes aantigravity-quota-history.jsonl.TOKENS/1%,CALLS/1%y la proporcionMOVEDde ventanas donde el bucket realmente bajo.antigravity_usagey comando/antigravity-usage, condays(7 por defecto, tope 90).Lo que se midio (y por que el reporte no afirma una capacidad)
Argon, 2026-10-31, tres ventanas consecutivas:
Dos llamadas de 32k movieron 1.01 puntos; dos llamadas de 15k no movieron nada. El consumo no es proporcional a los tokens, asi que la estimacion lineal se publica como informativa y se muestra
MOVED 1/3para que la incertidumbre sea visible. Ese es exactamente el dato que no existe en ningun lado.Salida real:
Limites declarados
usageMetadataen SSE); una peticion sin streaming no se registra.usageMetadataes lo que el backend declara por respuesta; si no lo manda, no hay fila.Verificacion
npx tsc --noEmitlimpio.npx vitest run: 44 archivos, 1161 tests, 25 todo (+7 nuevos: clasificacion por familia, normalizacion de usage, IO del ledger, agregados, capacidad con caida real, ventana con reset cambiado sin trafico, formato del reporte).npm run buildydist/regenerado.