fix: 修复每日用量独立采集#32
Open
kts-kris wants to merge 3 commits into
Open
Conversation
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.
变更说明
修复
Codex Daily Token Usage在未安装Codex Token Usage时独立采集不稳定的问题,并补齐 #31 样式修复后的市场元数据。主要变更:
Codex Daily Token Usage更新到1.4.5。Codex Token Usage外部数据源时,立即启用内置 standalone 采集器,不再等待 4 秒 grace period。codex-message-from-view事件也会进入 usage 采集链路,避免只捕获 Model 而漏掉 Token 用量。promptTokens、completionTokens、usedTokens、contextUsage和info包装层。index.json中的 version、updated_at 和 sha256。根因
之前的实现优先复用
Codex Token Usage的window.__codexTokenUsage.export().turns。但当用户没有安装该插件时,内置采集器存在两个缺口:codex-message-from-view事件只用于 Model 捕获,没有进入 usage 捕获链路。因此用户会感觉本插件必须依赖
Codex Token Usage才能正常统计。验证
jq empty work/CodexPlusPlusScriptMarket/index.jsonnode --check outputs/codex-daily-token-usage.jsnode --check work/CodexPlusPlusScriptMarket/scripts/codex-daily-token-usage.jsnode work/test-codex-daily-token-usage.jsCODEX_DAILY_TOKEN_USAGE_SCRIPT=work/CodexPlusPlusScriptMarket/scripts/codex-daily-token-usage.js node work/test-codex-daily-token-usage.jsindex.json一致:b565fe5a5728d52700d4d089d874a3f3e7f258a82fdea69762155ebbdf1c2c2f说明
Codex Token Usage现在仍然是可选复用源。安装后会优先复用它的采集结果;未安装或无法取得有效数据时,本插件会自动使用自身采集器。