Skip to content

design: one CLI for delegating subagent tasks to Moca #495

Closed

Description

@moonlight16

Why. Today there are three separate clients for the same job:

  1. remote_task.py from feat: let local agents delegate tasks to Moca #455 (the original context-delegation PR): uploads local files once as a workload's context, then runs many tasks in parallel and waits for each result.
  2. Maia's demo CLI, moca start | check | list (kagenti-demos/sandboxing/moca_chained_subagents). start hands a task to Moca through a background process that holds the request open, so the local agent can quit. check collects the result later, and list shows what's pending.
  3. Coding-agent subagents A2: mocactl subagent commands (spawn, subagents, get, watch, approve, follow-up) over today's API #381 (planned mocactl subagent commands): spawn, subagents, get, watch, approve, follow-up. It's the same idea as Maia's, plus a local record of spawned tasks.

mocactl today has login, run (interactive turns), sessions, credentials and promote/bundles (config bundles). We should agree on one client before building more.

Proposal

  • mocactl is the client. It already handles login, server URLs and sessions.
  • Coding-agent subagents A2: mocactl subagent commands (spawn, subagents, get, watch, approve, follow-up) over today's API #381's commands with Maia's proven behavior: a background worker holds each run open, the result is written to disk, and /runs/status is used only to recover a result if the worker died.
  • Context is an option on a task: mocactl spawn --workload <id> "prompt" runs the task with that workload's files (feat: run tasks on a workload's context in shared sandboxes #494, run tasks on a workload's context).
  • Workloads are set up separately: mocactl workloads create --context <file> uploads a context file made by contextctl ctx export, and mocactl workloads delete <id> cleans up. mocactl never calls contextctl itself.
  • Fan-out is many spawn calls under a concurrency limit. There's no separate batch command.
  • Naming: mocactl already uses "bundle" for config bundles, so uploaded context is called a context in the CLI, never a bundle.

Open questions

  1. Is mocactl workloads … the right place for workload setup?
  2. Should the delegate skill call mocactl directly, or a thin wrapper whose permission prompts read clearly (Maia's Bash(moca start*) pattern)?
  3. What should watch print so hundreds of tasks stay readable in Claude Code's Monitor tool?
  4. Once this exists, should Maia's demo switch to mocactl?

Not in scope: server changes, and per-workload sandboxes, which are #476 (phase 2: per-workload sandboxes and storage).

cc @pdettori @maia-iyer @evaline-ju

Activity

  1. pdettori commented on Oct 13, 2026

    @pdettori
    Member

    @moonlight16 I agree we should converge to one CLI. I would recommend mocactl as it already handles login, control plane interaction, sessions management, user creds management and more. @maia-iyer wdyt ?

  2. moonlight16 commented on Oct 13, 2026

    @moonlight16
    MemberAuthor

    Update: #496 (by @evaline-ju) already shipped mocactl spawn, subagents and get, so the CLI has converged on mocactl, as @pdettori suggested. What's left for delegation with context is small:

    • mocactl spawn --workload <id>;
    • mocactl workloads create --context <file> and mocactl workloads delete <id>.

    #517 (seed sandbox files before a leaf runs) asks for the same thing. @maia-iyer, does that cover what your demo's start/check/list needs, or is anything missing?

  3. maia-iyer commented on Oct 14, 2026

    @maia-iyer
    Contributor

    Yes this should be a perfect fit. We have moved to mocactl as of yesterday, and the main blip is the ability to seed sandbox state easily before deploying a subagent which should be addressed with the --workload flag as above

  4. pdettori commented on Nov 16, 2026

    @pdettori
    Member

    Closing: the CLI converged on mocactl.

    @maia-iyer confirmed on 2026-10-14 that the demo moved to mocactl. Open questions 2 and 3 (a delegate-skill wrapper, and what watch should print for Monitor) can be filed separately if still wanted.

  5. added this to the v0.11.0 milestone on Nov 17, 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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions