feat: add plugin runtime and cross-device task orchestration
This commit is contained in:
1 parent
3ee4a5f7a8
commit
6663233ab8
82 files changed
+4147
-124
No files matched your search
@@ -183,7 +183,10 @@ async def run_task(request: RunRequest):
|
||||
# never be selected. Only a successful, non-empty enumeration may reject:
|
||||
# an indeterminate one (adb blip, startup) lets the submission queue and
|
||||
# fail downstream with a clear error instead.
|
||||
if request.device_serial:
|
||||
execution_target = (
|
||||
request.runtime_overrides.execution_target if request.runtime_overrides else "android"
|
||||
)
|
||||
if request.device_serial and execution_target != "computer":
|
||||
try:
|
||||
rejection = await device_pool.validate_explicit_serial_async(request.device_serial)
|
||||
except Exception:
|
||||
@@ -207,7 +210,11 @@ async def run_task(request: RunRequest):
|
||||
target_serial = (
|
||||
request.runtime_overrides.device_serial if request.runtime_overrides else None
|
||||
) or request.device_serial
|
||||
device_probe = await readiness_engine.run_device_submission_probe(target_serial=target_serial)
|
||||
device_probe = (
|
||||
await readiness_engine.run_device_submission_probe(target_serial=target_serial)
|
||||
if execution_target != "computer"
|
||||
else None
|
||||
)
|
||||
if device_probe and device_probe.summary in {"Device Locked", "Lock State Unknown"}:
|
||||
locked_serial = (
|
||||
device_probe.metadata.get("active_device", {}).get("serial") or target_serial or ""
|
||||
@@ -251,6 +258,8 @@ async def run_task(request: RunRequest):
|
||||
|
||||
from apps.admin_console.services.automation_service import register_submission
|
||||
|
||||
if response.get("status") == "error":
|
||||
raise HTTPException(400, response.get("message", "任务参数无效"))
|
||||
for item in response.get("tasks", []):
|
||||
register_submission(item)
|
||||
return response
|
||||
|
||||
Reference in new issue
Block a user