镜牢决策补强: 确认重试回退、快感合成闸门与英文 OCR 别名
- aalc_engine: window_move 下按压保持 0.5s, 避免 Unity 漏点 - jev_mirror_agent: 技能描述抖动时 Enter 未推进改点已核对按钮并限制连续重试; 结果页指纹忽略剧情与时钟变化; 追加的苦难不再误判为单个饰品场景; 第 3 层起离开商店前强制做一次有界快感合成检查 - lc_scene_aliases: 补 Mounting Trials / Acquire E.G.O Gift 等标签, 识别拆分的 Win/Bate 胜率按钮与 Max HP / Defense Level 文本 - tests: 覆盖上述回归点
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
"""Controller lifecycle and battle regressions using mocked MCP only."""
|
"""Controller lifecycle and battle regressions using mocked MCP only."""
|
||||||
import contextlib
|
import contextlib
|
||||||
|
import copy
|
||||||
import ctypes
|
import ctypes
|
||||||
import io
|
import io
|
||||||
import json
|
import json
|
||||||
@@ -154,6 +155,21 @@ class AgentRuntimeTest(unittest.TestCase):
|
|||||||
self.assertTrue(result['stopped'])
|
self.assertTrue(result['stopped'])
|
||||||
bridge.call.assert_not_called()
|
bridge.call.assert_not_called()
|
||||||
|
|
||||||
|
def test_changing_modal_ocr_still_falls_back_from_enter_and_bounds_retries(self):
|
||||||
|
bridge = mock.Mock()
|
||||||
|
frames = iter(['skill description A', 'skill description B', 'skill description C', 'skill description D'])
|
||||||
|
bridge.call.side_effect = lambda tool, args=None: (
|
||||||
|
{'ok': True, 'items': [{'text': next(frames), 'score': 1}]} if tool == 'get_state' else {'ok': True})
|
||||||
|
options = {'wait': {'action': {'tool': 'wait', 'args': {}}, 'description': 'wait'},
|
||||||
|
'requires_analysis': {'action': {'tool': 'requires_analysis', 'args': {}}, 'description': 'analysis'},
|
||||||
|
'buy_swap': {'description': 'validated skill payment',
|
||||||
|
'action': {'tool': 'keypress', 'args': {'key': 'enter'}},
|
||||||
|
'fallback_action': {'tool': 'click', 'args': {'x': 790, 'y': 548}}}}
|
||||||
|
with mock.patch.object(agent, 'candidates', side_effect=lambda *args: copy.deepcopy(options)):
|
||||||
|
self.run_agent(bridge, extra_args=('--steps', '4'))
|
||||||
|
inputs = [call.args[0] for call in bridge.call.call_args_list if call.args[0] != 'get_state']
|
||||||
|
self.assertEqual(inputs, ['keypress', 'click', 'click'])
|
||||||
|
|
||||||
def test_close_error_still_releases_controller_mutex(self):
|
def test_close_error_still_releases_controller_mutex(self):
|
||||||
bridge = mock.Mock()
|
bridge = mock.Mock()
|
||||||
bridge.call.return_value = {'ok': True, 'items': []}
|
bridge.call.return_value = {'ok': True, 'items': []}
|
||||||
|
|||||||
Reference in New Issue
Block a user