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(agentic-ide): recaps fall back to a connected coding subscription

Ruben Lütke7feb4a031170
diff --git a/jarvis/agentic_ide/recap.py b/jarvis/agentic_ide/recap.py
index a2049cad9f..38bc5d9c2a 100644
--- a/jarvis/agentic_ide/recap.py
+++ b/jarvis/agentic_ide/recap.py
@@ -93,6 +93,10 @@ _CHROME_FRAGMENTS = (
"accept edits on",
"bypassing permissions",
"plan mode on",
+ # The collapsed permission-mode footer ("auto mode on · 1 shell") carries
+ # none of the key hints above, so it needs its own entry — observed live as
+ # the headline of a busy pane.
+ "auto mode on",
)
diff --git a/jarvis/agentic_ide/recap_engine.py b/jarvis/agentic_ide/recap_engine.py
index 46398d752d..ffc93f3794 100644
--- a/jarvis/agentic_ide/recap_engine.py
+++ b/jarvis/agentic_ide/recap_engine.py
@@ -30,8 +30,9 @@ fallback rather than as the product:
paths end at the deterministic recap, which is exactly what the pane showed
before this module existed. A provider that fails at CALL time (a depleted
key's 429, a 402) first crosses to the next provider FAMILY in the resolver
- chain (AP-22) and only then falls back to the deterministic floor. Nothing
- here is load-bearing, and nothing here may raise into a state read.
+ chain (AP-22), then to a connected coding subscription (the CLI in the panes
+ is a credential too), and only then falls back to the deterministic floor.
+ Nothing here is load-bearing, and nothing here may raise into a state read.
Above the model sits one more layer, and it outranks both: **what the user
wrote themselves**. No summarizer can know that a pane is "the branch I'm about
@@ -99,9 +100,17 @@ INPUT_CHARS = 9_000
INPUT_HEAD_CHARS = 2_400
INPUT_TAIL_CHARS = INPUT_CHARS - INPUT_HEAD_CHARS
-#: How long one summary may take before the pane keeps its previous recap. A
-#: recap nobody is waiting for does not deserve a long leash.
-CALL_TIMEOUT_S = 30.0
+#: How long one summary may take before the pane keeps its previous recap.
+#: This bounds the WHOLE candidate walk, and the last candidate may be a
+#: subscription CLI that needs a process spawn and several seconds of thinking
+#: — 30 s was sized for API calls alone and would cut that path off exactly
+#: when it is the only one left.
+CALL_TIMEOUT_S = 45.0
+
+#: The slice of that budget one subscription CLI call may take. Below the
+#: outer cap on purpose: the CLI is only ever reached after the API families
+#: failed, and whatever they burned must still leave the CLI a real chance.
+SUBSCRIPTION_CLI_TIMEOUT_S = 35.0
#: How many provider FAMILIES a single summary may try before giving up. A
#: depleted key fails at call time, after instantiating fine — the next try
@@ -592,15 +601,39 @@ def _resolve_brains() -> list[Any]:
from jarvis.brain.resolver import frontier_brain_candidates
from jarvis.core.config import load_config
+ config = load_config()
candidates: list[Any] = []
- for brain in frontier_brain_candidates(load_config()):
+ for brain in frontier_brain_candidates(config):
candidates.append(brain)
if len(candidates) >= MAX_PROVIDER_TRIES:
break
- return candidates
except Exception as exc: # noqa: BLE001 - no brain is an answer, not an error
logger.info("Agentic IDE recap: no brain reachable ({})", exc)
return []
+ # Every family above needs an API key, and the install this feature broke
+ # on live had exactly one — depleted. A connected coding subscription is a
+ # credential too (§3), and often the STRONGEST model the user has: the very
+ # CLI running in the panes. It goes LAST because a CLI call costs a process
+ # spawn and seconds where an API call costs milliseconds — it should write
+ # the recap only when everything cheaper is dead.
+ if len(candidates) < MAX_PROVIDER_TRIES:
+ subscription = _resolve_subscription(config)
+ if subscription is not None:
+ candidates.append(subscription)
+ return candidates
+
+
+def _resolve_subscription(config: Any) -> Any | None:
+ """A connected subscription brain as the recap's last resort, or None."""
+ try:
+ from jarvis.brain.resolver import resolve_subscription_brain
+
+ return resolve_subscription_brain(
+ config, cli_timeout_s=SUBSCRIPTION_CLI_TIMEOUT_S
+ )
+ except Exception: # noqa: BLE001 - a broken CLI probe must not cost the recap
+ logger.info("Agentic IDE recap: subscription fallback unavailable", exc_info=True)
+ return None
def _bounded_rows(
diff --git a/tests/unit/agentic_ide/test_recap.py b/tests/unit/agentic_ide/test_recap.py
index 3d535ed261..9e3f72e9e9 100644
--- a/tests/unit/agentic_ide/test_recap.py
+++ b/tests/unit/agentic_ide/test_recap.py
@@ -97,6 +97,7 @@ def test_the_claude_code_footer_never_becomes_the_headline() -> None:
term.transcript.feed("Traced the stale process to yesterday\r\n")
term.transcript.feed("Tip: Use /btw to ask a quick side question\r\n")
term.transcript.feed("Personal Jarvis 🌿 main Opus 5 (1M context)\r\n")
+ term.transcript.feed("auto mode on · 1 shell\r\n")
assert summarize(term).headline == "Traced the stale process to yesterday"
diff --git a/tests/unit/agentic_ide/test_recap_engine.py b/tests/unit/agentic_ide/test_recap_engine.py
index 1ef3ee823d..63d860f57f 100644
--- a/tests/unit/agentic_ide/test_recap_engine.py
+++ b/tests/unit/agentic_ide/test_recap_engine.py
@@ -437,6 +437,37 @@ def test_a_depleted_key_failure_reads_as_a_sentence_not_json() -> None:
assert note.startswith("Its provider is out of credits or rate-limited.")
+def test_a_connected_subscription_is_the_last_candidate(monkeypatch) -> None:
+ """One depleted API key + a signed-in coding CLI must still produce recaps."""
+ from jarvis.brain import resolver
+
+ api = SimpleNamespace(model="depleted-api")
+ subscription = SimpleNamespace(model="coding-cli")
+ monkeypatch.setattr(resolver, "frontier_brain_candidates", lambda cfg: iter([api]))
+ monkeypatch.setattr(
+ resolver, "resolve_subscription_brain", lambda cfg, **kwargs: subscription
+ )
+ monkeypatch.setattr("jarvis.core.config.load_config", lambda: SimpleNamespace())
+
+ assert recap_engine._resolve_brains() == [api, subscription] # noqa: SLF001
+
+
+def test_a_full_api_chain_never_pays_for_the_cli_probe(monkeypatch) -> None:
+ """The subscription is a last resort, not a fourth opinion."""
+ from jarvis.brain import resolver
+
+ brains = [SimpleNamespace(model=f"api-{n}") for n in range(recap_engine.MAX_PROVIDER_TRIES)]
+ monkeypatch.setattr(resolver, "frontier_brain_candidates", lambda cfg: iter(brains))
+
+ def never(cfg, **kwargs): # noqa: ANN001, ANN202
+ raise AssertionError("the CLI probe must not run when the chain is full")
+
+ monkeypatch.setattr(resolver, "resolve_subscription_brain", never)
+ monkeypatch.setattr("jarvis.core.config.load_config", lambda: SimpleNamespace())
+
+ assert recap_engine._resolve_brains() == brains # noqa: SLF001
+
+
def test_a_failing_provider_leaves_the_previous_sentence_in_place() -> None:
"""A provider that raises costs the refresh, never the recap on screen."""