fix(runtime): recover awake ownership and batch model failures

This commit is contained in:
chenmingxuan committed 2026-10-28 11:50:05 +08:00
1 parent 6b2c0f199d
commit baf069854b
17 files changed
+477 -32

No files matched your search

@@ -64,7 +64,10 @@ async def test_device_context_uses_adb_size_without_starting_ui_client():
@pytest.mark.asyncio
async def test_task_that_never_acquires_queue_does_not_create_trace_session():
async def test_task_that_never_acquires_queue_does_not_create_trace_session(tmp_path, monkeypatch):
from artemis.runtime import task_result
monkeypatch.setattr(task_result, "TRACES_PATH", tmp_path)
agent = Agent()
agent._initialized = True
agent._device_context = DeviceContext(
@@ -86,6 +89,13 @@ async def test_task_that_never_acquires_queue_does_not_create_trace_session():
await agent.run_task(goal="queued task", profile="flash")
agent._prepare_tracing.assert_not_called()
outcomes = list(tmp_path.glob("*/run_outcome.json"))
assert len(outcomes) == 1
import json
outcome = json.loads(outcomes[0].read_text(encoding="utf-8"))
assert outcome["code"] == "initialization_failed"
assert "queue cancelled" in outcome["error"]
@pytest.mark.asyncio