Skip to content

Deferred agent coordinator expansion after Desktop paradigm lands #8652

Open

Description

@Git-on-my-level

Deferred agent coordinator expansion after Desktop paradigm lands

Summary

This issue tracks the deferred, non-macOS-Desktop work for Omi's agent coordinator: backend coordinator projections/future origin-authoritative run APIs, mobile unification, Agent VM runtime-node work, cloud directory/relay, hosted MCP coordinator tools, backend chat integration, cross-device artifacts, and model-assisted routing.

Hard prerequisite: do not start implementation of deferred coordinator semantics until the macOS Desktop coordinator slice has landed and proven the paradigm locally.

The Desktop slice must prove, in production-quality code, that Omi can coordinate agents through durable local state rather than chat memory or UI state:

  • local omi-agentd.sqlite3 coordinator migrations;
  • local context packet builder and context access audit;
  • local dispatch/approval/grant semantics;
  • derived Desktop action queue;
  • deterministic Ask Omi/task-chat routing;
  • artifact delivery and memory/task candidate flow;
  • UI surfaces as projections over canonical runtime state.

Research, architecture decisions, and child-issue drafting may happen before the Desktop gate. Deferred implementation should wait.

Philosophy / high-level architecture

Omi should feel like one coherent personal coordinator, but internally it should be a durable orchestration system.

Core principles:

  1. Durable state beats chat memory. If future agents/users need it, it cannot live only in a transcript.
  2. Coordinator coordinates; runtimes execute. The top-level Omi layer should route, resume, fork, dispatch, monitor, and deliver. It should not become a long-running worker.
  3. One proven paradigm first. Prove the model inside macOS Desktop before spreading it across backend/mobile/cloud. Otherwise we risk multiple incompatible coordinators.
  4. No second lifecycle authority. Session/run/attempt state must have one canonical authority per scope. UI, mobile, backend chat, and proxy layers should be projections or adapters, not hidden task systems.
  5. Context packets, not context dumps. Workers receive scoped, provenance-rich context packets with sensitivity/retention policy, not raw memory/chat/screen dumps.
  6. Action queue, not raw inventory. Omi should surface hard actions: blocked approvals, failed/orphaned runs, undelivered artifacts, stale work, and relevant resumable contexts.
  7. Membranes around personal data and egress. Screenshots, screen history, broad memory access, destructive writes, and external sends require explicit policy/approval.
  8. Evidence before completion. Runtime terminal state, artifacts, receipts, tests, health checks, or reviewer results should back claims of completion.
  9. Events first; polling as recovery. Lifecycle changes should produce durable events; heartbeats/reconciliation catch missed events and crashes.
  10. Cross-device/cloud is projection/placement first. Cloud/mobile/VM should not create a competing coordinator. They should observe, sync, place, or relay canonical runs after Desktop proves the shape.

The single most important expansion rule:

The local Desktop coordinator proves the semantics. Later runtimes may execute work, and cloud services may route or replicate work, but neither synchronization nor placement implicitly transfers canonical authority. Every such transfer must be explicit, fenced, auditable, and recoverable.

Authority and identity contract

The Desktop implementation establishes the first proven coordinator paradigm. Expansion must preserve its domain semantics without duplicating its local execution authority.

Canonical identities are distinct:

  • AgentSession: Omi execution/conversation identity.
  • AgentRun: one accepted objective or user turn.
  • RunAttempt: one concrete execution or retry.
  • AdapterBinding: opaque runtime-native continuity state.
  • AgentEvent: ordered lifecycle/evidence record.
  • AgentArtifact: versioned output or checkpoint.
  • AgentDelegation: parent/child work relationship.
  • Grant: policy-controlled capability authorization.

Task, workstream, backend chat, device, MCP transport-session, and adapter-native IDs are not interchangeable with these identifiers.

Authority invariants:

  1. Every canonical object has a known authoritative writer.
  2. Replication does not transfer execution authority.
  3. UI, mobile, hosted MCP, backend chat, and proxy layers cannot independently declare canonical run completion.
  4. Runtime-native IDs remain opaque adapter bindings.
  5. Continuations create new runs; execution retries create new attempts under the existing run.
  6. A cross-runtime transfer requires an explicit transition.
  7. Cloud availability is optional for local Desktop execution.
  8. Loss of network or heartbeat never proves completion.
  9. External physical effects require separately validated authority; a request ID alone is insufficient.
  10. The coordinator action queue remains a projection, not a second authoritative workflow store.

Before implementing backend persistence, reconcile the Desktop session contract with the canonical conversation journal, workstream mappings, and backend candidate/receipt contracts defined in the control-plane documentation. Do not duplicate local tables merely for schema symmetry.

