fix: the turn that compacts the chat still sends the whole history (#33916)

When a chat crossed the Context Compaction Threshold, the turn that made the summary still sent the model every earlier message with the summary on top, so that request was larger than without compaction and a chat already over the model's context window kept failing. Now that turn sends the summary and only the recent messages, as 0.13.0 did.

Fixes #33915
This commit is contained in:
Classic298 authored and GitHub committed 2026-11-08 19:40:28 +09:00
1 parent 97ca2144be
commit d62199572b
1 file changed
+1 -1
+1 -1
View File
@@ -36,7 +36,7 @@ async def get_tool_permissions_auto_config():
def set_tool_approval_prompt(messages, policy=None):
messages = [dict(message) for message in messages]
messages = [dict(message) if message.get('role') in {'system', 'developer'} else message for message in messages]
for message in messages:
if message.get('role') not in {'system', 'developer'}:
continue