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): map composer 'none' onto the CLI's lowest effort

Harald7169802c3a60
diff --git a/jarvis/agentic_ide/prompt_blueprint.py b/jarvis/agentic_ide/prompt_blueprint.py
index 71ef3c51f6..326e6c004f 100644
--- a/jarvis/agentic_ide/prompt_blueprint.py
+++ b/jarvis/agentic_ide/prompt_blueprint.py
@@ -223,8 +223,8 @@ the agent should read the relevant files before answering and should not \
change anything.
- Be specific about what is actually being asked and what a useful answer \
would cover, so the agent does not return either a one-liner or an essay.
-- A question rarely needs `## Scope` or `## Done when`; omit them unless the \
-user set a real boundary.\
+- A question rarely needs `## Done when`; omit it unless the user set a \
+real boundary.\
""",
KIND_NEUTRAL: """\
The kind of work is not clearly determined. Stay with what the user said:
diff --git a/jarvis/core/events.py b/jarvis/core/events.py
index 6f35d3a1fa..6978c3925e 100644
--- a/jarvis/core/events.py
+++ b/jarvis/core/events.py
@@ -774,9 +774,9 @@ class AgenticIdePromptSent(Event):
class AgenticIdeComposeProgress(Event):
"""One beat of a task brief being written for one pane.
- Writing a brief is 10-30 s of real model work, and the typed prompt bar
- used to show a silent spinner for all of it — a working composer and a
- wedged one looked identical from the outside. The composer already
+ Writing a brief is a no-thinking rewrite (target 1-5 s), and the typed
+ prompt bar used to show a silent spinner for all of it — a working
+ composer and a wedged one looked identical from the outside. The composer already
narrates its progress (``jarvis.agentic_ide.prompt_composer``, the
``STAGE_*`` beats); this event carries each line to every client on the
app socket they already hold, the same route ``AgenticIdePromptSent``
diff --git a/jarvis/plugins/brain/claude_cli.py b/jarvis/plugins/brain/claude_cli.py
index ee57b71654..78de62b6d1 100644
--- a/jarvis/plugins/brain/claude_cli.py
+++ b/jarvis/plugins/brain/claude_cli.py
@@ -117,8 +117,11 @@ _FAST_STRUCTURED_ARGS: tuple[tuple[str, tuple[str, ...]], ...] = (
)
# ``BrainRequest.reasoning_effort`` values the CLI's ``--effort`` accepts
-# verbatim. "none" is deliberately absent: the CLI has no such level, and the
-# composer's documented floor is a modest effort, never zero.
+# verbatim. "none" is mapped to ``low`` at the call site — the CLI has no
+# off switch, and ``low`` is the cheapest thinking it will run (same as
+# ``antigravity._agy_effort``). The composer now asks for none; dropping
+# the flag would leave the CLI on its own default, which is the 10-30 s
+# wait this mapping exists to stop.
_EFFORT_LEVELS: frozenset[str] = frozenset({"low", "medium", "high"})
# The probed set of long options this install's CLI understands, filled once
@@ -291,10 +294,13 @@ class ClaudeCliBrain:
if flag in known:
argv += args
# The caller's reasoning_effort is a QUALITY decision it already
- # made (the composer documents "medium" as its floor). The CLI's
- # own default may think longer without writing a better brief, so
- # the choice is forwarded rather than dropped.
+ # made. "none" has no CLI spelling, so it becomes the lowest
+ # level the binary accepts; anything else in ``_EFFORT_LEVELS``
+ # is forwarded. Dropping the flag would leave the CLI on its
+ # own default, which thinks longer without writing a better brief.
effort = str(getattr(req, "reasoning_effort", "") or "").strip()
+ if effort == "none":
+ effort = "low"
if "--effort" in known and effort in _EFFORT_LEVELS:
argv += ["--effort", effort]
system = str(getattr(req, "system", "") or "").strip()
diff --git a/tests/unit/agentic_ide/test_composer_hedge.py b/tests/unit/agentic_ide/test_composer_hedge.py
index 71fcf5ecfb..ececde6681 100644
--- a/tests/unit/agentic_ide/test_composer_hedge.py
+++ b/tests/unit/agentic_ide/test_composer_hedge.py
@@ -362,6 +362,13 @@ async def test_the_hedge_respects_the_shared_budget(
# ---------------------------------------------------------------------------
+def test_the_api_first_boot_ceiling_is_eight_seconds() -> None:
+ """A no-thinking Flash brief is supposed to land inside 5 s. The old
+ 20 s first-boot ceiling let a hung writer sit four times the tolerance
+ before insurance started. Behaviour tests below still monkeypatch."""
+ assert prompt_composer.HEDGE_AFTER_API_S == 8.0
+
+
def test_without_history_the_ceilings_apply(monkeypatch: pytest.MonkeyPatch) -> None:
monkeypatch.setattr(prompt_composer, "HEDGE_AFTER_S", 30.0)
monkeypatch.setattr(prompt_composer, "HEDGE_AFTER_API_S", 20.0)
diff --git a/tests/unit/agentic_ide/test_prompt_blueprint.py b/tests/unit/agentic_ide/test_prompt_blueprint.py
index e6c7aae7f5..067cb99ceb 100644
--- a/tests/unit/agentic_ide/test_prompt_blueprint.py
+++ b/tests/unit/agentic_ide/test_prompt_blueprint.py
@@ -257,6 +257,8 @@ def test_the_target_length_sits_inside_the_hard_ceiling():
3000 budget — a model reads "under N" as "be brief".
"""
assert TARGET_MIN_CHARS < TARGET_MAX_CHARS < MAX_BODY_CHARS
+ assert TARGET_MAX_CHARS == 900
+ assert TARGET_MIN_CHARS == 280
@pytest.mark.parametrize("kind", _ALL_KINDS)
diff --git a/tests/unit/agentic_ide/test_prompt_composer.py b/tests/unit/agentic_ide/test_prompt_composer.py
index 2c814a8635..60b8ce0f07 100644
--- a/tests/unit/agentic_ide/test_prompt_composer.py
+++ b/tests/unit/agentic_ide/test_prompt_composer.py
@@ -284,6 +284,15 @@ async def test_the_writer_is_shown_an_outline_of_the_candidate_files(
assert "candidate_shape_ok" in seen["user"]
assert "Vosk keyword spotting." in seen["user"]
+ # House rules stay out: the receiving agent already has them. Re-loading
+ # the 1200-char dump would go green without this pin.
+ assert "HOUSE RULES" not in seen["user"]
+
+
+def test_the_outline_budget_stays_slim() -> None:
+ """Five files at 34 k was most of the input tokens on every call."""
+ assert prompt_composer._OUTLINE_FILES == 3 # noqa: SLF001
+ assert prompt_composer._OUTLINE_CHARS == 1800 # noqa: SLF001
async def test_no_quality_writer_degrades_openly(
diff --git a/tests/unit/core/test_brain_request_reasoning_effort.py b/tests/unit/core/test_brain_request_reasoning_effort.py
index 8b008aa632..9c258f18e6 100644
--- a/tests/unit/core/test_brain_request_reasoning_effort.py
+++ b/tests/unit/core/test_brain_request_reasoning_effort.py
@@ -1,9 +1,8 @@
"""The reasoning-effort field must admit the values callers actually pass.
-Found while wiring the Agentic IDE writer: the composer has been passing
-"medium" since it was written, into a field declared to accept only "none". It
-survives only because nothing validates it — the annotation is documentation
-that is wrong, and the next person to trust it writes a bug.
+The composer now passes ``none``; the work splitter still passes ``medium``.
+Both must stay in the annotation — an annotation that is wrong is worse
+than none, because the next caller trusts it.
"""
from __future__ import annotations
diff --git a/tests/unit/plugins/brain/test_claude_cli_brain.py b/tests/unit/plugins/brain/test_claude_cli_brain.py
index 35b7872d9f..53083957a5 100644
--- a/tests/unit/plugins/brain/test_claude_cli_brain.py
+++ b/tests/unit/plugins/brain/test_claude_cli_brain.py
@@ -153,8 +153,7 @@ def test_an_older_cli_never_sees_a_flag_it_would_die_on() -> None:
def test_the_callers_reasoning_effort_is_forwarded() -> None:
- """The composer documents "medium" as its quality floor; the CLI's own
- default may think longer without writing a better brief."""
+ """A graded effort is forwarded; an older CLI never sees the flag."""
from jarvis.core.protocols import BrainMessage, BrainRequest
req = BrainRequest(
@@ -166,11 +165,26 @@ def test_the_callers_reasoning_effort_is_forwarded() -> None:
brain = ClaudeCliBrain(structured_prompts=True)
argv, _prompt = brain.build_invocation(req, cli_flags=_FAST_FLAGS)
assert argv[argv.index("--effort") + 1] == "medium"
- # An unsupported CLI never sees it; "none" has no CLI level and stays home.
bare, _prompt = brain.build_invocation(req, cli_flags=frozenset())
assert "--effort" not in bare
+def test_none_maps_to_the_lowest_cli_effort() -> None:
+ """The composer asks for no thinking. The CLI has no off switch, so
+ ``low`` is the cheapest level it will run — same as Antigravity."""
+ from jarvis.core.protocols import BrainMessage, BrainRequest
+
+ req = BrainRequest(
+ messages=(BrainMessage(role="user", content="payload"),),
+ system="CONTRACT",
+ reasoning_effort="none",
+ stream=True,
+ )
+ brain = ClaudeCliBrain(structured_prompts=True)
+ argv, _prompt = brain.build_invocation(req, cli_flags=_FAST_FLAGS)
+ assert argv[argv.index("--effort") + 1] == "low"
+
+
def test_conversational_turns_keep_their_shape() -> None:
"""The lean set belongs to structured briefs; the voice path deliberately
keeps its read-only lookups and is not this change's to alter."""