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.

feat(voice): show everything running for the user on one board (#635)

Ruben Lütkef4b3799eb245
diff --git a/docs/adr/0041-several-orders-at-once.md b/docs/adr/0041-several-orders-at-once.md
index b9c0f7cb55..7ed8ef5711 100644
--- a/docs/adr/0041-several-orders-at-once.md
+++ b/docs/adr/0041-several-orders-at-once.md
@@ -94,6 +94,13 @@ A stop word cancels every running background task. `task_status` lists the
tasks of the call with their request, state and a shortened result without
pictures, and stops one by id.
+The same call is the one board of everything running for the user. Besides this
+call's tasks it reads every open coding agent with its workspace's git state, the
+missions that have not ended and the agent team, each through the gated tool the
+model could call itself, and names what is waiting for the user in `needs_you`.
+A source the install does not have is left out; one that fails says so in its own
+section. `scope: call` returns only this call's tasks.
+
### 4. Chat: a turn that only waits hands its seat to the next message
On Dodaios' own chat (surface `jarvis`), a turn whose model work is done and
diff --git a/docs/commands-reference.md b/docs/commands-reference.md
index 4ec1984a0f..2547540cdd 100644
--- a/docs/commands-reference.md
+++ b/docs/commands-reference.md
@@ -343,10 +343,10 @@ Restart the Dodaios desktop app (voice + UI restart too).
## `missions-list` — List missions
-List Jarvis-Agent missions and their status.
+List Jarvis-Agent missions and their status, newest first. Set active to see only the ones that have not ended yet.
- **Endpoint:** `GET /api/missions`
-- **Arguments:** none
+- **Arguments:** `active` (boolean; optional); `limit` (integer; optional)
- **Requires confirmation:** no
- **Desktop UI section:** `agents`
- **Voice example (EN):** "show me the missions"
diff --git a/jarvis/commands/registry.py b/jarvis/commands/registry.py
index 6ca331ad8a..e4fbc0f8a2 100644
--- a/jarvis/commands/registry.py
+++ b/jarvis/commands/registry.py
@@ -1053,9 +1053,22 @@ def _build_registry() -> tuple[AppCommand, ...]:
AppCommand(
id="missions-list",
title="List missions",
- description="List Jarvis-Agent missions and their status.",
+ description=(
+ "List Jarvis-Agent missions and their status, newest first. Set active "
+ "to see only the ones that have not ended yet."
+ ),
method="GET",
path="/api/missions",
+ params={"type": "object", "properties": {
+ "active": {
+ "type": "boolean",
+ "description": "Only missions still pending, running or waiting.",
+ },
+ "limit": {
+ "type": "integer", "minimum": 1, "maximum": 100,
+ "description": "How many missions to return (default 100).",
+ },
+ }},
worker_allowed=True,
ui_section="agents",
voice_aliases={
diff --git a/jarvis/live/coordination.py b/jarvis/live/coordination.py
index 5c951b5f4a..f971b424be 100644
--- a/jarvis/live/coordination.py
+++ b/jarvis/live/coordination.py
@@ -11,10 +11,12 @@ from typing import Final
#: For the model that executes tools: progress, sync and branch questions.
WORK_STATUS_RULE: Final[str] = (
- "When the user asks how far the coding agents are, whether one is done, who "
- "is waiting for them, or which branch a workspace is on, call "
- "workspace-orchestrate status once: it covers every open agent and each "
- "workspace's git state. Say the takeaway in a sentence or two and name who "
+ "When the user asks what is running, how far things are, whether something is "
+ "done or who is waiting for them, call task_status once: it is one board of this "
+ "call's background tasks, every open coding agent with its workspace's git state, "
+ "the missions that have not ended and the agent team. For one workspace's agents "
+ "or its branch alone, workspace-orchestrate status with that workspace is enough. "
+ "Say the takeaway in a sentence or two and name who "
"needs the user; never read out lists, diffs or code. When the user wants to "
"hear when an agent they started themselves is done, call watch for it; a "
"task you sent is reported back on its own. "
diff --git a/jarvis/live/tasks.py b/jarvis/live/tasks.py
index 9ec36489e7..323f193ae2 100644
--- a/jarvis/live/tasks.py
+++ b/jarvis/live/tasks.py
@@ -147,6 +147,9 @@ class TaskBoard:
def running(self) -> list[BackgroundTask]:
return [task for task in self._tasks if task.running]
+ def waiting_for_approval(self) -> list[BackgroundTask]:
+ return [task for task in self._tasks if task.status == NEEDS_APPROVAL]
+
def snapshot(self) -> list[dict[str, Any]]:
return [task.describe() for task in self._tasks]
diff --git a/jarvis/live/tools.py b/jarvis/live/tools.py
index 5bd9a4b1fb..cc302bfade 100644
--- a/jarvis/live/tools.py
+++ b/jarvis/live/tools.py
@@ -71,6 +71,14 @@ _CONTROL_TOOLS = frozenset({"end_call"})
# After the user moves on, an action that is about to finish still answers its
# own call; only one that keeps running becomes a background task.
MOVE_ON_GRACE_S = 0.6
+# Where the user's other running work is read for the one board, by section:
+# the catalog tool that knows it and the arguments for its compact listing.
+_BOARD_SOURCES: tuple[tuple[str, str, dict], ...] = (
+ ("coding_agents", "workspace-orchestrate", {"action": "status"}),
+ ("missions", "missions-list", {"active": True, "limit": 20}),
+ ("team", "society_status", {"board": True}),
+)
+_BOARD_ERROR_CHARS = 200
_APPROVAL_NEXT_STEP = (
"Ask the user to approve this action. After an explicit yes, call confirm_action "
"directly (not through call_tool) with this approval_id. A yes is never a hang-up."
@@ -111,6 +119,28 @@ def function(name: str, description: str, properties: dict, required: list[str])
}
+def _board_section(section: str, output: Any) -> Any:
+ """One source's listing as the board shows it; None when it has another shape."""
+ if section == "coding_agents":
+ if not isinstance(output, dict) or output.get("status") != "ok":
+ return None
+ return {key: output[key] for key in ("counts", "needs_you", "workspaces") if key in output}
+ if section == "missions":
+ response = output.get("response") if isinstance(output, dict) else None
+ missions = response.get("missions") if isinstance(response, dict) else None
+ if not isinstance(missions, list):
+ return None
+ return [
+ {"mission_id": row.get("id"), "state": row.get("state"), "request": row.get("prompt")}
+ for row in missions
+ if isinstance(row, dict)
+ ]
+ if section == "team":
+ agents = output.get("agents") if isinstance(output, dict) else None
+ return agents if isinstance(agents, list) else None
+ return None
+
+
class LiveTools:
"""Single execution owner, including when both RTC and sideband see events.
@@ -231,11 +261,18 @@ class LiveTools:
),
function(
"task_status",
- "List this call's background tasks: actions that kept running while the "
- "user moved on, each with its request, state and result. Use it when the "
- "user asks how far something is or what came out of it. Pass cancel with a "
+ "One board of everything running for the user: this call's background "
+ "tasks (actions that kept running while the user moved on, each with its "
+ "request, state and result), every open coding agent with its workspace's "
+ "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 "
"task_id only when the user asks to stop that task.",
- {"cancel": {"type": "string"}},
+ {
+ "cancel": {"type": "string"},
+ "scope": {"type": "string", "enum": ["all", "call"]},
+ },
[],
),
]
@@ -452,10 +489,21 @@ class LiveTools:
if pending is not None and pending[3] == sys.maxsize:
self._pending[str(approval_id)] = (*pending[:3], self.revision)
- def _task_status(self, args: dict) -> dict:
+ async def _task_status(self, args: dict) -> dict:
wanted = str(args.get("cancel") or "").strip()
if not wanted:
- return {"success": True, "tasks": self.tasks.snapshot()}
+ board: dict = {"success": True, "tasks": self.tasks.snapshot()}
+ if str(args.get("scope") or "all") != "call":
+ board.update(await self._work_elsewhere())
+ needs_you = [
+ f"{task.task_id}: approval for {task.summary}"
+ for task in self.tasks.waiting_for_approval()
+ ]
+ agents = board.get("coding_agents")
+ if isinstance(agents, dict):
+ needs_you.extend(str(name) for name in agents.get("needs_you") or [])
+ board["needs_you"] = needs_you
+ return board
task = self.tasks.get(wanted)
if task is None or not self.tasks.cancel(task):
return {
@@ -472,6 +520,35 @@ class LiveTools:
"tasks": self.tasks.snapshot(),
}
+ async def _work_elsewhere(self) -> dict:
+ """The user's running work outside this call, one section per source.
+
+ Each section is read through the same gated tool the model could call
+ itself. A source that is missing from the catalog is left out; one
+ that fails says so instead of emptying the whole board.
+ """
+ available = {descriptor.name for descriptor in self.catalog()}
+ sources = [source for source in _BOARD_SOURCES if source[1] in available]
+ answers = await asyncio.gather(
+ *(self.gateway.execute(tool, dict(args), self._request(uuid4()))
+ for _section, tool, args in sources),
+ return_exceptions=True,
+ )
+ board: dict = {}
+ for (section, tool, _args), answer in zip(sources, answers, strict=True):
+ if isinstance(answer, asyncio.CancelledError):
+ raise answer
+ if isinstance(answer, BaseException):
+ log.warning("Live board: %s failed", tool, exc_info=answer)
+ board[section] = {"unavailable": "This part could not be read."}
+ continue
+ output = self._result(answer).get("output")
+ rows = _board_section(section, output) if answer.success else None
+ board[section] = rows if rows is not None else {
+ "unavailable": str(answer.error or output or "No answer.")[:_BOARD_ERROR_CHARS]
+ }
+ return board
+
def _task_settled(self, task: BackgroundTask, work: asyncio.Future) -> None:
if not work.cancelled() and work.exception() is not None:
log.warning(
@@ -641,7 +718,7 @@ class LiveTools:
offset = 0
return discover(self.catalog(), str(args.get("query", "")), offset)
if name == "task_status":
- return self._task_status(args)
+ return await self._task_status(args)
if name == "confirm_action":
approval_id = str(args.get("approval_id", ""))
if approval_id not in self._pending and len(self._pending) == 1:
diff --git a/jarvis/plugins/tool/delegate_to_agent.py b/jarvis/plugins/tool/delegate_to_agent.py
index df5b8d7ad8..c38c4961b6 100644
--- a/jarvis/plugins/tool/delegate_to_agent.py
+++ b/jarvis/plugins/tool/delegate_to_agent.py
@@ -384,6 +384,10 @@ async def _status_target(runtime: Any, target_key: str, lang: str) -> Any:
return await _unresolved(found, lang)
+# How much of an agent's newest note the team board repeats.
+_BOARD_NOTE_CHARS = 200
+
+
class SocietyStatusTool:
"""What an agent (or the whole team) is doing — read-only, no model call."""
@@ -393,7 +397,8 @@ class SocietyStatusTool:
"Answer 'what is <agent> doing?', 'is Scout done?', 'who is on the team?' from the "
"agent society's board. Read-only. Pass the agent's name, or nothing for the team. "
"Set details=true for responsibilities, capabilities, state and recorded activity/cost "
- "statistics (these are observations, not quality scores). Pass assignment_id "
+ "statistics (these are observations, not quality scores). Set board=true for one "
+ "short row per agent: working or idle, and its newest note. Pass assignment_id "
"to inspect that exact assignment; trace_id is optional. If prior tool ids are "
"no longer in context, use agent + latest_assignment=true to retrieve the newest "
"assignment you sent that agent from the stored board, including its task and "
@@ -405,6 +410,10 @@ class SocietyStatusTool:
"properties": {
"agent": {"type": "string", "description": "An agent's name; omit for the team."},
"details": {"type": "boolean", "description": "Include actual roster and evidence."},
+ "board": {
+ "type": "boolean",
+ "description": "One short row per agent: working or idle, and its newest note.",
+ },
"assignment_id": {"type": "string", "description": "Assignment event id."},
"trace_id": {"type": "string", "description": "Optional expected assignment trace."},
"latest_assignment": {
@@ -544,6 +553,29 @@ class SocietyStatusTool:
),
},
)
+ if args.get("board") is True:
+ rows = []
+ for agent in await runtime.roster.list():
+ if agent.agent_id == runtime.lead_id:
+ continue
+ running = runtime.scheduler.active_runs(agent.agent_id)
+ recent = await runtime.store.events_for_agent(agent.agent_id, limit=10)
+ note = next((e.text for e in reversed(recent) if e.text), "")
+ # What it was asked to do says more than "took the task".
+ task = next(
+ (e.text for e in reversed(recent) if e.msg_type is MsgType.ASSIGN and e.text),
+ "",
+ ) if running > 0 else ""
+ rows.append(
+ {
+ "agent": display_name(agent),
+ "state": "working" if running > 0 else "idle",
+ **({"runs": running} if running > 1 else {}),
+ **({"task": " ".join(task.split())[:_BOARD_NOTE_CHARS]} if task else {}),
+ **({"latest": " ".join(note.split())[:_BOARD_NOTE_CHARS]} if note else {}),
+ }
+ )
+ return ToolResult(success=True, output={"agents": rows})
if not target_key:
agents = await runtime.roster.list()
names = ", ".join(a.name for a in agents if a.agent_id != runtime.lead_id)
diff --git a/jarvis/ui/web/missions_routes.py b/jarvis/ui/web/missions_routes.py
index 022376e1f7..8f0ea1e7a9 100644
--- a/jarvis/ui/web/missions_routes.py
+++ b/jarvis/ui/web/missions_routes.py
@@ -161,17 +161,21 @@ async def list_missions(
request: Request,
state: str | None = None,
limit: int = 100,
+ active: bool = False,
) -> dict[str, Any]:
"""List of all missions, optionally filtered by state.
Query parameters:
- ``state``: comma-separated list of MissionState values (e.g. ``RUNNING,PENDING``).
- ``limit``: max number of entries (server cap 1000).
+ - ``active``: only missions that have not ended yet; ``state`` wins when both are given.
"""
mgr = _require_manager(request)
limit = max(1, min(int(limit), 1000))
state_filter: list[str] | None = None
+ if active and not state:
+ state_filter = sorted(s.value for s in MissionState if not is_terminal(s))
if state:
candidates = [s.strip() for s in state.split(",") if s.strip()]
unknown = [s for s in candidates if s not in _VALID_STATES]
diff --git a/tests/missions/api/test_missions_routes.py b/tests/missions/api/test_missions_routes.py
index fe777298e7..286397ce12 100644
--- a/tests/missions/api/test_missions_routes.py
+++ b/tests/missions/api/test_missions_routes.py
@@ -144,6 +144,20 @@ def test_list_state_filter_excludes_unmatched(
assert r2.json()["total"] == 0
+def test_list_active_leaves_out_missions_that_ended(app_with_manager: FastAPI) -> None:
+ with TestClient(app_with_manager) as client:
+ ended = client.post("/api/missions/dispatch", json={"prompt": "ended"}).json()
+ waiting = client.post("/api/missions/dispatch", json={"prompt": "waiting"}).json()
+ assert client.post(f"/api/missions/{ended['mission_id']}/cancel").status_code == 200
+
+ active = client.get("/api/missions?active=true").json()
+ assert [m["id"] for m in active["missions"]] == [waiting["mission_id"]]
+ assert client.get("/api/missions").json()["total"] == 2
+ # An explicit state wins over the shortcut.
+ both = client.get("/api/missions?active=true&state=CANCELLED").json()
+ assert [m["id"] for m in both["missions"]] == [ended["mission_id"]]
+
+
def test_list_rejects_unknown_state(app_with_manager: FastAPI) -> None:
with TestClient(app_with_manager) as client:
r = client.get("/api/missions?state=BOGUS")
diff --git a/tests/unit/live/test_work_board.py b/tests/unit/live/test_work_board.py
new file mode 100644
index 0000000000..e3eb3cdfc0
--- /dev/null
+++ b/tests/unit/live/test_work_board.py
@@ -0,0 +1,119 @@
+"""One board for everything running: call tasks, coding agents, missions, the team."""
+
+from __future__ import annotations
+
+import pytest
+
+from jarvis.core.protocols import SupervisorToolDescriptor, ToolResult
+from jarvis.live.state import LiveLedger
+from jarvis.live.tools import LiveTools
+from tests.fakes.fake_native_voice import FakeToolGateway
+
+_AGENTS = {
+ "status": "ok",
+ "counts": {"busy": 1, "needs_input": 1},
+ "needs_you": ["Alex (Installer)"],
+ "workspaces": [{"workspace": "Installer", "git": {"branch": "main"}, "agents": []}],
+ "note": "explains the words",
+}
+_MISSIONS = {
+ "command_id": "missions-list",
+ "summary": "List missions",
+ "response": {
+ "missions": [
+ {"id": "m-1", "prompt": "Build the report", "state": "RUNNING", "cost_usd": 0.0},
+ ],
+ "total": 1,
+ },
+}
+_TEAM = {"agents": [{"agent": "Scout", "state": "working", "task": "Find a VPS"}]}
+
+
+def _tool(name: str) -> SupervisorToolDescriptor:
+ return SupervisorToolDescriptor(name, f"{name}.", {"type": "object"}, "safe")
+
+
+def board(tmp_path):
+ def build(*names: str):
+ gateway = FakeToolGateway(tuple(_tool(name) for name in names))
+ gateway.results = {
+ "workspace-orchestrate": ToolResult(True, _AGENTS),
+ "missions-list": ToolResult(True, _MISSIONS),
+ "society_status": ToolResult(True, _TEAM),
+ }
+ ledger = LiveLedger(tmp_path / f"live-{len(ledgers)}.sqlite3")
+ ledgers.append(ledger)
+ return LiveTools(gateway, ledger, "call", language="en", backend_model=""), gateway
+
+ ledgers: list[LiveLedger] = []
+ yield build
+ for ledger in ledgers:
+ ledger.close()
+
+
+async def test_one_call_shows_every_kind_of_running_work(board):
+ tools, gateway = board("workspace-orchestrate", "missions-list", "society_status")
+ listed = await tools.execute("c1", "task_status", {}, tools.revision)
+ assert listed["success"] is True and listed["tasks"] == []
+ assert listed["coding_agents"]["counts"] == {"busy": 1, "needs_input": 1}
+ assert "note" not in listed["coding_agents"]
+ assert listed["missions"] == [
+ {"mission_id": "m-1", "state": "RUNNING", "request": "Build the report"}
+ ]
+ assert listed["team"] == _TEAM["agents"]
+ assert listed["needs_you"] == ["Alex (Installer)"]
+ assert sorted(gateway.calls) == [
+ ("missions-list", {"active": True, "limit": 20}),
+ ("society_status", {"board": True}),
+ ("workspace-orchestrate", {"action": "status"}),
+ ]
+
+
+async def test_a_source_the_install_does_not_have_is_left_out(board):
+ tools, gateway = board("workspace-orchestrate")
+ listed = await tools.execute("c1", "task_status", {}, tools.revision)
+ assert "coding_agents" in listed
+ assert "missions" not in listed and "team" not in listed
+ assert [name for name, _ in gateway.calls] == ["workspace-orchestrate"]
+
+
+async def test_a_failing_source_says_so_and_the_rest_still_answers(board):
+ tools, gateway = board("workspace-orchestrate", "missions-list", "society_status")
+ gateway.results["missions-list"] = ToolResult(False, None, error="HTTP 503: not started")
+ gateway.results["society_status"] = ToolResult(True, "Your agents: Scout.") # another shape
+
+ async def explode(name, arguments, request):
+ if name == "workspace-orchestrate":
+ raise RuntimeError("registry gone")
+ return await original(name, arguments, request)
+
+ original, gateway.execute = gateway.execute, explode
+ listed = await tools.execute("c1", "task_status", {}, tools.revision)
+ assert listed["success"] is True
+ assert listed["coding_agents"] == {"unavailable": "This part could not be read."}
+ assert listed["missions"] == {"unavailable": "HTTP 503: not started"}
+ assert listed["team"] == {"unavailable": "Your agents: Scout."}
+ assert listed["needs_you"] == []
+
+
+async def test_scope_call_reads_nothing_outside_this_call(board):
+ tools, gateway = board("workspace-orchestrate", "missions-list", "society_status")
+ listed = await tools.execute("c1", "task_status", {"scope": "call"}, tools.revision)
+ assert listed == {"success": True, "tasks": [], "needs_you": []}
+ assert gateway.calls == []
+
+
+async def test_the_board_is_a_read_and_is_declared_with_its_scope(board):
+ tools, _gateway = board("workspace-orchestrate")
+ assert tools._reads_only("task_status", {}) is True
+ assert tools._reads_only("task_status", {"scope": "call"}) is True
+ assert tools._reads_only("task_status", {"cancel": "task-1"}) is False
+ declared = next(d for d in tools.declarations() if d["name"] == "task_status")
+ assert declared["parameters"]["properties"]["scope"]["enum"] == ["all", "call"]
+ assert "coding agent" in declared["description"]
diff --git a/tests/unit/plugins/tool/test_delegate_to_agent.py b/tests/unit/plugins/tool/test_delegate_to_agent.py
index 45558edf1d..198f59c044 100644
--- a/tests/unit/plugins/tool/test_delegate_to_agent.py
+++ b/tests/unit/plugins/tool/test_delegate_to_agent.py
@@ -147,6 +147,20 @@ async def test_status_answers_from_the_board(runtime):
assert unknown.success is False
+async def test_status_board_gives_one_short_row_per_agent(runtime):
+ rt, _ = runtime
+ status = SocietyStatusTool(runtime_resolver=lambda: rt)
+ delegate = DelegateToAgentTool(runtime_resolver=lambda: rt)
+ await delegate.execute({"agent": "scout", "task": "Find the best VPS."}, _ctx("let scout"))
+ board = await status.execute({"board": True}, _ctx("what is everyone doing"))
+ assert board.success
+ rows = {row["agent"]: row for row in board.output["agents"]}
+ assert set(rows) == {"Archivist", "Scout"} # the lead is not a row of its own board
+ assert rows["Scout"]["state"] == "working" and "VPS" in rows["Scout"]["task"]
+ assert rows["Scout"]["latest"]
+ assert rows["Archivist"] == {"agent": "Archivist", "state": "idle"}
+
+
# --------------------------------------------------------------- the lead picks