Skip to main content
Agent にタスクを委任する

Managed Agents

Coordinator Agent でサブタスクを child Agent に並列・直列に委譲します。

Managed Agents は、1 つの Agent を Coordinator として動作させ、他の Agent にタスクを委譲することで、マルチ Agent 協調を実現する機能です。各 child Agent は、独立した対話履歴と実行コンテキストを持つ個別の Session Thread で実行されます。

コアコンセプト

Managed Agents は Session Thread モデル上に構築されています。1 つの Session には複数のスレッドを同時に保持でき、各スレッドは独立した Agent スナップショットにバインドされ、独自の対話履歴と実行コンテキストを持ちます。
概念説明
CoordinatorCoordinator スレッド。各 Session につき 1 つだけ存在します。Session 作成時に指定された Agent を使用し、オーケストレーションとタスク委譲を担います
Child threadmultiagent.agents ロスターの Agent にバインドされる子スレッド。独立してタスクを実行し、Coordinator に結果を報告します
Session Threadスレッドエンティティ。ID プレフィックスは sthr_role(coordinator または child)、独立した Agent スナップショット、ステータスを含みます

Managed Agents の設定

Managed Agents 機能を有効にするには、Agent 設定で multiagent フィールドを設定します:
curl -X POST "https://api.qoder.com/api/v1/cloud/agents" \
  -H "Authorization: Bearer $QODER_PAT" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "task-coordinator",
    "model": "ultimate",
    "system": "You are a task coordinator responsible for delegating tasks to sub-agents.",
    "tools": [
      {
        "type": "agent_toolset_20260401",
        "enabled_tools": ["Bash", "Read", "Write"]
      }
    ],
    "multiagent": {
      "type": "coordinator",
      "agents": [
        {"type": "agent", "id": "agent_019f000000000000000000000000001a", "name": "Research Agent"},
        {"type": "agent", "id": "agent_019f000000000000000000000000002b"},
        {"type": "self"}
      ]
    }
  }'

multiagent フィールドリファレンス

フィールド必須説明
typestringはい"coordinator" 固定
agentsarrayはい委譲可能な Agent ロスター。1-20 個のユニークなエントリ
agents 配列の要素は以下の 3 つの形式をサポートします:
形式説明
オブジェクト type: "agent"{"type": "agent", "id": "agent_xxx", "version": 2, "name": "Reviewer"}他の Agent を参照。id は必須、versionname は任意
オブジェクト type: "self"{"type": "self"}Coordinator 自身を子 Agent として参照
文字列ショートハンド"agent_xxx"{"type": "agent", "id": "agent_xxx"} と等価
multiagent を設定する場合、tools には agent_toolset_20260401 エントリを含める必要があります。

スレッドイベント

Managed Agents シナリオでは、イベントストリームに以下の新しいイベントタイプが現れます:
イベントタイプ説明
session.thread_created新しい子スレッドが作成された
session.thread_status_runningスレッドが実行を開始した
session.thread_status_idleスレッドが完了または一時停止した
session.thread_status_terminatedスレッドがアーカイブ/終了された
agent.thread_message_sentスレッド間メッセージが送信された(coordinator → child または後続メッセージ)
agent.thread_message_receivedスレッド間メッセージが受信された(child → coordinator)
すべてのイベントには所属スレッドを識別する session_thread_id フィールドが含まれます。スレッドイベント一覧スレッドイベントストリームエンドポイントを使用して、スレッド単位でイベントをフィルタリングできます。

制限

項目制限
Agent 設定あたりの最大子 Agent 数20 個のユニークなエントリ
Session あたりの最大同時スレッド数25 個(Coordinator を含む)
Session アイドル条件すべてのスレッドが実行を停止している必要がある

次のステップ