Skip to content

armgit / letta

Public Imported from GitHub
0

Platform for stateful agents: AI with advanced memory that can learn and self-improve over time.

fix: remove noisy warning from tool rule solver (#2003)

Sarah Woodersf80fb8472953
diff --git a/letta/helpers/tool_rule_solver.py b/letta/helpers/tool_rule_solver.py
index aafaa745b..4c50686c3 100644
--- a/letta/helpers/tool_rule_solver.py
+++ b/letta/helpers/tool_rule_solver.py
@@ -1,4 +1,3 @@
-import warnings
from typing import Dict, List, Optional, Set
from pydantic import BaseModel, Field
@@ -67,7 +66,7 @@ class ToolRulesSolver(BaseModel):
if error_on_empty:
raise RuntimeError(message)
else:
- warnings.warn(message)
+ # warnings.warn(message)
return []
def is_terminal_tool(self, tool_name: str) -> bool:
diff --git a/tests/test_tool_rule_solver.py b/tests/test_tool_rule_solver.py
index c570ab6d5..134781193 100644
--- a/tests/test_tool_rule_solver.py
+++ b/tests/test_tool_rule_solver.py
@@ -1,5 +1,3 @@
-import warnings
-
import pytest
from letta.helpers import ToolRulesSolver
@@ -62,13 +60,14 @@ def test_get_allowed_tool_names_no_matching_rule_warning():
# Action: Set last tool to an unrecognized tool and check warnings
solver.update_tool_usage(UNRECOGNIZED_TOOL)
- with warnings.catch_warnings(record=True) as w:
- allowed_tools = solver.get_allowed_tool_names()
+ # NOTE: removed for now since this warning is getting triggered on every LLM call
+ # with warnings.catch_warnings(record=True) as w:
+ # allowed_tools = solver.get_allowed_tool_names()
- # Assert: Expecting a warning and an empty list of allowed tools
- assert len(w) == 1, "Expected a warning for no matching rule"
- assert "resolved to no more possible tool calls" in str(w[-1].message)
- assert allowed_tools == [], "Should return an empty list if no matching rule"
+ # # Assert: Expecting a warning and an empty list of allowed tools
+ # assert len(w) == 1, "Expected a warning for no matching rule"
+ # assert "resolved to no more possible tool calls" in str(w[-1].message)
+ # assert allowed_tools == [], "Should return an empty list if no matching rule"
def test_get_allowed_tool_names_no_matching_rule_error():