style: trim orphan toolcall comments
maintainer edit: keep the invariant comments in production code but remove repeated issue background from tests.
This commit is contained in:
@@ -182,11 +182,8 @@ def _save_skip_for_turn(
|
||||
"""Return the persisted-message append boundary for this turn."""
|
||||
if internal_continuation_inbound(message_metadata):
|
||||
return initial_message_count
|
||||
# ``build_messages`` merges the current message into the last history
|
||||
# entry when both share a role, so the prompt prefix is not always
|
||||
# ``2 + history_count``. Runner-appended messages always start at
|
||||
# ``initial_message_count``; only step back when the current message
|
||||
# exists as a standalone entry that was not persisted early.
|
||||
# build_messages may merge the current message into a same-role history tail.
|
||||
# Runner-appended messages start at initial_message_count in either shape.
|
||||
has_standalone_current = initial_message_count > 1 + history_count
|
||||
if has_standalone_current and not user_persisted_early:
|
||||
return initial_message_count - 1
|
||||
|
||||
Reference in New Issue
Block a user