fix(collaboration): harden delegated task isolation (#1486)

* feat(collaboration): isolate delegated artifacts and child runs

Isolate delegated inputs and outputs behind secure artifact exchange lifecycles. Scope Agent Link tasks by tenant and root agent, and enforce delegation spawn-tree boundaries. Add process-wide child-run admission and preserve logical media paths across native, MCP, and sandbox execution.

* fix(collaboration): harden delegated task isolation

Enforce tenant and root-agent task scope across migrations and stores. Add exactly-once async completion delivery, delegated sandbox boundaries, and confined artifact and media recovery across runtime surfaces.

* fix(collaboration): recover interrupted async tasks

* fix(collaboration): normalize persisted child-run status

---------

Co-authored-by: ntduc <ntduc@cpp.ai.vn>
This commit is contained in:
Duc Nguyenandntduc authored and GitHub committed 2026-07-30 14:17:40 +07:00
1 parent 496b7ffce6
commit bb7712a9ff
186 files changed
+18858 -1233

No files matched your search

+1
View File
@@ -750,6 +750,7 @@
"description": "Controls sub-agent spawning limits and behavior",
"maxConcurrent": "Max Concurrent",
"maxSpawnDepth": "Max Spawn Depth",
"maxSpawnDepthTip": "Maximum depth of each agent's own sub-agent spawn tree. Agent Link delegation starts a new tree governed by the target agent's settings. At depth 1, an agent can spawn direct sub-agents, but those sub-agents cannot spawn again.",
"maxChildrenPerAgent": "Max Children Per Agent",
"archiveAfter": "Archive After (minutes)",
"maxRetries": "Max Retries",
+1 -1
View File
@@ -94,7 +94,7 @@
"agents.subagents.maxConcurrent": "Max Concurrent",
"agents.subagents.maxConcurrentTip": "Maximum number of sub-agents that can run simultaneously.",
"agents.subagents.maxSpawnDepth": "Max Spawn Depth",
"agents.subagents.maxSpawnDepthTip": "Maximum nesting depth for sub-agent chains.",
"agents.subagents.maxSpawnDepthTip": "Maximum depth of each agent's own sub-agent spawn tree. Agent Link delegation starts a new tree governed by the target agent's settings. At depth 1, an agent can spawn direct sub-agents, but those sub-agents cannot spawn again.",
"agents.subagents.maxChildrenPerAgent": "Max Children Per Agent",
"agents.subagents.maxChildrenPerAgentTip": "Maximum number of child sub-agents a single agent can spawn.",
"agents.subagents.archiveAfterMin": "Archive After (min)",
+1
View File
@@ -394,6 +394,7 @@
"description": "Description",
"descriptionPlaceholder": "Optional description...",
"maxConcurrent": "Max Concurrent",
"maxConcurrentHint": "Compatibility metadata only; Agent Link runtime admission uses the process safety cap and bounded pending queue.",
"status": "Status",
"active": "Active",
"disabled": "Disabled",
+1
View File
@@ -741,6 +741,7 @@
"description": "서브에이전트 생성 제한 및 동작 제어",
"maxConcurrent": "최대 동시",
"maxSpawnDepth": "최대 생성 깊이",
"maxSpawnDepthTip": "각 에이전트가 직접 생성하는 서브에이전트 트리의 최대 깊이입니다. Agent Link 위임은 대상 에이전트의 설정을 사용하는 새 트리를 시작합니다. 깊이가 1이면 직접 서브에이전트를 생성할 수 있지만 해당 서브에이전트는 다시 생성할 수 없습니다.",
"maxChildrenPerAgent": "에이전트당 최대 자식",
"archiveAfter": "보관 시간 (분)",
"modelOverride": "모델 재정의",
+1 -1
View File
@@ -96,7 +96,7 @@
"agents.subagents.maxConcurrent": "최대 동시",
"agents.subagents.maxConcurrentTip": "동시에 실행할 수 있는 서브에이전트의 최대 수입니다.",
"agents.subagents.maxSpawnDepth": "최대 생성 깊이",
"agents.subagents.maxSpawnDepthTip": "서브에이전트 체인의 최대 중첩 깊이입니다.",
"agents.subagents.maxSpawnDepthTip": "각 에이전트가 직접 생성하는 서브에이전트 트리의 최대 깊이입니다. Agent Link 위임은 대상 에이전트의 설정을 사용하는 새 트리를 시작합니다. 깊이가 1이면 직접 서브에이전트를 생성할 수 있지만 해당 서브에이전트는 다시 생성할 수 없습니다.",
"agents.subagents.maxChildrenPerAgent": "에이전트당 최대 자식",
"agents.subagents.maxChildrenPerAgentTip": "단일 에이전트가 생성할 수 있는 최대 자식 서브에이전트 수입니다.",
"agents.subagents.archiveAfterMin": "보관 시간 (분)",
+1
View File
@@ -386,6 +386,7 @@
"description": "설명",
"descriptionPlaceholder": "선택적 설명...",
"maxConcurrent": "최대 동시",
"maxConcurrentHint": "호환성 메타데이터로만 유지됩니다. Agent Link 런타임 승인은 프로세스 안전 한도와 제한된 대기열을 사용합니다.",
"status": "상태",
"active": "활성",
"disabled": "비활성화됨",
+1
View File
@@ -750,6 +750,7 @@
"description": "Управляет лимитами и поведением порождения субагентов",
"maxConcurrent": "Макс. одновременно",
"maxSpawnDepth": "Макс. глубина порождения",
"maxSpawnDepthTip": "Максимальная глубина собственного дерева субагентов каждого агента. Делегирование через Agent Link начинает новое дерево с настройками целевого агента. При глубине 1 агент может запустить прямых субагентов, но они не смогут запускать новых.",
"maxChildrenPerAgent": "Макс. дочерних на агента",
"archiveAfter": "Архивировать через (минут)",
"maxRetries": "Макс. повторов",
+1 -1
View File
@@ -99,7 +99,7 @@
"agents.subagents.maxConcurrent": "Макс. одновременно",
"agents.subagents.maxConcurrentTip": "Максимальное количество субагентов, которые могут работать одновременно.",
"agents.subagents.maxSpawnDepth": "Макс. глубина порождения",
"agents.subagents.maxSpawnDepthTip": "Максимальная глубина вложенности для цепочек субагентов.",
"agents.subagents.maxSpawnDepthTip": "Максимальная глубина собственного дерева субагентов каждого агента. Делегирование через Agent Link начинает новое дерево с настройками целевого агента. При глубине 1 агент может запустить прямых субагентов, но они не смогут запускать новых.",
"agents.subagents.maxChildrenPerAgent": "Макс. дочерних на агента",
"agents.subagents.maxChildrenPerAgentTip": "Максимальное количество дочерних субагентов, которое может породить один агент.",
"agents.subagents.archiveAfterMin": "Архивировать через (мин)",
+1
View File
@@ -394,6 +394,7 @@
"description": "Описание",
"descriptionPlaceholder": "Необязательное описание...",
"maxConcurrent": "Макс. одновременных",
"maxConcurrentHint": "Поле сохранено только как метаданные совместимости; Agent Link использует защитный лимит процесса и ограниченную очередь ожидания.",
"status": "Статус",
"active": "Активна",
"disabled": "Отключена",
+1
View File
@@ -735,6 +735,7 @@
"description": "Kiểm soát giới hạn sinh sản agent con và hành vi",
"maxConcurrent": "Tối đa đồng thời",
"maxSpawnDepth": "Độ sâu sinh sản tối đa",
"maxSpawnDepthTip": "Độ sâu tối đa của cây sub-agent do từng agent tự spawn. Delegate qua Agent Link bắt đầu một cây mới và dùng setting của agent đích. Với depth 1, agent có thể spawn sub-agent trực tiếp, nhưng các sub-agent đó không thể spawn tiếp.",
"maxChildrenPerAgent": "Con tối đa mỗi agent",
"archiveAfter": "Lưu trữ sau (phút)",
"maxRetries": "Số lần thử lại tối đa",
+1 -1
View File
@@ -94,7 +94,7 @@
"agents.subagents.maxConcurrent": "Tối đa đồng thời",
"agents.subagents.maxConcurrentTip": "Số subagent tối đa có thể chạy đồng thời.",
"agents.subagents.maxSpawnDepth": "Độ sâu tạo tối đa",
"agents.subagents.maxSpawnDepthTip": "Độ sâu lồng nhau tối đa cho chuỗi subagent.",
"agents.subagents.maxSpawnDepthTip": "Độ sâu tối đa của cây sub-agent do từng agent tự spawn. Delegate qua Agent Link bắt đầu một cây mới và dùng setting của agent đích. Với depth 1, agent có thể spawn sub-agent trực tiếp, nhưng các sub-agent đó không thể spawn tiếp.",
"agents.subagents.maxChildrenPerAgent": "Subagent tối đa mỗi agent",
"agents.subagents.maxChildrenPerAgentTip": "Số subagent tối đa mà một agent có thể tạo.",
"agents.subagents.archiveAfterMin": "Lưu trữ sau (phút)",
+1
View File
@@ -394,6 +394,7 @@
"description": "Mô tả",
"descriptionPlaceholder": "Mô tả tùy chọn...",
"maxConcurrent": "Tối đa đồng thời",
"maxConcurrentHint": "Chỉ là metadata tương thích; Agent Link dùng giới hạn an toàn toàn tiến trình và hàng đợi có giới hạn.",
"status": "Trạng thái",
"active": "Hoạt động",
"disabled": "Tắt",
+1
View File
@@ -735,6 +735,7 @@
"description": "控制子Agent生成限制和行为",
"maxConcurrent": "最大并发数",
"maxSpawnDepth": "最大生成深度",
"maxSpawnDepthTip": "每个 Agent 自己生成的子 Agent 树的最大深度。通过 Agent Link 委派会开始一棵新树,并使用目标 Agent 的设置。深度为 1 时,Agent 可以生成直接子 Agent,但这些子 Agent 不能继续生成。",
"maxChildrenPerAgent": "每Agent最大子数",
"archiveAfter": "归档时间(分钟)",
"maxRetries": "最大重试次数",
+1 -1
View File
@@ -94,7 +94,7 @@
"agents.subagents.maxConcurrent": "最大并发数",
"agents.subagents.maxConcurrentTip": "可同时运行的最大子 Agent 数量。",
"agents.subagents.maxSpawnDepth": "最大生成深度",
"agents.subagents.maxSpawnDepthTip": "子 Agent 链的最大嵌套深度。",
"agents.subagents.maxSpawnDepthTip": "每个 Agent 自己生成的子 Agent 树的最大深度。通过 Agent Link 委派会开始一棵新树,并使用目标 Agent 的设置。深度为 1 时,Agent 可以生成直接子 Agent,但这些子 Agent 不能继续生成。",
"agents.subagents.maxChildrenPerAgent": "每 Agent 最大子数",
"agents.subagents.maxChildrenPerAgentTip": "单个 Agent 可生成的最大子 Agent 数量。",
"agents.subagents.archiveAfterMin": "归档时间(分钟)",
+1
View File
@@ -394,6 +394,7 @@
"description": "描述",
"descriptionPlaceholder": "可选描述...",
"maxConcurrent": "最大并发数",
"maxConcurrentHint": "仅保留为兼容元数据;Agent Link 运行时准入使用进程安全上限和有界等待队列。",
"status": "状态",
"active": "活跃",
"disabled": "禁用",
@@ -49,7 +49,7 @@ export function SubagentsSection({ enabled, value, onToggle, onChange }: Subagen
/>
</div>
<div className="space-y-2">
<InfoLabel tip="How many levels deep sub-agents can spawn other sub-agents. Depth 1 means only the parent can spawn.">{t(`${s}.maxSpawnDepth`)}</InfoLabel>
<InfoLabel tip={t(`${s}.maxSpawnDepthTip`)}>{t(`${s}.maxSpawnDepth`)}</InfoLabel>
<Select
value={String(value.maxSpawnDepth ?? "")}
onValueChange={(v) => onChange({ ...value, maxSpawnDepth: Number(v) })}
@@ -51,7 +51,7 @@ export const CONFIG_DEFAULTS_FALLBACK: ConfigDefaults = {
hardClear: { enabled: true, placeholder: "[Old tool result content cleared]" },
},
subagents: {
maxConcurrent: 8,
maxConcurrent: 20,
maxSpawnDepth: 1,
maxChildrenPerAgent: 5,
archiveAfterMinutes: 60,
@@ -183,6 +183,7 @@ export function LinkCreateDialog({
onChange={(e) => setMaxConcurrent(Math.max(1, Math.min(50, Number(e.target.value) || 5)))}
className="w-full rounded-md border bg-background px-3 py-2 text-base md:text-sm focus:outline-none focus:ring-2 focus:ring-ring"
/>
<p className="text-xs text-muted-foreground">{t("links.maxConcurrentHint")}</p>
</div>
{/* Actions */}