Repository navigation
feat(collector): split non-Claude models into their own accounts and track OpenCode Go for 0.11.0 - #45
Merged
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…o quota reads Co-Authored-By: Claude Opus 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.
问题
改动
src/collector/model-accounts.ts、src/collector/state.ts、src/collector/collect.ts、src/collector/config.ts)claude-开头的模型按登录时间线归属;其他模型默认归到「其他模型」账户。config.json新增可选modelAccounts,按模型名匹配式把用量映射到独立账户(例如deepseek-*→ OpenCode Go),换模型或加供应商只改配置。(sourceId, externalId)更新账户,历史上记错的用量随之改归。src/domain/pricing.ts、prices/meterleaf-2026-09-25.json)peak,按 UTC 星期和时段使用显式峰时费率;不能与longContext、imageRates同时配置。2026-09-25.5。src/server/opencode-go.ts、src/server/config.ts、src/server/snapshot.ts)METERLEAF_OPENCODE_GO_KEY(可选METERLEAF_OPENCODE_GO_ACCOUNT),只在有页面在线时读取 Go 用量接口,最多每 2 分钟一次;采集器不经手这把 Key。monthly快照;失败只记录状态码,不记录 Key。src/web/lib/quota-display.ts、src/web/App.tsx等):账户卡片和详情在周额度之后显示「月」窗口及其重置时间、周期费用与预估。docs/collector.md、docs/deployment.md、docs/pricing.md)、.env.example、compose.yaml与 CHANGELOG 已更新,版本升到 0.11.0。数据库结构未变。验证
bun run typecheck、bun test tests(488 通过)、bun run build、bun run build:collector、所改文件 Prettier 检查与git diff --check通过。bind-history不会把映射账户的用量改归;峰时起点包含与终点不包含、周末不加价、非法时段被拒、内置表能为 DeepSeek 记录计价;Go 用量换算三个窗口、只在页面在线且间隔已到时读取、失败计入间隔且日志不含 Key、读数未变时少写快照、月周期跨月末、配置默认账户;月额度显示顺序和周额度用尽时让位。main上的旧采集器推送真实历史并绑定账户,复现 DeepSeek 用量记在 Claude 账户下(342 条)。opencode-go,Claude 账户请求数相应减少,DeepSeek 显示金额。已知限制
🤖 Generated with Claude Code