Improve task resilience and LLM retry visibility

Persist and publish recoverable provider retries so temporary 503 and throttling events remain visible in live and historical task streams.

Aggregate repeated retries into an expandable action card, preserve terminal pause recovery, harden Windows worker isolation and output forwarding, and retain reliable Android hierarchy fallbacks with regression coverage.
This commit is contained in:
somew1nd committed 2026-08-20 00:37:53 -07:00
1 parent c1a4b49a21
commit 0f5fb1d32c
17 files changed
+946 -97

No files matched your search

+19 -13
View File
@@ -26,7 +26,7 @@ from artemis.utils.ocr_xml_fusion import (
_crop_image_remove_status_bar,
_map_coordinates_back,
)
from artemis.utils.ocr_api import perform_ocr
from artemis.utils.ocr_api import is_ocr_configured, perform_ocr
from artemis.utils.visualization import format_minimal_list_with_elements
@@ -77,19 +77,25 @@ async def mobile_get_device_state(view_type: str) -> str:
return f"file://{screenshot_path}"
elif view_type == "hierarchy":
try:
screen_height = device_data.height
status_bar_height = _detect_status_bar_height(xml_hierarchy, screen_height)
if status_bar_height > 0:
cropped_b64, _, _ = _crop_image_remove_status_bar(
latest_screenshot_b64, status_bar_height
ocr_results = []
if is_ocr_configured():
try:
screen_height = device_data.height
status_bar_height = _detect_status_bar_height(
xml_hierarchy, screen_height
)
raw_ocr_results = await perform_ocr(cropped_b64)
ocr_results = _map_coordinates_back(raw_ocr_results, status_bar_height)
else:
ocr_results = await perform_ocr(latest_screenshot_b64)
except Exception:
ocr_results = []
if status_bar_height > 0:
cropped_b64, _, _ = _crop_image_remove_status_bar(
latest_screenshot_b64, status_bar_height
)
raw_ocr_results = await perform_ocr(cropped_b64)
ocr_results = _map_coordinates_back(
raw_ocr_results, status_bar_height
)
else:
ocr_results = await perform_ocr(latest_screenshot_b64)
except Exception:
ocr_results = []
fused_xml = fuse_ocr_with_xml(xml_hierarchy, ocr_results)
hierarchy_text, elements, labels = format_minimal_list_with_elements(