subagent-reliability
Subagent dispatch reliability patterns. Expect failures, design around prompt size limits, use write-then-read for synthesis tasks.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Subagent dispatch reliability patterns. Expect failures, design around prompt size limits, use write-then-read for synthesis tasks.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Dispatch Codex to review all unreviewed repository work, then verify its correlated findings ticket or clean result. Use when requesting an independent Codex review, auditing all changes, checking work since the last review, or waiting for Codex findings. Trigger: dispatch codex review, independent review, review all changes, check codex findings, run review agent.
Always-on: when a project has tickets, work the frontier (first unblocked open ticket), mark done, update plan status.
Incremental and full-history repository review with resumable adoption batches. Use when reviewing new work, initializing review tracking, reviewing all work to date, resuming historical review, inspecting unreviewed commits, or reviewing changed tickets. Trigger: review new work, adopt repository, review all history, resume review, review marker, unreviewed commits.
End-of-session handoff that captures current state for the next session. Use when ending a work session, switching context, or before a long break.
Consolidate project artifacts — promote scratch to memory, deduplicate memory, process decisions, organize scripts, update steering/skills accuracy. Use periodically or when the project feels cluttered.
Run and interpret crew-research evals — run.sh flags, scores.jsonl fields, activation TPR/FPR verdicts, resuming interrupted runs. Use when running evals, reading eval results, diagnosing a failing definition, or resuming a dead run. Trigger: run the evals, eval results, scores.jsonl, activation test, TPR, delta threshold, resume the run, skip-completed, known gap.
| name | subagent-reliability |
| description | Subagent dispatch reliability patterns. Expect failures, design around prompt size limits, use write-then-read for synthesis tasks. |
| metadata | {"type":"reference","invocation":"agent-only","practice":null,"tools":["kiro-cli","codex"]} |
Subagent calls are unreliable. Expect failures and design around them.
| Mode | Symptom | Frequency |
|---|---|---|
| Empty response | Stage completes but returns no content | Common (~50%) |
| Timeout | ConnectorError / Connection timed out | Occasional |
| Partial response | Starts output then cuts off | Rare |
| Silent success | Returns but missed key content (no way to detect) | Unknown |
| Approval stall | Stage sits idle, no error, no output — worker hit a permission prompt for a tool not in its allowedTools | Config-dependent |
Root cause (validated): failures correlate with prompt size, not task complexity. Dispatch prompts under ~1K tokens with work happening via tool calls succeed (~93%); prompts with 5-10K+ tokens of inlined data fail (~90%).
Approval stalls are a config bug, not a dispatch bug (kiro-cli docs, validated 2026-06): trust never inherits from the parent — a subagent auto-approves only what its OWN allowedTools covers, and the parent's toolsSettings.crew.trustedAgents trusts the spawn, not the tools. Before dispatching, verify each worker's allowedTools covers every tool it will use (alongside the mcpServers check).
Never put large data inline in a subagent prompt. If the subagent needs data that's in your context:
.scratch/subagent-input/{stage-name}.md.scratch/subagent-input/{stage-name}.md and [task]"Similarly, preserve subagent output for later phases: save raw results to .scratch/subagent-raw/ and have later phases read the files rather than re-dispatching.
| Corpus size | Strategy |
|---|---|
| 1-5 files, < 500 lines total | Read directly. NEVER subagent. |
| 6-15 files | One subagent per logical group |
| 16-50 files | Multiple stages, 5-8 files each |
| 50+ files | Multiple stages + structured output format + validation |
| Data already in context | Do directly. NEVER re-dispatch. |
| Task type | Subagent? | Why |
|---|---|---|
| Read files → extract structured data | ✅ Yes | Small prompt + tool-mediated work |
| Transform provided text → new structure | ❌ No | Violates the core rule (inline data) |
| Cross-area dedup/merge | ❌ No | Requires seeing all areas together |
| Validate/check existing output | ⚠️ Maybe | Only if the data is in FILES, not inline |
| Multi-step reasoning | ❌ No | Better sequential in main context |
| Research (web search + synthesis) | ⚠️ Unreliable | ~40% success rate; have a fallback plan |
Batches sized by the tool's concurrency limit (references/tool-limitations.md); each batch completes and is validated before the next starts. Order by dependency: independent stages first.
If 2+ stages in a batch fail or return empty: STOP dispatching, report "N/M stages returned empty, switching strategy", then read directly (remaining corpus < 500 lines) or use write-then-read with smaller batches (2 stages at a time).