8000 feat(collector): book omp Antigravity usage per Google account and read live quota after a 429 by InfinityPacer · Pull Request #68 · InfinityPacer/meterleaf · GitHub
[go: up one dir, main page]

Skip to content

feat(collector): book omp Antigravity usage per Google account and read live quota after a 429 - #68

Merged
InfinityPacer merged 1 commit into
mainfrom
feat/omp-agy-accounts
Nov 3, 2026
Merged

InfinityPacer merged 1 commit into
mainfrom
feat/omp-agy-accounts

Conversation

@InfinityPacer
Copy link
Copy Markdown
Owner

问题

  1. omp 登录多个 Google 账号并在它们之间分摊请求时,采集器把 omp 的 Antigravity 用量一律记到状态栏的 current-account 上。用 agy 切换账号后,omp 的用量会整体记错账号。
  2. 额度只在发现新用量时刷新,且至少隔 5 分钟。额度用完后上游返回 429、不再产生用量,读数会一直停在用满前(例如显示 98%,实际已经 100%)。
  3. 刷新依赖 agy -p /usage,只能读到 agy 当前登录的那个账号。

改动

  • omp 请求按会话记录里的 credentialId 归属。采集器只读打开 omp 的 agent.db,只查编号和 identity_key(登录邮箱),不读令牌列,用邮箱本地部分得到与状态栏相同的标签。没有编号或查不到的编号仍退回 current-account。
  • 新增经 omp usage --json --provider=google-antigravity 的额度刷新,一次读回 omp 登录的所有 Google 账号,分别合并进各自的 quota-<label>.tsv,不改 current-account。omp 有新的 Antigravity 用量时最多每 5 分钟一次,用的是 omp 自己的几分钟缓存。
  • omp 记录里出现 Antigravity 的 429 响应时,先执行 omp usage invalidate 再读实时额度,最多每分钟一次,用满的读数因此及时上报。
  • agy -p /usage 只在 agy 自己的会话有新用量,或 omp 请求找不到账号时运行,omp 的日常用量不再拉起 agy。
  • 抽出共用的探测进程运行与日志去重逻辑。集成测试显式指向假的 omp,不再读到本机真实账号。
  • 更新 docs/collector.md 的 Antigravity 与 omp 段落,版本升到 0.16.1。

验证

  • bun run typecheck、bun run build 通过,bun test tests 619 项全过。新测试覆盖按编号分账、回退到活跃账号、429 只计数不入账、omp 多账号额度写入、平时读缓存与 429 后实时读取的两种间隔,以及 omp 返回不可用时保留原缓存。
  • 本机真实数据只读演练(状态库在内存、额度缓存写到临时目录、不推送),从 omp 账号库认出两个 Google 账号,11 月以来的 1669 条 Antigravity 请求按编号归到原账号,3 条 429 被识别。按 429 触发的实时读取约 5 秒完成,两个账号的四个额度窗口分别写入。

🤖 Generated with Claude Code

…ad live quota after a 429

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@InfinityPacer
InfinityPacer merged commit 7b28693 into main Nov 3, 2026
1 of 2 checks passed
@InfinityPacer
InfinityPacer deleted the feat/omp-agy-accounts branch November 3, 2026 10:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

0