تخطَّ إلى المحتوى

Agent Delegation

هذا المحتوى غير متوفر بلغتك بعد.

Schedule AI agents to run on a cron schedule or delegate subtasks from one agent to another. Requires the claw plugin (ɳClaw bundle, $0.99/mo).

Agent delegation lets one agent hand off a bounded task to a subagent with an inherited, never-escalated permission scope. At P95, the primary entry point is cron-triggered agents: schedule any agent to run automatically using a standard cron expression.

The full multi-agent runtime (A→B during a conversation, result routing, agent memory sharing) ships in v1.2.

  • claw plugin installed and licensed
  • cron plugin installed
  • PLUGIN_CLAW_INTERNAL_URL set (or default http://plugin-claw:3710 reachable)
Terminal window
nself cron add \
--agent assistant \
--context '{"task":"send morning briefing"}' \
--schedule "0 9 * * *" \
--name "morning-briefing"
  • --agent: agent ID to invoke
  • --context: JSON context forwarded to the agent
  • --schedule: standard 5-field cron expression (timezone via --timezone America/New_York)
  • The job owner’s RBAC scope is inherited by the subagent automatically

A delegated agent inherits the job owner’s permissions. It cannot escalate, if a requested tool is not in the owner’s ACL, the delegation is rejected before the job is enqueued.

Owner has: [email.read, calendar.list, notes.write]
Agent requests: [email.read, calendar.list] ← OK
Agent requests: [finance.transfer] ← Rejected: ErrPermissionEscalation
SituationDefault behavior
Agent times out (default 120s)Return partial result to caller
3 consecutive failures in 60sCircuit breaker opens for 30s
Sensitive tool invokedPause and surface approval in nclaw UI

Override the timeout globally via CRON_AGENT_TIMEOUT_SECS.

Override failure behavior per-deploy in plugin.yaml:

agent_delegation:
timeout_seconds: 300
on_failure: escalate_human # return_partial | escalate_human | abort
human_handoff_tools:
- email.send
- finance.transfer

When a cron job with delivery: agent fires, the cron scheduler calls the claw plugin’s internal /internal/agent/handoff endpoint. The claw plugin writes the handoff envelope to np_agent_handoffs with status: queued. The v1.2 runtime will dequeue and execute it.

  • In-conversation A→B delegation (agent delegates a subtask mid-reasoning-loop)
  • Result routing back to the calling agent
  • Agent memory sharing between delegating and delegated agents
  • Admin UI showing the handoff queue