Dependency: Desktop coordinator must land first

This issue is blocked until a Desktop issue/epic lands with at least:

  • omi-agentd.sqlite3 migrations for local coordinator state;
  • typed store/repository methods and migration tests;
  • artifact lifecycle events fixed in the local kernel;
  • DesktopContextPacket builder with access audit;
  • DesktopCoordinatorDispatch approval flow;
  • local grants owned by policy module;
  • derived action queue and “Agents & Attention” surface;
  • deterministic routing for Ask Omi and task chat;
  • local artifact delivery + memory/task candidates;
  • verification through Desktop runtime tests and automation harness.

Implementation gate

This parent backlog may collect research, architecture decisions, and child-issue drafts before Desktop lands. It does not authorize implementation of deferred coordinator semantics until the Desktop gate has been reviewed.

Gate evidence must include:

  • link to the merged Desktop coordinator implementation;
  • passing store, migration, replay, and reconciliation tests;
  • context minimization and sensitive-access policy tests;
  • working dispatch, approval, grant, and artifact flows;
  • deterministic Ask Omi/task-chat routing evidence;
  • evidence that UI and transport state cannot invent success;
  • documented authority/identity contract for expansion.

Desktop must not depend on any implementation in this issue. Pre-gate maintenance of existing backend/mobile/VM behavior remains permitted when it adds no new coordinator authority.

Deferred epics

1. Backend coordinator projection, routing, and future origin-authoritative run APIs

Backend currently has rich user data APIs and hosted MCP, but not a durable top-level agent run model.

Backend persistence must distinguish authoritative records from read-only projections and compatibility mappings.

Before introducing write APIs, specify:

  • origin runtime and authoritative writer;
  • canonical ID generation and namespace;
  • session/run/attempt relationship validation;
  • event origin, sequence, cursor, and replay semantics;
  • idempotency and conflict handling;
  • authorization derived from active owner/tenant context;
  • permitted state transitions and forwarding behavior.

An API must forward a command to the authoritative runtime or reject it if that runtime is unavailable. It must not silently create a second authoritative lifecycle.

Acceptance criteria:

  • backend run lifecycle is durable and inspectable without becoming a conflicting authority;
  • run events stream independently from chat messages;
  • cancellation/retry/approval are first-class commands to the authoritative runtime;
  • backend model can ingest/sync Desktop projections without owning Desktop-origin lifecycle.

2. Unified ToolDescriptor across Desktop/backend/MCP/VM

Existing tool definitions are fragmented across:

  • desktop/macos/agent/src/runtime/omi-tool-manifest.ts
  • ChatToolExecutor.swift
  • LocalAgentAPIServer.swift
  • backend/utils/retrieval/agentic.py / CORE_TOOLS
  • backend/routers/agent_tools.py
  • backend/routers/mcp_sse.py

Future work:

  • create one logical capability contract with surface-specific adapters and validation;
  • project to Desktop local manifest, backend native tool schemas, VM /v1/agent/tools, and hosted MCP;
  • include risk tier, source system, read/write/destructive, privacy tier, auth, approval requirement, and surface/runtime availability.

Acceptance criteria:

  • new capabilities register once logically;
  • projections are generated or validated from one descriptor contract;
  • coordinator routing can choose by capability and risk.

3. Shared Agent VM lifecycle service

Current VM lifecycle logic is duplicated in backend/agent-proxy/main.py and backend/routers/agent_tools.py.

Future work:

  • extract GCE/VM status/start/reset/health/firestore update into one shared service;
  • make proxy and REST helpers call the same service;
  • test stopped/running/unhealthy VM states.

4. Agent VM as runtime node

VM adapter/session IDs must not become product session IDs. VM execution must use canonical run and attempt correlation.

Future work:

  • runtime node registration;
  • capability reporting;
  • health/reachability;
  • owner/tenant-scoped leases;
  • compact status sync;
  • artifact/checkpoint metadata sync;
  • explicit failover by creating a new RunAttempt from checkpoint artifact.

Acceptance criteria:

  • coordinator can choose local daemon vs Agent VM by capability/health;
  • VM loss creates visible unavailable/orphaned/outcome-unknown state as appropriate;
  • VM re-placement requires a new RunAttempt and explicit checkpoint compatibility validation;
  • failover is visible and auditable, not invisible migration of live execution;
  • no silent retry duplicates external effects.

5. Replace proxy-side implicit context injection with explicit context packets

Current agent-proxy injects chat history into first prompt and persists proxy chat messages.

Acceptance criteria:

  • proxy relays authorized control-plane messages;
  • context packet creation happens before dispatch;
  • proxy no longer acts as partial session authority;
  • proxy prompt construction and Firestore message persistence are migrated separately;
  • chat persistence becomes an idempotent projection of canonical conversation/run activity, not a second source of authority.

