Repository navigation
feat(collector): read omp sessions and refresh Antigravity quota on demand - #67
Merged
Merged
Conversation
…emand Read omp (oh-my-pi) session files incrementally. Completed assistant messages become requests: opencode-go goes to the OpenCode Go account and google-antigravity joins the active Antigravity account. Requests are deduplicated by message id, time, channel, model and token counts, so moved files and branched sessions do not bill twice. When sync finds new Antigravity usage from agy or omp, run `agy -p /usage` at most once every 5 minutes, merge the four quota windows into quota-<label>.tsv (keeping the plan row) and upload them in the same round. scan never triggers the refresh. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
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.
问题
google-antigravity和 184 条opencode-go请求从未被采集。agy状态栏脚本不会执行,Antigravity 额度缓存一直停在上次交互使用时,目前靠 macos-workstation 里的 Stop hook 每 15 分钟补一次。结果
~/.omp/agent/sessions下的会话文件。只取已完成的助手消息,不读消息正文、标题和工作目录。opencode-go请求归入 OpenCode Go 账户,google-antigravity请求归入当前活跃的Antigravity (<label>)账户,Gemini 模型进 Gemini 池,其他模型进 Claude/GPT 池。sync发现新的 Antigravity 用量(agy 会话库或 omp)后,在同一轮运行agy -p /usage,最多每 5 分钟一次,失败也退避 5 分钟。结果合并写回quota-<label>.tsv(保留plan行和这次没刷到的窗口),新额度与新用量在同一批上传。scan仍然只读,不触发刷新。config.json增加可选的omp.enabled与omp.sessionsDir,channelAccounts.source增加omp,默认新增omp:opencode-go → OpenCode Go。版本升到 0.16.0。验证
bun run typecheck、bun run build、bun test tests全部通过(615 项)。新增测试覆盖解析与四桶、会话文件迁移与分支复制不重复、标题行原地改写不重复、缺账户暂缓后补录、节流与失败退避、保留plan行、临时文件不残留、超时终止。scan --json中 omp 读取 503、入账 503、无效 0,等于jq统计的 319 条google-antigravity加 184 条opencode-go。截止2026-10-31T13:00:00Z的数字与设计核实值 273 和 184 一致。Token 合计与jq汇总逐项相同。清掉读取进度整体重读,读取 503、新入账 0。agy -p /usage被调用,quota-tidewren.tsv被更新,plan行保留,current-account未变,新额度与用量进入同一批待发送队列;5 分钟内再次触发被跳过。验证用临时数据目录且服务地址指向不可达的回环端口,没有上传任何内容,没有动 NAS。说明
agy-quota-refreshStop hook 暂时保留,新版本发布并确认可用后再退役。两者同时存在只会多刷新几次额度。current-account为准,同时在 omp 里切换多个 Google 账号时无法区分。🤖 Generated with Claude Code