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 src/agents/extensions/memory/advanced_sqlite_session.py
Original file line number Diff line number Diff line change
Expand Up @@ -815,7 +815,7 @@ def _copy_sync():
ms.tool_name
FROM message_structure ms
WHERE ms.session_id = ? AND ms.branch_id = ?
AND ms.branch_turn_number < ?
AND ms.branch_turn_number <= ?
ORDER BY ms.sequence_number
Comment on lines 815 to 819

Choose a reason for hiding this comment

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

P1 Badge Preserve exclusive copy semantics when branching

Switching the filter in _copy_messages_to_new_branch from < to <= now copies the messages belonging to from_turn_number into the new branch. However create_branch_from_turn() is documented (docstring at line 597: “copy messages before the branch point”) and covered by tests such as test_branch_specific_operations to copy turns strictly before the branch point, leaving the branch empty when branching from turn 1. With this change create_branch_from_turn(1) will copy the turn‑1 messages, so the tests that expect the branch to contain only the newly added items will fail and existing callers now get a different conversation history than promised by the API. Please keep the comparison exclusive or update the API docs/tests accordingly.

Useful? React with 👍 / 👎.

""",
(self.session_id, self._current_branch_id, from_turn_number),
Expand Down
Loading