6. Mobile app as coordinator surface

Mobile currently uses VM-agent chat without sharing Desktop's local runtime graph.

Future work:

  • mobile views/API support for active runs, run events, approvals/dispatches, artifacts, action queue, and resumable sessions;
  • canonical session/run/attempt references as compatible transport extensions;
  • mobile VM-agent messages map to canonical runs.

Acceptance criteria:

  • mobile does not invent separate session/run identity;
  • mobile can observe or submit continuation requests to the authoritative runtime;
  • connection loss does not imply failed or completed run;
  • reconnect attaches and replays by durable cursor;
  • retry uses canonical idempotency semantics;
  • mobile approvals/cancellations are scoped commands to the authoritative runtime, not local state transitions.

7. Cloud directory and relay

Future work:

  • runtime registration for Desktop daemon and Agent VM;
  • heartbeats/health/capability reporting;
  • owner/tenant scoping;
  • relay session/run to runtime-node routing;
  • writer leases with monotonic lease generations and fencing;
  • event/status relay;
  • explicit handoff/failover flow.

Acceptance criteria:

  • cloud directory does not mint canonical local IDs prematurely;
  • at most one fenced execution authority owns a non-terminal attempt, enforced at effect boundaries;
  • authoritative execution path rejects stale generations and revoked execution capabilities;
  • heartbeats establish reachability, not proof of termination;
  • during partitions, a new owner must not duplicate a prior external effect whose outcome is unknown;
  • explicit handoff records old attempt outcome, new attempt identity, checkpoint, authority transition, and audit evidence;
  • relay cannot mutate local kernel state outside the defined protocol.

8. Hosted MCP coordinator tools

Existing hosted MCP is user-data/tool access, not runtime coordination.

Future read-only tools:

  • list active runs;
  • get run status;
  • list pending approvals;
  • list artifacts;
  • summarize action queue.

Future write/control tools, after approval/grants are stable:

  • create run;
  • cancel run;
  • approve/reject dispatch;
  • retry run;
  • deliver artifact.

Acceptance criteria:

  • MCP transport sessions are not AgentSessions;
  • MCP tools use canonical Omi IDs and owner/tenant scopes;
  • read tools respect projection freshness and return explicit unavailable/stale state when authority is offline;
  • write tools forward authorized commands through the same policy/grant mechanism as other surfaces;
  • MCP OAuth/API-key access alone is not an execution grant;
  • approval decisions are bound to a specific operation, resource, identity, authority generation, and expiry;
  • audit events are persisted.

9. Backend chat durable-run integration

Future work:

  • route eligible /v2/messages backend chat requests through durable coordinator runs instead of request-local agentic streams;
  • keep request-local chat for simple Q&A;
  • display run events in chat stream and resume after disconnect.

10. Backend coordinator tables separated from user tasks/memories

Do not overload user-facing action items, staged tasks, or memories as internal coordinator state.

Acceptance criteria:

  • coordinator tasks/runs are distinct from user action items;
  • coordinator scratch/run memory is distinct from canonical user memories;
  • memory candidates carry provenance before ingestion.

11. Deferred Desktop-local floating-pill lifecycle migration

This is intentionally not part of Desktop wave one. First project legacy pill state into awareness/action queue. Later:

  • make visible pills projections of canonical delegated sessions;
  • make dismiss/hide separate from cancel/archive;
  • remove legacy pill lifecycle authority.

12. Full artifact browser and cross-device artifact sync

Desktop wave one should implement delivery state, review cards, and metadata inspection. Later:

  • richer artifact browser;
  • arbitrary artifact-content browsing;
  • cross-device artifact sync;
  • checkpoint artifact sync for failover.

13. Model-assisted routing

Desktop wave one should use deterministic routing first. Later:

  • add model-assisted routing only after deterministic policy tests pass;
  • preserve explainability and deterministic fallback;
  • prevent routing model from bypassing policy/membranes.

14. Authority, workstream, and journal reconciliation

Define the mapping between agent execution identity, canonical conversation journal, workstream identity, legacy task references, and backend chat messages.

Acceptance criteria:

  • no adapter IDs or task IDs masquerade as AgentSession IDs;
  • no duplicate authoritative conversation writer;
  • historical mappings are idempotent and reversible;
  • task candidates preserve creation/resolution receipts.

15. Cross-device replay and offline reconciliation

Implement owner-scoped sync of compact projections and authorized events with durable cursors and deduplication.

Acceptance criteria:

  • repeated events do not duplicate transitions;
  • missing cursors cause replay or explicit gap state;
  • offline Desktop work continues locally;
  • reconnect does not manufacture terminal success;
  • stale cloud projections are visibly distinguishable.

