Repository navigation
feat(sidebar): 右侧栏默认增加上下文统计页 - #9
Merged
Merged
Conversation
官方 OpenCode 的上下文页现在作为文件、变更之外的第三个右侧标签。统计来自当前会话在最近一次压缩之后的助手用量,提供商和模型名走已有的模型目录。 Co-authored-by: xiufeigo <xiufeigo@users.noreply.github.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.
做了什么
右侧栏默认标签从「文件 / 变更」变成三个:文件、变更、上下文。上下文页对齐官方 OpenCode 侧栏里的会话用量(
packages/gui-extensions的 context tab),字段和口径跟截图里的「上下文查询」一致。词元总数取最近一次已完成压缩之后、撤销边界之前最后一条带
tokens的助手消息,输入 + 输出 + 推理 + 缓存读 + 缓存写。这和官方lastAssistantWithUsage相同,也和截图里的131,249 = 226 + 268 + 67 + 130,688 + 0对得上。已有本地布局(版本 1)会补上这一页,插在右侧「变更」后面。用户关掉之后按版本 2 记住,不会每次启动再加回来。
+菜单可以重新添加,也可以拖到下面板。没有改 Android 系统栏,也没有动版本号。
怎么验证
tokens:词元总数、输入/输出/推理、缓存读/写应一致;使用率是总数 / 该模型 context limit的四舍五入百分比。+菜单可以加回来。界面
桌面宽度下,右侧第三个标签就是上下文页。下面这张是连上会话数据后的样子(当时没有模型目录,所以提供商/模型显示的是 id,限制和使用率是「—」;目录加载后会换成显示名和百分比)。
右侧栏上下文标签
窄屏下同一页仍在右侧栏里,字段改成单列。
窄屏上下文页
To show artifacts inline, enable in settings.