Dodaios is an open-source agent OS for your desktop: it runs your coding agents, browser and apps by voice or chat, on your own machine. Formerly Personal Jarvis.
Python agent-orchestrationai-agentai-coding-assistantclaude-codecoding-agentcomputer-usedesktop-applocal-firstmcppersonal-jarvisvoice-assistantvoice-coding
test(agent-runtimes): wait for both ledger rows instead of one flush window (#507)
Ruben Lütkefbd48afa1f25
diff --git a/tests/unit/agent_runtimes/test_runtime_gateway.py b/tests/unit/agent_runtimes/test_runtime_gateway.pyindex f76a61f123..f6c362bfc9 100644--- a/tests/unit/agent_runtimes/test_runtime_gateway.py+++ b/tests/unit/agent_runtimes/test_runtime_gateway.py@@ -8,6 +8,7 @@ the guard does not know would be refused before any route ran.from __future__ import annotationsimport json+import timefrom collections.abc import AsyncIteratorfrom types import SimpleNamespacefrom typing import Any@@ -769,8 +770,15 @@ def test_every_gateway_call_lands_in_the_cost_ledger(monkeypatch, guarded, tmp_pgateway.register_model(token, "gpt-5.2", ModelLimits(400_000, 128_000))assert _chat(guarded, token, {**_CHAT, "stream": True}).status_code == 200assert _chat(guarded, token, _CHAT).status_code == 200- ledger.flush()- rows = list(ledger.read_usage(tmp_path / "llm_usage.db", 0, 2**62))+ # The ledger writes on its own thread; a loaded runner can need more+ # than one flush window before both rows are on disk.+ deadline = time.monotonic() + 15+ while True:+ ledger.flush()+ rows = list(ledger.read_usage(tmp_path / "llm_usage.db", 0, 2**62))+ if len(rows) >= 2 or time.monotonic() > deadline:+ break+ time.sleep(0.05)finally:ledger.set_ledger_path(None)gateway.reset()