Skip to content

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.

fix(release): reconcile native security and retain fast login ownership

rubenluetke10-beepd01bd8f85ef4
diff --cc jarvis/codex_auth.py
index f0636d80a5,f0636d80a5..abfa5daa1b
--- a/jarvis/codex_auth.py
+++ b/jarvis/codex_auth.py
@@@ -609,7 -609,7 +609,9 @@@ class _GuardedCodexLoginProcess
deadline = time.monotonic() + timeout_s
while time.monotonic() < deadline:
status = cls._read_status(acknowledgement)
-- if status == "ready":
++ # A fast login may finish before this poll observes "ready". The
++ # guardian still owns the profile until our explicit release.
++ if status in {"ready", "finished"}:
return
if status == "busy":
raise RuntimeError(
diff --cc tests/unit/test_codex_auth.py
index 200c6e0d86,200c6e0d86..8c3a33d4e7
--- a/tests/unit/test_codex_auth.py
+++ b/tests/unit/test_codex_auth.py
@@@ -267,6 -267,6 +267,33 @@@ def test_start_login_raises_when_binary
svc.start_login()
[email protected]("owned_status", ["ready", "finished"])
++def test_guarded_login_handoff_accepts_owned_profile(
++ monkeypatch: pytest.MonkeyPatch,
++ tmp_path: Path,
++ owned_status: str,
++) -> None:
++ """A completed login still holds its lock while awaiting parent release."""
++ guardian = codex_auth_module._GuardedCodexLoginProcess
++ statuses = iter(["waiting", owned_status])
++ monkeypatch.setattr(guardian, "_read_status", lambda _path: next(statuses))
++ released: list[bool] = []
++
++ class RunningGuardian:
++ def poll(self) -> None:
++ return None
++
++ release = tmp_path / "release"
++ guardian.establish_handoff(
++ RunningGuardian(),
++ tmp_path / "ack",
++ release,
++ lambda: released.append(True),
++ )
++ assert released == [True]
++ assert release.read_text(encoding="utf-8") == "acquire"
++
++
def test_guarded_login_handoff_runs_real_guardian(
monkeypatch: pytest.MonkeyPatch,
tmp_path: Path,