Conversation
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3c8197a9e5
ℹ️ 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".
| RolloutItem::EventMsg(EventMsg::ThreadRolledBack(rollback)) => { | ||
| let num_turns = usize::try_from(rollback.num_turns).unwrap_or(usize::MAX); | ||
| let new_len = fork_turn_positions.len().saturating_sub(num_turns); | ||
| fork_turn_positions.truncate(new_len); |
There was a problem hiding this comment.
Apply rollback to user turns, not all fork boundaries
ThreadRolledBackEvent.num_turns is defined as a count of user turns, but fork_turn_positions_in_rollout truncates a list that also contains trigger_turn assistant envelopes. In histories with trigger envelopes, a rollback can remove the wrong boundary, so truncate_rollout_to_last_n_fork_turns picks an incorrect keep_idx and forks stale/incorrect context.
Useful? React with 👍 / 👎.
Adds this: