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.

chore: auto-save WIP via Claude stop-hook safety net (2026-07-07 17:11)

Ruben Lütkeb204e7bb235e
diff --git a/docs/superpowers/specs/2026-07-07-subagent-provider-health-design.md b/docs/superpowers/specs/2026-07-07-subagent-provider-health-design.md
index 91ef4aebe0..8ab4798836 100644
--- a/docs/superpowers/specs/2026-07-07-subagent-provider-health-design.md
+++ b/docs/superpowers/specs/2026-07-07-subagent-provider-health-design.md
@@ -53,7 +53,8 @@ New closed token set `MISSION_ERROR_CLASSES` (single source of truth in
`MissionFailed` (`jarvis/missions/events.py:122`) gains two OPTIONAL fields
(backward compatible — old stored events validate with defaults):
-- `error_detail: str | None` — the upstream error text, truncated (~200 chars).
+- `error_detail: str | None` — the upstream error text, truncated (300 chars,
+ the orchestrator's existing upstream-error cap).
- `failed_provider: str | None` — provider slug of the worker that failed
(`getattr(worker, "provider", None) or worker.cli`).
diff --git a/jarvis/ui/web/provider_routes.py b/jarvis/ui/web/provider_routes.py
index 8197cece8c..1c07fd5e9b 100644
--- a/jarvis/ui/web/provider_routes.py
+++ b/jarvis/ui/web/provider_routes.py
@@ -689,8 +689,9 @@ def _worker_flagged_dead(provider: str) -> bool:
return claude_in_quota_cooldown() or not _claude_cli_auth_viable()
if p in _CODEX_SUBAGENT_SLUGS or p in {"codex", "openai-codex"}:
from jarvis.codex_auth_state import codex_needs_reauth
+ from jarvis.codex_quota_state import codex_in_quota_cooldown
- return codex_needs_reauth()
+ return codex_needs_reauth() or codex_in_quota_cooldown()
except Exception: # noqa: BLE001
return False
return False
diff --git a/tests/unit/brain/test_section_health.py b/tests/unit/brain/test_section_health.py
index 76a782a219..33a64109a6 100644
--- a/tests/unit/brain/test_section_health.py
+++ b/tests/unit/brain/test_section_health.py
@@ -113,6 +113,26 @@ class TestSubagentSectionHealth:
assert health.reason == "degraded"
assert "codex" in health.detail
+ def test_usage_capped_codex_selected_is_degraded(self, monkeypatch) -> None:
+ """BUG-042 shape: selected provider codex, ChatGPT usage cap active —
+ the tab must NOT stay green while the factory skips codex."""
+ from jarvis.ui.web import provider_routes as pr
+
+ monkeypatch.setattr(pr, "_worker_usable", lambda p: True)
+ monkeypatch.setattr(
+ "jarvis.codex_auth_state.codex_needs_reauth", lambda: False
+ )
+ monkeypatch.setattr(
+ "jarvis.codex_quota_state.codex_in_quota_cooldown",
+ lambda **_k: True,
+ )
+ monkeypatch.setattr(
+ "jarvis.missions.init.reachable_worker_families", lambda: ["openrouter"]
+ )
+ health = pr._jarvis_agent_section_health(self._cfg(provider="codex"))
+ assert health.status == sh.NEEDS_SETUP
+ assert health.reason == "degraded"
+
def test_nothing_reachable_is_error(self, monkeypatch) -> None:
from jarvis.ui.web import provider_routes as pr