Repository navigation
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 47ab7c3925
ℹ️ 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".
| projected | ||
| .blocks | ||
| .retain(|block| block.kind != BlockKind::Tool); | ||
| projected |
There was a problem hiding this comment.
checkpoint_messages 删除了全部 BlockKind::Tool,因此签发分支点后,只要会话的工具输入或结果被更新而文本块不变,BranchPoint::resolve 仍会接受旧 token。这样 --through 读取或原生 fork 会基于已变化的工具历史继续执行,违反 NATIVE-FORK.md 中“前缀被改写会拒绝”且边界包含工具调用及结果的契约;摘要应继续覆盖完整前缀。
AGENTS.md reference: AGENTS.md:L9-L9
Useful? React with 👍 / 👎.
| && last | ||
| .turn_complete | ||
| .unwrap_or_else(|| last.source_id.as_deref().is_some_and(|id| !id.is_empty())) |
There was a problem hiding this comment.
当 assistant 消息没有完成证据时,Pi、Claude 和 OpenCode reader 会留下 turn_complete = None,但仍通常设置非空 source_id;这里把这种消息判为已完成,会让活跃、截断或旧格式记录出现在 completed_turns 中,并允许 BranchPoint::issue 为不完整回答签发 fork 边界。原实现只接受 Some(true),而 NATIVE-FORK.md 也明确要求缺少原生完成证据时拒绝入口。
AGENTS.md reference: AGENTS.md:L9-L9
Useful? React with 👍 / 👎.
| first, | ||
| self.outputs, | ||
| self.through |
There was a problem hiding this comment.
当调用方用 inert=false 获取第一页、再携同该 next_cursor 以 inert=true 续读(或反向操作)时,这个摘要与原实现不同,未包含 self.inert,所以游标不会因读取参数变化而被拒绝。若游标位于经过 strip_text 改写的 block 分片中,同一字节偏移会被应用到不同的 JSON 编码,造成片段缺失、无法重组或意外的 cursor_invalid;应像 search_binding 一样绑定 inert。
AGENTS.md reference: AGENTS.md:L9-L9
Useful? React with 👍 / 👎.
| pub fn char_find(haystack: &str, needle: &str) -> Option<usize> { | ||
| haystack | ||
| .find(needle) | ||
| .map(|byte| haystack[..byte].encode_utf16().count()) |
There was a problem hiding this comment.
char_find 现在返回 UTF-16 code unit 数,而 TextWindow::around 和 char_slice 仍按 Rust char 下标切片;命中前存在非 BMP 字符时两个坐标系会分离。例如 300 个 emoji 后的命中会被报告为位置 600,窗口从第 360 个字符开始,直接把真实命中排除在 snippet 外;复用该函数的内容索引摘要同样受影响。这里应恢复按 .chars().count() 计算的位置。
AGENTS.md reference: AGENTS.md:L9-L9
Useful? React with 👍 / 👎.
会话读取模块同时承担参数校验、游标身份、元数据组装、消息分片和搜索摘要,分支点逻辑也重复遍历可见消息。此次拆分这些职责,集中维护读取视图和分页相关逻辑。
ContextOptions、SearchOptions与ReadScope,统一读取参数和游标绑定。SessionView,集中处理可见轮次、页面位置、检查点摘要及派生元数据。验证:会话模块 137 个测试、分页集成 3 个测试、
cargo clippy --all-targets -- -D warnings、cargo fmt --check、生成契约一致性检查均通过。