fix: correct task scheduling and simplify agent internals

Fix queue cancellation, concurrency limits and worker status updates.

Use direct Explorer imports, split the Diagnoser loop into helpers and remove unused tool registration and prompt-builder code.

Correct model caching, endpoint selection and retry handling.
This commit is contained in:
somew1nd committed 2026-09-02 22:58:00 -07:00
1 parent 67248c887e
commit 12d7902a82
92 files changed
+1085 -1763

No files matched your search

@@ -112,7 +112,7 @@ async def test_enqueued_task_keeps_its_adb_endpoint_snapshot():
return_value=original,
),
patch(
"artemis.runtime.device_pool.device_pool.select_device",
"artemis.runtime.device_pool.device_pool.select_device_async",
return_value="emulator-5554",
),
):
@@ -230,7 +230,7 @@ async def test_queue_worker_execution_lifecycle():
patch("apps.admin_console.services.task_queue_service.session_repo") as mock_repo,
patch("apps.admin_console.services.task_queue_service.media_service"),
patch(
"artemis.runtime.device_pool.device_pool.select_device",
"artemis.runtime.device_pool.device_pool.select_device_async",
return_value="emulator-5554",
),
):
@@ -276,7 +276,7 @@ async def test_queue_worker_cmd_construction():
patch("apps.admin_console.services.task_queue_service.session_repo") as mock_repo,
patch("apps.admin_console.services.task_queue_service.media_service"),
patch(
"artemis.runtime.device_pool.device_pool.select_device",
"artemis.runtime.device_pool.device_pool.select_device_async",
return_value="emulator-5554",
),
):
@@ -594,7 +594,7 @@ async def test_cancel_task_triggers_next_pending_task():
patch("apps.admin_console.services.task_queue_service.session_repo") as mock_repo,
patch("apps.admin_console.services.task_queue_service.media_service"),
patch(
"artemis.runtime.device_pool.device_pool.select_device",
"artemis.runtime.device_pool.device_pool.select_device_async",
return_value="emulator-5554",
),
):
@@ -645,7 +645,7 @@ async def test_immediate_cancel_ignores_stale_ipc_and_runs_next_task():
patch("apps.admin_console.services.task_queue_service.session_repo") as mock_repo,
patch("apps.admin_console.services.task_queue_service.media_service"),
patch(
"artemis.runtime.device_pool.device_pool.select_device",
"artemis.runtime.device_pool.device_pool.select_device_async",
return_value="emulator-5554",
),
):