Skip to content

[测试请勿合并] 调整限定范围的会话读取 - #3

Closed
kzheart wants to merge 1 commit into
mainfrom
codex/review-bug-smoke
Closed

kzheart wants to merge 1 commit into
mainfrom
codex/review-bug-smoke

Conversation

@kzheart

@kzheart kzheart commented Oct 10, 2026 •

Copy link
Copy Markdown
Owner

实验结果

已完成 Codex 自动 PR 审查验证,此 PR 仅用于测试,关闭且不合并。

  • 中文审查规则已通过 docs(review): 添加 Codex 中文审查规则 #2 合并到 main。
  • 本 PR 仅修改 crates/ferry-engine/src/sessions/branch_point.rs 一行,将 truncate(point.end) 改为 truncate(point.end + 1),故意注入边界错误。
  • 未评论 @codex review;机器人记录的触发方式为 PR opened。
  • Codex 自动审查发现 1 个 P1 问题,中文标题为“将截断位置恢复为排他边界”,准确指出边界外历史会被读取,并引用现有测试与 AGENTS.md。
  • 查看 Codex 的中文审查意见。

本地验证

运行 cargo test --manifest-path crates/ferry-engine/Cargo.toml --locked --lib sessions::branch_point::tests -- --nocapture:

  • 注入前:4 个测试全部通过。
  • 注入后:3 个通过、1 个失败。
  • 失败测试:bounded_view_excludes_future_content_and_derived_metadata;期望 2 条消息,实际为 3 条。

主分支保留正确实现;测试错误仅存在于此临时分支。

此实验确认创建 PR 时的自动触发、中文问题反馈与该边界错误的识别能力。未验证现有 PR 每次 push 的重审触发,也不代表对所有 Bug 的检出率。

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 10, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-10T06:12:26.570699Z 4ed72f0 PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 4ed72f0752

ℹ️ 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".

if let Some(token) = token {
let point = BranchPoint::resolve(token, session)?;
session.messages.truncate(point.end);
session.messages.truncate(point.end + 1);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 将截断位置恢复为排他边界

当所选回答之后还存在消息时,point.end 已经是排他下标,传入 point.end + 1 会额外保留下一条消息(通常是后续用户请求),使带 --through 的分页读取和内容搜索泄露边界外历史;现有 bounded_view_excludes_future_content_and_derived_metadata 测试也明确期望选择首轮后仅保留 2 条消息。应继续按 point.end 截断。

AGENTS.md reference: AGENTS.md:L8-L9

Useful? React with 👍 / 👎.

@kzheart kzheart closed this Oct 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant