fix: normalize Pro action targets and bound no-progress recovery
This commit is contained in:
1 parent
2ec563c079
commit
9d6833f092
7 files changed
+225
-20
No files matched your search
@@ -410,7 +410,7 @@ async def test_operator_node_multiple_actions():
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_operator_node_no_record_step():
|
||||
from artemis.agents.operator.operator import OperatorNode
|
||||
from artemis.agents.operator.operator import OperatorNode, OperatorNoProgressError
|
||||
from artemis.context import ArtemisContext
|
||||
from unittest.mock import AsyncMock, MagicMock, patch
|
||||
|
||||
@@ -437,13 +437,11 @@ async def test_operator_node_no_record_step():
|
||||
|
||||
with patch("artemis.agents.operator.operator.get_llm", return_value=mock_llm):
|
||||
node = OperatorNode(mock_ctx, transcript_config=LEGACY_TRANSCRIPT)
|
||||
node_update = await node(mock_state)
|
||||
with pytest.raises(OperatorNoProgressError):
|
||||
await node(mock_state)
|
||||
|
||||
mock_ctx.data_engine.record_step.assert_not_called()
|
||||
|
||||
update_dict = node_update
|
||||
assert "structured_decisions" in update_dict
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_operator_dynamic_prompt():
|
||||
@@ -472,7 +470,13 @@ async def test_operator_dynamic_prompt():
|
||||
|
||||
mock_llm = MagicMock()
|
||||
mock_response = MagicMock()
|
||||
mock_response.tool_calls = []
|
||||
mock_response.tool_calls = [
|
||||
{
|
||||
"name": "click",
|
||||
"args": {"target": [50, 50], "target_description": "button"},
|
||||
"id": "call_click",
|
||||
}
|
||||
]
|
||||
|
||||
async def mock_ainvoke(*args, **kwargs):
|
||||
messages = args[0]
|
||||
@@ -574,7 +578,13 @@ async def test_operator_history_compression():
|
||||
|
||||
mock_llm = MagicMock()
|
||||
mock_response = MagicMock()
|
||||
mock_response.tool_calls = []
|
||||
mock_response.tool_calls = [
|
||||
{
|
||||
"name": "click",
|
||||
"args": {"target": [50, 50], "target_description": "button"},
|
||||
"id": "call_click",
|
||||
}
|
||||
]
|
||||
|
||||
# Smarter file reading mock
|
||||
def mock_read_text(path_self, encoding=None):
|
||||
|
||||
Reference in new issue
Block a user