fix: preserve cross-device evidence and render recorded reports

This commit is contained in:
chenmingxuan committed 2026-10-17 16:05:58 +08:00
1 parent a66803651a
commit 1440a1f508
28 files changed
+759 -128

No files matched your search

+8 -6
View File
@@ -24,11 +24,10 @@ import socket
import sqlite3
import threading
import time
from typing import Any
from typing import TYPE_CHECKING, Any
from uuid import UUID, uuid4
from artemis.config import PAUSE_FILE, get_ipc_port_file, read_ipc_port, settings
from artemis.context import ArtemisContext
from artemis.data_engine.models import (
BackgroundTaskRecord,
FailedOutputRecord,
@@ -40,7 +39,7 @@ from artemis.data_engine.models import (
VideoRecordingRecord,
)
from artemis.data_engine.storage import StorageManager
from artemis.data_engine.trace import CURRENT_TRACE_ID
from artemis.data_engine.context_vars import CURRENT_TRACE_ID
from artemis.utils.coordinates import (
normalize_any_structure,
normalize_step_actions,
@@ -48,6 +47,9 @@ from artemis.utils.coordinates import (
from artemis.utils.logger import get_logger
from artemis.utils.text import safe_extract_text
if TYPE_CHECKING:
from artemis.context import ArtemisContext
logger = get_logger(__name__)
_CURRENT_DATA_ENGINE = None
@@ -392,7 +394,7 @@ def friendly_step(
class DataEngine:
"""Core engine for managing runtime data, storage, and streaming."""
def __init__(self, ctx: ArtemisContext):
def __init__(self, ctx: "ArtemisContext"):
self.ctx = ctx
# Determine paths from context
@@ -895,8 +897,8 @@ class DataEngine:
post_image_name = (
hashlib.sha256(post_screenshot_bytes).hexdigest() if post_screenshot_bytes else None
)
if pre_image_name and post_image_name and pre_image_name == post_image_name:
post_image_name = None
# Identical post-captures are evidence of an observed unchanged frame.
# The content-addressed image store already deduplicates their bytes.
# Persist the foreground app for the recall search surface (the
# parameter was historically accepted but never stored). The explicit