refactor(token): consolidate token packages#2
Open
mickey-228 wants to merge 1 commit into
Open
Conversation
mickey-228
pushed a commit
that referenced
this pull request
Apr 10, 2026
docs: fix prompt architecture drift
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.
变更内容
这个 PR 在不改变 token 功能行为的前提下,把分散的 token 相关代码整理到了统一目录下。
主要调整包括:
internal/token/tuiinternal/tokenusage下的 token 统计、存储、manager 等通用逻辑迁移到internal/token/usage调整原因
之前 token 相关代码一部分在
internal/tui,一部分在internal/tokenusage,同一个功能分散在多个目录里,查找和维护都不够直观。这次整理的目标是把同一类功能收拢到同一棵目录下,让代码结构更清晰,也方便后续继续迭代 token 相关能力。
影响范围
验证方式
已执行以下测试:
go test ./internal/token/tui ./internal/token/usage ./internal/tui ./internal/agent测试结果全部通过。