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(missions): survive dead provider auth — expiry-aware Claude OAuth + cross-family worker rescue

Ruben Lütkee2b14f90f996
diff --git a/tests/missions/test_env_oauth_expiry.py b/tests/missions/test_env_oauth_expiry.py
index e7e38c2545..8a700f9c3b 100644
--- a/tests/missions/test_env_oauth_expiry.py
+++ b/tests/missions/test_env_oauth_expiry.py
@@ -22,11 +22,15 @@ import pytest
from jarvis.missions.isolation import env as env_mod
+# Test fixtures, not real credentials.
+_TEST_OAT = "sk-ant-oat01-test-token" # noqa: S105 — test fixture, not a real token
+_TEST_CLASSIC_KEY = "sk-ant-api03-classic-key" # noqa: S105 — test fixture
+
def _write_credentials(
tmp_path: Path,
*,
- token: str = "sk-ant-oat01-test-token",
+ token: str = _TEST_OAT,
expires_at_ms: float | None = None,
omit_expiry: bool = False,
) -> Path:
@@ -55,7 +59,7 @@ def test_valid_token_is_returned(
)
_pin_credentials_path(monkeypatch, creds)
token = env_mod.read_live_claude_oauth_token(now_fn=lambda: NOW_S)
- assert token == "sk-ant-oat01-test-token"
+ assert token == _TEST_OAT
assert env_mod.live_claude_oauth_status(now_fn=lambda: NOW_S) == "valid"
@@ -89,7 +93,7 @@ def test_missing_expiry_field_stays_fail_open(
creds = _write_credentials(tmp_path, omit_expiry=True)
_pin_credentials_path(monkeypatch, creds)
token = env_mod.read_live_claude_oauth_token(now_fn=lambda: NOW_S)
- assert token == "sk-ant-oat01-test-token"
+ assert token == _TEST_OAT
assert env_mod.live_claude_oauth_status(now_fn=lambda: NOW_S) == "valid"
@@ -106,7 +110,7 @@ def test_non_oat_token_reports_absent(
) -> None:
"""Only sk-ant-oat bearers count — anything else is not a live OAuth login."""
creds = _write_credentials(
- tmp_path, token="sk-ant-api03-classic-key",
+ tmp_path, token=_TEST_CLASSIC_KEY,
expires_at_ms=(NOW_S + 3600.0) * 1000.0,
)
_pin_credentials_path(monkeypatch, creds)
diff --git a/tests/missions/workers/test_claude_auth_fallback.py b/tests/missions/workers/test_claude_auth_fallback.py
index 81c63bd8c8..6691eb1a06 100644
--- a/tests/missions/workers/test_claude_auth_fallback.py
+++ b/tests/missions/workers/test_claude_auth_fallback.py
@@ -19,8 +19,9 @@ This is the exact mirror of the 2026-06-08 codex incident
"""
from __future__ import annotations
+from collections.abc import AsyncIterator
from pathlib import Path
-from typing import Any, AsyncIterator
+from typing import Any
import pytest
@@ -34,7 +35,6 @@ from jarvis.missions.workers.claude_direct_worker import (
from jarvis.missions.workers.provider_chain import _FallbackStep
from jarvis.missions.workers.stream_consumer import ClaudeResult
-
# The verbatim live failure text from missions 019f36e5 / 019f38b1.
_LIVE_401 = "Failed to authenticate. API Error: 401 Invalid authentication credentials"