Skip to content

Delegate work to other Agents ​

When work divides into independently useful deliverables, ask the main Agent in Feishu to delegate to experts and combine their results. This guide covers a clear assignment, verification, follow-up with the same expert and failure handling.

Choose the collaboration object ​

NeedObjectIdentity to retain
Continue discussing with the assistantAnother turn in the current SessionTopic/conversation; no Task ID is required
Complete a bounded review, analysis or changeEphemeral TaskRuntask_id
Work through several rounds in one expert environmentPersistent Agent Instanceagent_instance_id and each execution's task_id
Use the native Agent's own subagentsNative Agent capabilityDoes not automatically create amux Task or Instance identity

A Profile is a reusable expert definition, not an execution. Selecting builtin/codex twice can create independent work. Continuing a persistent expert requires its instance ID.

Specify the assignment ​

The main Agent needs amux delegation tools and an available Profile. A working chat bot does not necessarily have these tools, and an installed Profile does not prove credentials, workspace and target host are ready.

For a first attempt, ask the Agent to list available experts and explain their roles. Then include:

ElementExample
Input and scopeRepository, commit, change set or exact document excerpts
Division of workOne expert checks correctness, another checks test coverage
Allowed actionsRead-only review; no file edits or remote records yet
DeliverableEach finding contains file location, evidence and recommendation
EnvironmentRepository/workspace on the chosen Runtime and required credentials
DeadlinePer-child time limit; report partial evidence and missing work on timeout
SynthesisMain Agent deduplicates findings and identifies disagreements or unsupported claims

For example, send this natural-language request, not a slash command:

@assistant Review this repository change. First verify available experts and the repository location. Delegate correctness and test coverage to two experts through amux for read-only analysis. Supply each with the change scope and relevant material. Return their task IDs after creation, then combine findings with file evidence and clearly identify unfinished work.

Tool use still depends on the model, available tools and authorization. “I asked another expert” in a reply is not proof of delegation; verify returned task or instance IDs.

Follow a bounded delegation ​

A verifiable path is: choose a Profile → amux.task_submit returns a Task ID → child preparation and execution → amux.task_get / amux.task_stream expose status and results → main Agent synthesizes them. amux.task_run is the blocking form. Permission escalation to the main Agent is incompatible with that blocking form; use asynchronous submission and inspection when escalation is needed.

Tasks execute on the selected Runtime. Their default workspace is a temporary directory, not an automatic copy of the parent's cwd, uncommitted changes, complete Feishu topic or attachments. For repository work, provide an accessible repository identity or target-local path. git-worktree needs a repository directory or cache identity.

Read child cards ​

For related delegations observed in a bound Feishu conversation, amux creates separate child progress cards and updates them in place. A label uses an expert short name plus instance or child Session identity; Task ID may be a temporary label before child creation. Use the full Task ID to identify a record reliably.

  • The main card summarizes parent activity; each child's process, model and result belong to that execution.
  • A child succeeding does not mean the main Agent has finished its comparison.
  • A parent response ending does not mean all children were cancelled; inspect their individual states.
  • Child cumulative usage belongs to its Provider conversation and can include earlier TaskRuns for a persistent expert. Do not add parent/child cards as a bill for this request.
  • If a child card is absent, inspect the ID and record first. Cards present work; records verify that work actually exists.

Interpret status and results ​

StatusMeaning
Nonterminal states such as pending, preparing, runningWork is still preparing resources or executing
waiting_permissionA permission request needs handling according to this Task's policy
succeededExecution succeeded; still verify the report, patch or files against acceptance criteria
failedInspect the error and partial result; do not present it as a complete delivery
cancelledCancellation does not undo already performed changes
timed_outDeadline exceeded; inspect partial work before deciding what to retry

The current default deadline is 30 minutes. timeout_seconds starts at admission and includes preparation and Agent startup. Allow preparation time when choosing a shorter deadline. Results default to a summary. Read events or detailed results for evidence; even full text can be bounded, with pointers for further retrieval.

Permissions, stopping and failures ​

Child permission policies govern permission requests: the default policy-allow automatically handles requests that meet its rules, without requiring a human prompt for each one; deny-all denies them, and escalate-to-main reports them for a response through task tools. These policies do not grant filesystem access, bypass isolation, supply credentials or establish a read-only sandbox.

Sending /interrupt to the parent in Feishu does not establish that every child was cancelled. To stop a particular child, ask the main Agent to call amux.task_cancel for that Task ID and report the final state. Already written files or external changes still need separate inspection.

After a child failure, retrieve its error and evidence and retry only the missing part. Check which Runtime and workspace contain the output. A child finishing with a patch does not automatically merge it into your main branch, and a claim of editing files does not prove the parent's workspace changed.

Operators can verify with read-only commands:

sh
amux task show <task-id>
amux task logs <task-id>

Continue with the same expert ​

For several rounds in the same environment, explicitly request a persistent Agent Instance and retain its ID:

Use a persistent expert for the first review. Return the instance ID, this task's ID and the main findings. After I add constraints, continue with that same instance instead of creating another expert with the same name.

ToolPurposeExecution effect
amux.instance_spawnCreate a persistent expertStarts initial work and returns a stable instance identity
amux.instance_followupGive an existing instance a new assignmentStarts a new TaskRun while retaining native conversation history
amux.instance_sendHold supplemental input for a later wakeMailbox only; delivered before a subsequent Task prompt
amux.instance_steerCorrect the work the instance is doing right nowNo new work; joins the running execution, or falls back to the mailbox (delivery=mailbox) when nothing is running
amux.instance_waitWait for current execution to end or the wait to time outDoes not start work; retrieve results through Task tools
amux.instance_interruptCancel the instance's current owned executionKeeps the instance and resumable environment

A follow-up can say: “Continue instance <agent_instance_id> with the new constraints, reassess the second risk, and return the new Task ID.” A successful instance_send does not mean the expert started answering; use an execution entry such as instance_followup to wake it. After instance_steer returns delivery=mailbox, continue with instance_followup: the mailboxed correction is delivered first, so do not repeat it in the new prompt.

A wait timeout from instance_wait is not a Task timeout or cancellation. Inspect the corresponding Task ID with amux.task_get or amux.task_stream for results.

The instance returns to its recorded Runtime with resumable Provider history and environment. This is not automatic cross-host failover. Instance states active / idle / archived are distinct from a particular Task's success or failure.

Troubleshooting ​

SymptomCheck or remedy
Delegation claimed but no task existsRequest actual tool results and IDs; distinguish native subagents
Child cannot find repository/filesProvide target-accessible paths, repository identity and inputs; inspect workspace policy
Child waits for authorizationInspect waiting_permission and permission ID; check the parent can respond
“Same expert” forgot previous workWas its instance ID reused, or only the same Profile selected?
Instance message got no responseinstance_send only queues; instance_followup starts work
Parent stopped while children runCancel the specific Task and verify its terminal state
Every child succeeded without a final answerAsk the parent to retrieve results, resolve differences and synthesize

Other Feishu bots are a separate integration, not installed local Profiles. External-bot discovery and new delegation require a valid current-group binding; this does not permit cross-group discovery. See Agent concepts, the Task model, Task operations and MCP reference for full contracts and parameters.

Released under the Apache-2.0 License.