Skip to content

The agent that grows with you

fix(compression): keep tool-schema tokens in the unanchored fallback estimate

Tekniumbe92703788bf
diff --git a/agent/conversation_loop.py b/agent/conversation_loop.py
index 438adf6647e..ec0ea0cace6 100644
--- a/agent/conversation_loop.py
+++ b/agent/conversation_loop.py
@@ -7671,7 +7671,9 @@ def run_conversation(
agent,
messages,
active_system_prompt or "",
- estimate_messages_tokens_rough(messages),
+ estimate_request_tokens_rough(
+ messages, tools=agent.tools or None
+ ),
)
if (