Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion crates/ferry-engine/src/sessions/branch_point.rs
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ fn prefix_hash(session: &Session, end: usize) -> String {
pub fn restrict(session: &mut Session, token: Option<&str>) -> DomainResult<()> {
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 👍 / 👎.

session.children.clear();
session.agent_edges.clear();
session.context_compactions.clear();
Expand Down
Loading