fix(runtime): recover awake ownership and batch model failures
This commit is contained in:
1 parent
6b2c0f199d
commit
baf069854b
17 files changed
+477
-32
No files matched your search
@@ -584,6 +584,7 @@ class Agent:
|
||||
or getattr(getattr(task, "request", None), "task_name", None)
|
||||
)
|
||||
device_lock = None
|
||||
execution_started = False
|
||||
try:
|
||||
# Construct the runtime only inside the task's cleanup boundary. A
|
||||
# cancelled queue wait or setup failure must not leave version pins.
|
||||
@@ -761,6 +762,7 @@ class Agent:
|
||||
publish_startup_progress(
|
||||
"environment_ready", "Device environment is ready", session_id=str(sess_id)
|
||||
)
|
||||
execution_started = True
|
||||
try:
|
||||
if request.profile and request.profile.lower() == "flash":
|
||||
logger.info(f"[{task_name}] Invoking FlashRunner reactive loop...")
|
||||
@@ -972,7 +974,11 @@ class Agent:
|
||||
from artemis.runtime.task_result import save_failure_result
|
||||
|
||||
if sess_id:
|
||||
save_failure_result(str(sess_id), err)
|
||||
save_failure_result(
|
||||
str(sess_id),
|
||||
err,
|
||||
code="execution_failed" if execution_started else "initialization_failed",
|
||||
)
|
||||
if context.data_engine:
|
||||
context.data_engine.end_session("failed")
|
||||
|
||||
|
||||
Reference in new issue
Block a user