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(realtime): speak an unverified tool result as an attempt, not an outcome

rubenluetke10-beep43403e3c0bba
diff --git a/jarvis/realtime/tools.py b/jarvis/realtime/tools.py
index 07a105da83..fb2358ff82 100644
--- a/jarvis/realtime/tools.py
+++ b/jarvis/realtime/tools.py
@@ -131,16 +131,41 @@ def _json_safe(value: Any) -> Any:
return json.loads(json.dumps(value, ensure_ascii=False, default=str))
+#: Spoken-outcome contract for a tool that acted but could not check the
+#: effect (``output["verified"] is False``). The system prompt already forbids
+#: claiming an outcome no successful result supports; this makes the result
+#: itself say "attempt, not outcome", in the field the model reads for
+#: confirmation questions too. Live 2026-08-26 19:50: a blind media-key
+#: "play" came back ``ok: true`` and the voice said "I've just started some
+#: cool music on YouTube Music" while nothing played.
+_UNVERIFIED_OUTCOME_INSTRUCTION = (
+ "This result is an ATTEMPT, not a confirmed outcome: the tool acted but "
+ "could not verify that anything changed. Tell the user in one short "
+ "sentence what was tried and that you cannot confirm it from here; never "
+ "say it is done, playing, running, or started. Offer the next step in the "
+ "same breath instead of asking them to wait."
+)
+
+
+def _outcome_unverified(output: Any) -> bool:
+ """Whether a tool explicitly marked its own outcome as unchecked."""
+ return isinstance(output, dict) and output.get("verified") is False
+
+
def _bounded_result(success: bool, output: Any, error: str | None) -> dict[str, Any]:
- payload = {
+ payload: dict[str, Any] = {
"success": bool(success),
"output": _json_safe(output),
"error": str(error) if error else None,
}
+ unverified = success and _outcome_unverified(output)
+ if unverified:
+ payload["unverified"] = True
+ payload["instruction"] = _UNVERIFIED_OUTCOME_INSTRUCTION
serialized = json.dumps(payload, ensure_ascii=False, default=str)
if len(serialized) <= _MAX_RESULT_CHARS:
return payload
- return {
+ truncated: dict[str, Any] = {
"success": bool(success),
"output": serialized[:_MAX_RESULT_CHARS],
"error": (
@@ -149,6 +174,10 @@ def _bounded_result(success: bool, output: Any, error: str | None) -> dict[str,
),
"truncated": True,
}
+ if unverified:
+ truncated["unverified"] = True
+ truncated["instruction"] = _UNVERIFIED_OUTCOME_INSTRUCTION
+ return truncated
def _compact_text(text: str, limit: int) -> str:
@@ -570,6 +599,7 @@ class RealtimeToolBridge:
input_schema=schema,
risk_tier=risk_tier,
is_action_tool=bool(getattr(tool, "is_action_tool", False)),
+ yields_instructions_only=bool(getattr(tool, "yields_instructions_only", False)),
risk_tier_for_args=hook if callable(hook) else None,
describe_args=impact if callable(impact) else None,
)
@@ -637,6 +667,19 @@ class RealtimeToolBridge:
def declarations(self) -> tuple[dict[str, Any], ...]:
return self._declarations
+ @property
+ def instruction_only_tool_names(self) -> frozenset[str]:
+ """Tools whose success proves nothing was done (they return text).
+
+ The honesty guard subtracts these before asking whether the turn has
+ any execution evidence behind a completion claim.
+ """
+ return frozenset(
+ name
+ for name, descriptor in self._descriptors.items()
+ if getattr(descriptor, "yields_instructions_only", False)
+ )
+
@property
def dropped_names(self) -> tuple[str, ...]:
"""Catalog tools NOT declared natively under the declaration budget."""