16. Cross-device grants and sensitive context export

Define approvals, grants, redaction, and export rules for device-local screen context and remote execution.

Acceptance criteria:

  • device-local evidence remains local by default;
  • exporting sensitive context requires matching authorization;
  • approval is not transferable across unrelated operations;
  • expired/revoked grants cannot be replayed;
  • all remote context access has provenance and audit evidence.

17. Artifact consistency and retention

Specify metadata/content synchronization, content hashes, delivery receipts, checkpoint retention, and garbage collection.

Acceptance criteria:

  • content hashes and owner scope verified on receive;
  • missing or unauthorized artifact content fails closed;
  • retry-dependent checkpoints remain available;
  • sync does not alter canonical historical attempt state;
  • deleted/expired cloud copies do not rewrite local history.

18. Legacy mobile/VM compatibility and migration

Migrate the existing mobile → agent-proxy → AgentVM path incrementally rather than replacing it atomically.

Acceptance criteria:

  • old and new clients can coexist during rollout;
  • reconnect and retry do not duplicate execution;
  • legacy history maps deterministically to canonical refs;
  • fallback does not reactivate a parallel control plane;
  • rollback preserves completed runs and visible artifacts.

19. Observability and rollout

Add cross-surface tracing and contract tests before general deployment of remote coordinator features.

Acceptance criteria:

  • every control path correlates owner, client/request, canonical session, run, attempt, and authority generation;
  • no unauthorized cross-owner/tenant visibility;
  • duplicate side effects and state divergence are measured;
  • staged rollout and rollback are supported;
  • recovery evidence is inspectable without raw private data.

Recommended ordering after Desktop foundation

  1. Authority, identity, journal, workstream, and synchronization contract reconciliation.
  2. Backend projection/read models and event replay.
  3. Shared Agent VM lifecycle service.
  4. Agent VM runtime-node registration and canonical correlation.
  5. Unified ToolDescriptor / logical capability contract.
  6. Hosted MCP read-only coordinator tools.
  7. Safe cross-device authority: directory, relay, fenced leases, export permissions, reconnect.
  8. Mobile continuity and VM placement/failover.
  9. Backend chat durable-run integration.
  10. Hosted MCP coordinator write/control tools.
  11. Full floating-pill replacement / cross-device artifacts / model-assisted routing.

This is a dependency-oriented sequence, not a requirement to implement every branch serially. Independent implementation tracks may proceed after their contracts and specific prerequisites are established.

Explicit non-goals until Desktop lands

Do not start implementation of these until Desktop has shipped a proven local paradigm:

  • backend canonical coordinator API;
  • mobile run/session UI;
  • Agent VM runtime-node placement;
  • cloud directory/relay;
  • MCP coordinator controls;
  • cross-device artifact sync;
  • model-assisted routing.

Definition of ready for deferred implementation

This issue becomes implementation-ready only after the Desktop coordinator slice has landed with evidence:

  • Desktop runtime/store tests pass;
  • context packet and policy tests pass;
  • action queue derives correct hard actions;
  • Ask Omi/task-chat deterministic routing works;
  • dispatch/approval/grant flow works locally;
  • artifact delivery + candidates work locally;
  • Desktop harness verifies the UI surface;
  • a reviewed authority/identity contract identifies which Desktop semantics are stable and which remain Desktop-private.

Child issue contract

Every child issue created from this backlog should include:

  • Parent: Deferred agent coordinator expansion after Desktop paradigm lands #8652
  • Desktop gate: linked evidence / blocked
  • Affected components: concrete repo paths
  • Existing behavior: what must be preserved
  • Authoritative writer: component and scope
  • Identity mapping: canonical IDs and legacy refs
  • Allowed operations: reads / commands / writes
  • Failure behavior: offline / timeout / partition
  • Security: owner, tenant, grants, context, audit
  • Compatibility: old client/runtime versions
  • Acceptance tests: concrete executable scenarios
  • Rollback: how to disable without data loss
  • Non-goals: explicit excluded changes

Definition of done for backlog decomposition

This parent issue may close after:

  1. The Desktop implementation gate is satisfied and linked.
  2. Shared identity, authority, policy, and sync contracts have been reviewed and recorded.
  3. Deferred epics have appropriately scoped child issues.
  4. Every child identifies prerequisites, affected code, authority boundaries, compatibility, acceptance tests, and rollback expectations.
  5. No child introduces a competing control plane.

Completing this parent issue does not imply all deferred features have shipped.

Activity

  1. added
    enhancement
    backend
    on Jun 30, 2026
  2. added
    p3
    on Jul 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    backenddesktopenhancementmobilep3

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions