A guided explanation is only useful in a language the reader reads, so the panel header gets a language picker alongside the model one, defaulting to the interface language. Like the model, it is request state rather than a setting: the language travels with the read and the generation, and the one a walkthrough was written in is stored with it, so reopening a review describes what is there instead of what a fresh one would be. Only prose is translated. Hunk aliases resolve back to hunk ids and icon/importance are validated against fixed English values, so a translated one would be dropped by the normalizer — silently losing an anchor or a style. Identifiers and paths stay as they appear in the code. The language is part of the cache key, and a read now asks the cache for the exact request it was given before falling back to the pointer. Without that the panel answered a request to switch languages with the text it already had, leaving the other language unused in the cache. Alongside it: - The answer budget is derived from the resolved model instead of a flat 24k. That number was the same for a 64k-context model and for one that admits to 384k output tokens, and on the latter it was the only reason generation failed: the model spent the whole allowance reasoning and returned nothing. It is now min(96k, max(24k, a quarter of the context)) capped by the catalog's output limit, decided once so the input reserve and the request cannot drift apart. - A read no longer offers Cancel. It is a few hundred milliseconds of git with nothing to cancel, and the button flickered on every model or language change. When the panel is showing a fallback, a banner names what is on screen versus what was asked for — only once the read has settled. - The header keeps one 32px control height and drops its labels below 680px instead of squeezing them to two letters and an ellipsis. Docs and module documentation updated in every locale.
72 lines
4.4 KiB
Plaintext
72 lines
4.4 KiB
Plaintext
---
|
|
title: 改动导读
|
|
description: 按讲得通的顺序读差异,而不是按字母顺序。
|
|
---
|
|
|
|
# 改动导读
|
|
|
|
差异按文件路径排序,而这几乎从来不是让改动讲得通的顺序。导读会重新编排:相关的修改被归入一个个**步骤**,每个步骤说明代码现在有什么不同的行为,步骤的先后顺序保证后一步建立在前一步之上。
|
|
|
|
它负责解释和排序,不评判你的代码,也不给结论——那是 [Review](/git/) 的职责。
|
|
|
|
从右侧栏的**导读**图标打开,或在改动面板和拉取请求面板中点击 **AI 导读**按钮。两者都只是打开面板;在你按下**生成导读**之前不会生成任何内容。
|
|
|
|
## 可以导读的范围
|
|
|
|
| 范围 | 包含内容 |
|
|
| --- | --- |
|
|
| 全部未提交 | 尚未进入提交的一切:已暂存、未暂存和新文件 |
|
|
| 已暂存 | 只包含此刻提交会带上的内容 |
|
|
| 未暂存 | 工作区和新文件 |
|
|
| 当前分支 | 该分支上基线分支所没有的全部提交 |
|
|
| 拉取请求 | GitHub 上现有形态的改动 |
|
|
|
|
**当前分支**不是“未推送的提交”,而是该分支相对基线新增的全部内容,无论是否推送。因此在提交之后、推送之前,它和拉取请求会有意不同:一个显示你做了什么,另一个显示评审者当前看到什么。
|
|
|
|
各个范围分别保存,来回切换不会丢失任何内容。
|
|
|
|
## 选择模型
|
|
|
|
导读默认使用你的小模型。可在**设置 → 会话 → 改动导读模型**中更换,或只为这一次在面板标题栏中选择——当改动的风险足以交给更强的模型时很有用。
|
|
|
|
选择列表只提供能返回结构化输出的模型,因为没有它就无法组装导读。如果模型对这份差异来说太小,生成会带着说明被拒绝,而不是悄悄截断输入:只看了半份差异写出的导读听起来笃定,实际却是错的。
|
|
|
|
重新打开面板时会显示生成当前内容的那个模型,所以只要你不更换,**重新生成**就会沿用它。
|
|
|
|
## 选择语言
|
|
|
|
导读默认使用你的界面语言书写。面板顶部的语言选择器从该语言开始,你也可以只为这一次导读改用 OpenChamber 已翻译的任意其他语言——讲解只有用你读起来轻松的语言才有价值。
|
|
|
|
只有叙述文字会被翻译。标识符、文件路径和 API 名称保持代码中的原样,因此每个停靠点提到的名字仍然可以直接搜索。
|
|
|
|
如果所选语言还没有生成过内容,面板不会清空:它会继续显示已有的导读并说明这一点。按 **生成导读** 即可得到新语言的版本。
|
|
|
|
## 开销与缓存
|
|
|
|
不会自行生成。生成只在你请求时开始,重新生成同样需要手动触发。
|
|
|
|
结果按差异的确切内容缓存。把工作区恢复到先前状态,当时的导读就会免费回来,不会调用模型。语言和模型都属于这个键的一部分,因此每种组合各自保存:一个差异一旦有了两种语言的导读,在它们之间切换就是即时且免费的。
|
|
|
|
生成运行在 OpenChamber 服务器上,而不是浏览器标签页里。刷新页面或关闭面板,工作仍在继续;回来时结果已在等你。只有**取消**能停止它。
|
|
|
|
## 对过时保持诚实
|
|
|
|
每个步骤都锚定在它所描述代码的确切内容上,因此面板能告诉你那段代码何时发生了变化:
|
|
|
|
- **过时的步骤**——步骤所描述的代码已改变或不存在。导读仍会显示并加以标记,由你决定是否重新生成。
|
|
- **未涵盖**——当前差异中没有任何步骤描述的改动。其中包括生成之后所做的修改、导读判定为常规的改动,以及锁文件等特意不送入模型的生成产物。它们都列在末尾,不会有内容悄无声息地消失。
|
|
|
|
重新生成不是打补丁,而是重写:上一版导读会作为上下文交给模型,仍然成立的部分得以保留,整体则重新锚定到当前代码。
|
|
|
|
## 说明
|
|
|
|
- 可以像在差异视图中一样对任意行发表评论,评论会附加到聊天输入框。
|
|
- 在桌面和平板宽度下可用。VS Code 扩展和移动应用中不提供。
|
|
- 导读拉取请求需要已连接的 GitHub 账户,参见 [GitHub Issue 与 PR](/github/)。
|
|
|
|
## 相关
|
|
|
|
- [Git 与 GitHub](/git/)——它读取的改动面板,以及确实会评判代码的 Review 操作
|
|
- [GitHub Issue 与 PR](/github/)——连接 GitHub 以导读拉取请求
|
|
- [提供方、模型与代理](/providers/)——小模型从何而来
|