Fix compacted tool history for resumed sessions
This commit is contained in:
+2
-2
@@ -22,7 +22,7 @@ from typing import TYPE_CHECKING, Any
|
||||
|
||||
from .agent_context_usage import estimate_tokens
|
||||
from .agent_types import UsageStats
|
||||
from .agent_session import AgentMessage
|
||||
from .agent_session import AgentMessage, sanitize_model_message_sequence
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from .agent_runtime import LocalCodingAgent
|
||||
@@ -522,7 +522,7 @@ def compact_conversation(
|
||||
)
|
||||
|
||||
candidates = list(session.messages[prefix_count:compact_end])
|
||||
preserved_tail = list(session.messages[compact_end:])
|
||||
preserved_tail = sanitize_model_message_sequence(list(session.messages[compact_end:]))
|
||||
|
||||
if not candidates:
|
||||
return CompactionResult(
|
||||
|
||||
Reference in New Issue
Block a user