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.

6.8 KB
Raw Blame

title: "ADR-0025: Mission-Scoped Worker Tool Broker" slug: adr-0025-mission-scoped-worker-tool-broker diataxis: adr status: active owner: project-maintainers last_reviewed: 2026-07-15 phase: 6 audience: developer

ADR-0025 — Mission-Scoped Worker Tool Broker

Status: Accepted (2026-07-13) Phase: 6 — Self-Healing Dodaios-Agents Orchestrator Reference: ADR-0009, ADR-0011, AP-3, AP-5, AP-14, AP-21, AP-22

Context

Mission workers run in isolated processes and worktrees. That isolation kept the supervisor's connected Marketplace, MCP, and app-command tools out of the worker capability surface. A tool could therefore be healthy and callable in the main Dodaios while a delegated mission honestly reported that it was not available. Directly copying connector configurations into every worker was not acceptable: it exposed credentials, worked only for selected CLI backends, and bypassed the supervisor's ToolExecutor safety path.

The production worker chain is provider-agnostic. Claude CLI, Codex CLI, Gemini CLI, Google CLI, and API workers need one capability contract that does not depend on a provider-specific MCP implementation.

Decision

Dodaios uses a process-local, mission-scoped worker tool broker. Each mission receives a short-lived authenticated grant containing only task-relevant MCP tools, connected native connector tools, and the restricted app commands carrying an explicit worker_allowed Command Registry marker. The initial action surface covers operational reads, provider health tests, mission/task inspection, and the complete guarded Wiki workflow: deterministic listing, recall search, vault-confined page reads, and curator-backed ingest. CLI workers reach the grant through a stdio MCP companion connected to a loopback-only HTTP endpoint; API workers call the same binding directly.

The supervisor retains the live tool objects and all credentials. Every broker request executes through the supervisor's ToolExecutor; workers never call Tool.execute() directly. An ask-tier request remains suspended on its original trace until an explicit approval or denial arrives. The pending call is exposed through mission REST and CLI actions without adding a global waiting mission state; approval resumes that exact call, while denial and timeout execute nothing.

The mission controller owns one broker grant per worker iteration and closes it as a bounded quiescence barrier before invoking the critic. The grant retains a credential-free terminal outcome for every supervisor call. Critic review is allowed only when no call remains active and every recorded call succeeded; denied, cancelled, timed-out, failed, or outcome-unknown calls force the existing worker-error mission path. A worker model therefore cannot ignore a tool error and claim successful completion.

The grant fails closed. Recursive mission tools, skill execution, credential surfaces, secret-reading names, dangerous commands, config mutation, live desktop/Computer-Use tools, host-shell tools, and Dodaios control-CLI adapters are never exported. Workers retain their own sandboxed worktree tools, but may control the running Dodaios only through the explicit broker grant. Both inventory construction and broker issuance validate the live Command Registry marker, so a forged inventory cannot promote a denied command. A missing supervisor reference, empty relevant tool set, expired token, or unsupported runtime produces no grant rather than a partially trusted one. Catalog descriptors are resolved from the live supervisor on each list and execute operation, and grant closure revokes the bearer and cancels active calls.

Consequences

  • Connected capabilities remain usable after delegation without copying OAuth tokens, API keys, or MCP environment blocks into a worker workspace.
  • All supported worker families consume the same broker contract; no provider name is treated as the capability boundary.
  • Risk-tier evaluation, audit events, plausibility checks, and approvals remain centralized in ToolExecutor.
  • A worker receives only the capabilities relevant to its mission, not the supervisor's complete tool catalog.
  • Consequential actions wait for an explicit user decision through the mission API/CLI (or an already-authorized scheduled-task decision); silence never becomes implicit approval.
  • A successful worker transcript is insufficient evidence when its broker completion certificate contains an unclean call; the critic is not invoked.
  • The supervisor now owns a small authenticated loopback server for the lifetime of active grants. Tokens are revoked on completion and bounded by a TTL as a crash backstop.

Alternatives considered

  • Pass original MCP configs to every worker: rejected because configs can contain credentials and support differs across provider CLIs.
  • Let workers invoke connector SDKs directly: rejected because it bypasses ToolExecutor, duplicates auth logic, and breaks the safety audit trail.
  • Expose every supervisor tool: rejected because it reintroduces recursive spawn paths, secret access, off-topic actions, and excessive model schemas.
  • Keep connected tools router-only: rejected because heavy missions that genuinely need a connected source would remain unable to fulfill the task.
  • Pin the feature to Claude CLI MCP support: rejected under AP-21/AP-22; capability transport must work across provider families.

Follow-up items

  • Keep provider-parity tests for every supported worker backend.
  • Keep an end-to-end stdio MCP test that proves list and execute behavior across the authenticated loopback boundary.
  • Keep the credential-free mission test covering grant selection, approval resume, completion certification, and revocation.
  • Preserve the explicit recursive-tool and secret/config deny guards.

Amendment (2026-07-25, ADR-0030 + ADR-0031)

Grant composition widened (mechanism unchanged): the native knowledge surface is now dynamic — the wiki triple plus gate-driven additions (awareness-recall behind [awareness].enabled, search_web, contact-lookup, and ultrawiki-search once its service gate goes live) — see ADR-0030. Ask-tier calls inside a grant can be pre-authorized per mission via [phase6.safety].auto_approve_tool_families — the gate is answered on the bus, never bypassed — see ADR-0031. The deny guards, the credential boundary, and the completion certificate are unchanged; observed refusals (denied/timed-out/errored calls) no longer abort the iteration, only integrity failures do (WorkerToolExecutionSummary.integrity_compromised).

Amendment: the UltraWiki grant is gone (2026-08-28)

The dynamic grant list above named ultrawiki-search "once its service gate goes live". That mode was removed on 2026-08-28, so the name is no longer part of any worker grant. The broker itself, the deny guards and the credential boundary are untouched.