Skip to content

Ephemeral Task Agents

The task worker (edgeplaned::task_worker) enables distributed, parallel AI execution within EdgePlane’s mesh. When a dispatcher submits a MeshTask, edgeplaned spawns an ephemeral agent subprocess to claim and execute it — without touching any persistent agent session or interrupting operator context.

Without ephemeral agents, when something actionable surfaces (a scheduled check, an automated analysis, an inbound request), dispatchers have two bad options:

  1. Signal-inject into a live profile session — the signal lands as a user message in whatever conversation is active, interrupting focused work and polluting context.
  2. Write a note somewhere and hope the operator notices — loses urgency, breaks the loop, no feedback.

The task worker provides a third path: submit a MeshTask to the mesh, let an ephemeral subagent claim it, run it to completion in an isolated context, and report back. The persistent session is never touched. EdgePlane retains full visibility and a durable audit trail.

The ephemeral subagent is not a new Agent. It is an AgentRun of an existing Agent (the parent profile), surfaced into the mesh as a transient MeshAgent.

EntityLifetimeNotes
AgentPermanentParent profile identity. Reused, never created per task.
MeshTaskTask lifecycleCreated by dispatcher with required_capabilities and target mission_id
MeshAgentTask lifecycleNew per subagent. FK back to parent Agent. Deleted on completion.
ExecutionSessionTask lifecycleCompute lease for the subagent process
AISessionTask lifecycleFresh AI session per task — ephemerality is the point. No resume by default.
AgentRunPermanentJoins agent + task + session. This is the audit record. It persists after the task completes.

AgentRun.mesh_agent_id FK is ON DELETE SET NULL — the audit trail survives MeshAgent deletion.

One Agent identity can run N concurrent MeshAgent projections: one persistent operator session plus M ephemeral task subagents executing in parallel.

edgeplaned::task_worker runs two loops per node:

Polls for MeshTasks with status='ready' whose claim_policy.target_profile matches a profile supervised on this node.

For each match:

  1. Enrolls an ephemeral MeshAgent under the parent Agent identity (labels: {"role": "task-subagent", "ephemeral": true})
  2. Claims the task (lease-based)
  3. Opens an AgentRun record
  4. Allocates a per-task git worktree at ~/.edgeplane/worktrees/<task_id>/ to prevent concurrent git collisions
  5. Spawns the agent subprocess with --allowed-tools derived from required_capabilities
  6. On exit: marks task complete, deletes the MeshAgent row, closes the AgentRun

Polls the intake mission for unscoped, unrouted tasks.

For each task:

  • Rule-based routing (target profile explicitly set) → claim loop picks it up
  • Categorizer routing (confidence ≥ threshold) → creates a child MeshTask in the appropriate mission with parent_task_id chain; claim loop picks it up
  • Low confidence → marks the task blocked; optionally invokes task_worker_surface_command with <task_id> <title> <reason> so deployments can chain external notifications without EdgePlane encoding a specific interface

On startup, edgeplaned ensures a default home domain (name overridable via EP_HOME_DOMAIN_NAME) and an intake mission exist under it. This is idempotent and soft-fails silently if the control plane is unavailable.

The home domain is a regular domain — no special type — that provides a default container for operational scaffolding (intake mission, agent home_domain_id anchors).

Dispatchers declare blast radius via MeshTask.required_capabilities (JSON array). The task worker translates these to agent launch flags at spawn time.

Coarse capability vocabulary:

CapabilityWhat it grants
shell:readRead-only shell commands
shell:writeShell commands with write effects
fs:readFilesystem reads
fs:writeFilesystem writes
vault:readKnowledge store reads
vault:writeKnowledge store writes
edgeplane:readEdgePlane read operations
edgeplane:writeEdgePlane write operations
web:fetchHTTP fetch
gh:readGitHub reads
gh:writeGitHub writes

If a task requires capabilities the parent agent doesn’t have, the claim loop skips it.

Despite agent ephemerality, EdgePlane retains full visibility:

  • edgeplane agent list — shows parent identity plus active subagent projections
  • edgeplane daemon task ls — shows work in progress with claimed_by_agent_id
  • get_entity_history on parent Agent — joins through AgentRun to show every subagent execution, including ephemerals long after their MeshAgent is gone
  • Cost rollupagentrun.total_cost_cents queryable per parent agent, per mission, per domain

The ephemeral nature is in the runtime projection, not the audit trail.

HazardMitigation
Concurrent git operationsPer-task worktrees at ~/.edgeplane/worktrees/<task_id>/ — each subagent has its own checkout
API rate limitsmax_concurrent_subagents config (default: 3); excess tasks queue in the mesh
Append-only writesSafe under POSIX for ≤PIPE_BUF; vault writes are atomic at the git layer
Terminal window
# Via MCP tool (from within an agent session)
submit_mesh_task(
mission_id = "...",
prompt = "Run the full integration test suite and report results",
required_capabilities = ["shell:read", "edgeplane:read"],
claim_policy = {"target_profile": "my-profile"}
)
# Via CLI
edgeplane daemon task submit --mission-id <id> --prompt "..." --capabilities shell:read,edgeplane:read