feat(plugins): add source-aware evidence and recording timelines

This commit is contained in:
chenmingxuan committed 2026-10-16 10:20:11 +08:00
1 parent 72ff342605
commit ef7af9988e
61 files changed
+3847 -108

No files matched your search

@@ -586,6 +586,10 @@ class TaskQueueService:
env["ARTEMIS_TASK_INGRESS"] = str(task_item.get("ingress", "frontend"))
env["ARTEMIS_TASK_WORKER"] = "1"
overrides = task_item.get("runtime_overrides") or {}
if overrides.get("recording") is not None:
env["ARTEMIS_TASK_RECORDING_CONFIG"] = json.dumps(overrides["recording"])
else:
env.pop("ARTEMIS_TASK_RECORDING_CONFIG", None)
for option, variable in {
"model": "OPENAI_MODEL",
"reasoning_effort": "OPENAI_REASONING_EFFORT",
@@ -869,6 +873,10 @@ class TaskQueueService:
registered at recording start; remuxing that file is all that is
needed to publish the full video.
"""
from apps.admin_console.services.evidence_service import task_root
from artemis.plugins.recording import recover_interrupted_recordings
await recover_interrupted_recordings(task_root(str(sess_id)))
rec_info = session_repo.get_video_recording_for_session(sess_id)
rec_status = (rec_info or {}).get("status")
if rec_status == "ready":
@@ -1890,6 +1898,14 @@ class TaskQueueService:
recordings published.
"""
recovered = 0
from artemis.config import TRACES_PATH
from artemis.plugins.recording import recover_interrupted_recordings
# This hook runs in the startup worker thread, outside the server event loop.
for manifest in TRACES_PATH.glob("*/evidence/recordings/recordings.json"):
root = manifest.parent.parent.parent
if asyncio.run(recover_interrupted_recordings(root)):
recovered += 1
try:
pending = session_repo.get_unfinalized_video_recordings()
except Exception as exc: