Temporarily ignore DeepSeek upstream usage fields and prefer internal token estimation#244
Merged
CJackHwang merged 3 commits intodevfrom Apr 7, 2026
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d9e65c9710
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
CJackHwang
added a commit
that referenced
this pull request
Apr 7, 2026
Merge pull request #244 from CJackHwang/codex/temporarily-switch-to-internal-usage-count Temporarily ignore DeepSeek upstream usage fields and prefer internal token estimation
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.
Motivation
accumulated_token_usage/token_usage可能是累计上下文口径,会导致单次输出计数误差非常大,内部估计需要统一口径以避免计数异常。-方案是 完全不处理,通过改进算法依靠回归内部估计处理
Description
extractAccumulatedTokenUsage改为始终返回0,0,并删除/移除对上游解析辅助函数的依赖,以实现忽略上游 usage(internal/sse/parser.go)。{ prompt:0, output:0 }保持前后端解析口径一致(internal/js/chat-stream/sse_parse_impl.js)。internal/sse/line_test.go、internal/sse/parser_test.go、internal/sse/raw_stream_token_replay_test.go、internal/adapter/openai/stream_status_test.go、tests/node/chat-stream.test.js、tests/compat/expected/sse_content_filter_status.json等)。Testing
./scripts/lint.sh,结果通过(golangci-lint bootstrapped,0 issues)。./tests/scripts/check-refactor-line-gate.sh,结果通过。./tests/scripts/run-unit-all.sh,包含 Go 与 Node 测试,已修正断言后所有测试通过(Go 单元测试和 Node 兼容测试均通过)。npm run build --prefix webui成功构建 Web UI 产物。Codex Task