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(voice): always give the call the tools its rules name (#677)

Ruben Lütkea8d9c4e48e7e
diff --git a/jarvis/live/native.py b/jarvis/live/native.py
index fac50bcd45..7757669943 100644
--- a/jarvis/live/native.py
+++ b/jarvis/live/native.py
@@ -54,13 +54,18 @@ _SESSION_TOOLS = frozenset({
# or ``[voice].realtime_tool_declaration_budget_tokens``, the smaller wins), at
# most this many catalog tools are declared directly; every other tool stays
# reachable through discover_tools/call_tool. A small local model pays a full
-# LLM round per discovery step, so the frequent tools come first.
+# LLM round per discovery step, so the frequent tools come first. The tools the
+# conversation rules name by name (show_on_screen, ask_agent) stay direct: a
+# small model that does not see a named tool declares it missing instead of
+# discovering it.
_DIRECT_TOOL_LIMIT = 12
_DIRECT_TOOL_PREFERENCE = (
"workspace-orchestrate",
"find-app-action",
"run-app-action",
"search_web",
+ "show_on_screen",
+ "ask_agent",
"open_app",
"take_appshot",
"screen_snapshot",
diff --git a/jarvis/live/tools.py b/jarvis/live/tools.py
index ae9c6b4efc..1ea7a5f65b 100644
--- a/jarvis/live/tools.py
+++ b/jarvis/live/tools.py
@@ -57,8 +57,14 @@ _APPROVAL_LOCALES = ("de", "en", "es", "pt")
_RECENT_SEGMENTS = 4
_REQUEST_TEXT_CHARS = 1200
# Declared before every other tool so the size budget never drops them.
+# The conversation rules (``coordination.py``) name show_on_screen and
+# ask_agent: a model that is not given a tool it was told to use says it does
+# not exist (live 2026-10-14, a busy catalog sorted it past the budget).
_PRIORITY_TOOLS = frozenset(
- {"workspace-orchestrate", "workspace-git", "find-app-action", "run-app-action"}
+ {
+ "workspace-orchestrate", "workspace-git", "find-app-action", "run-app-action",
+ "show_on_screen", "ask_agent",
+ }
)
# Declared under its canonical name in every mode (see ``declarations``).
_DIRECT_TOOLS = frozenset({"computer", "take_appshot"})
@@ -269,7 +275,8 @@ class LiveTools:
"git state, the missions that have not ended, and the agent team. "
"needs_you names what is waiting for the user. Use it when the user asks "
"what is running, how far something is, what came out of it or who needs "
- "them. scope call returns only this call's tasks. Pass cancel with a "
+ "them. Leave scope out for that; scope call is only for a question about "
+ "this call's own tasks and leaves the rest out. Pass cancel with a "
"task_id only when the user asks to stop that task.",
{
"cancel": {"type": "string"},
diff --git a/tests/contract/test_gpt_live.py b/tests/contract/test_gpt_live.py
index 85704ec08f..dae8b25ccb 100644
--- a/tests/contract/test_gpt_live.py
+++ b/tests/contract/test_gpt_live.py
@@ -1131,23 +1131,30 @@ async def test_native_tool_search_ranks_instead_of_requiring_every_word(ledger):
assert [tool["name"] for tool in result["tools"]] == ["write-file"]
-def test_steering_tools_are_declared_before_the_size_budget_runs_out(ledger):
+# 900: the byte budget runs out first; 300: the declaration count does.
[email protected]("filler_size", [900, 300])
+def test_steering_tools_are_declared_before_the_size_budget_runs_out(ledger, filler_size):
class Crowded(Gateway):
def catalog(self):
filler = tuple(
SupervisorToolDescriptor(
- f"a-tool-{index:02d}", "x" * 900, {"type": "object"}, "safe"
+ f"a-tool-{index:02d}", "x" * filler_size, {"type": "object"}, "safe"
)
for index in range(60)
)
- steering = SupervisorToolDescriptor(
- "workspace-orchestrate", "Route coding tasks", {"type": "object"}, "monitor"
+ steering = tuple(
+ SupervisorToolDescriptor(name, "Steers the call", {"type": "object"}, "monitor")
+ for name in (
+ "workspace-orchestrate", "workspace-git", "show_on_screen", "ask_agent",
+ )
)
- return (*filler, steering)
+ return (*filler, *steering)
runtime = LiveTools(Crowded(), ledger, "s", language="en", backend_model="")
- declared = runtime.declarations()
- assert "workspace-orchestrate" in {runtime._names.get(d["name"]) for d in declared}
+ declared = {runtime._names.get(d["name"]) for d in runtime.declarations()}
+ # The conversation rules name these tools; a model that is not given a
+ # named tool tells the user it does not exist.
+ assert {"workspace-orchestrate", "workspace-git", "show_on_screen", "ask_agent"} <= declared
@pytest.mark.asyncio
diff --git a/tests/unit/live/test_native_live_fixes.py b/tests/unit/live/test_native_live_fixes.py
index 75eb1679ca..471478731f 100644
--- a/tests/unit/live/test_native_live_fixes.py
+++ b/tests/unit/live/test_native_live_fixes.py
@@ -576,6 +576,30 @@ async def test_declarations_respect_the_providers_budget(call, make_provider):
await live.session.end()
+@both_providers
+async def test_tools_the_rules_name_stay_direct_under_a_budget(call, make_provider):
+ named = tuple(
+ SupervisorToolDescriptor(
+ name,
+ f"Does {name}. " + "x" * 200,
+ {"type": "object", "properties": {"value": {"type": "string"}}},
+ "safe",
+ )
+ for name in ("show_on_screen", "ask_agent")
+ )
+ provider = make_provider()
+ live = call(provider, gateway=FakeToolGateway(catalog_of(30) + named))
+ await live.start()
+ try:
+ described = {
+ tool["description"].split(": ", 1)[0] for tool in provider.opened_with[0].tools
+ }
+ assert {"show_on_screen", "ask_agent"} <= described
+ finally:
+ await live.session.end()
+
+
@both_providers
@pytest.mark.asyncio
async def test_config_budget_bounds_a_provider_without_its_own(call, make_provider):