/agent-traffic-control:workflow-schema-agent-retry-cap-oversized-payloadfrom agent-traffic-control
A dynamic Workflow (the Workflow tool / multi-agent orchestration) parallel()/pipeline() agent that DID all its work returns null and the run reports "StructuredOutput retry cap (5) exceeded — 5 failed calls with no valid output" — NOT because the agent found nothing or was rate-limited, but because its result OBJECT was too large / malformed to serialize in one StructuredOutput call (a big nested array of findings, long SQL/quotes per row), often compounded by a stray closing-tag / truncation that corrupts the JSON. Use when: (1) a workflow fan-out comes back N-of-M and a failure line names the StructuredOutput retry cap (distinct from the rate-limit "empty-args 50-90×" mode); (2) an agent's transcript shows FULL (non-empty) StructuredOutput tool_use inputs that keep failing validation; (3) the agent's own last text says "payload too large / getting truncated" or "stray </parameter> corrupted the JSON". Covers RECOVERING the near-complete work from the agent-*.jsonl transcript's failed StructuredOutput attempts (the data is there — do NOT re-run), and PREVENTING it with compact schemas, capped array sizes, and terse field values. See also: workflow-schema-agents-empty-loop-under-ratelimit (empty-args/rate-limit sibling), workflow-standalone-schema-agent-crash-and-args-string, cjk-structured-llm-output-truncates-json-needs-2x-tokens.
Trending skills
7-day visitors to each skill page
Ships in agent-traffic-control. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description, though model invocation is off: only you can start it.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
A Workflow parallel()/pipeline() agent forced to emit a StructuredOutput schema completes its
actual work (e.g. runs all its BQ probes, gathers every finding) but then cannot emit the result
because the object is too large or malformed to serialize in one call. It burns the retry cap
(default 5), the run logs StructuredOutput retry cap (5) exceeded — 5 failed calls with no valid output, and that agent resolves to null inside parallel(). The run "completes" N-of-M and the null
looks like "this agent found nothing" — but the work is real and recoverable.
This is a distinct failure from its siblings: the args are full, not empty (rules out the
rate-limit empty-loop), the agent is inside parallel() so it doesn't crash the whole run (rules
out the terminal-agent throw), and it's an oversized payload, not CJK token density.
<failures> / result reports: parallel[i] failed: agent({schema}): StructuredOutput retry cap (5) exceeded — 5 failed calls with no valid output..../subagents/**/agent-<id>.jsonl) shows repeated StructuredOutput
tool_use calls whose input is populated (not {}), and the agent's own late text says things
like "payload is too large and getting truncated" or "stray </parameter>/] corrupted the JSON".journal.jsonl has no {"type":"result"} line for this agent (it never emitted) — so the
journal-recovery path that works for completed agents does not apply here; you must read the agent's
own transcript.1. Recover the work from the failed StructuredOutput attempts (don't re-run — the BQ/analysis already happened and re-running costs tokens and may drift).
<transcriptDir>/subagents/**/agent-*.jsonl. .meta.json often lacks the label — identify by content.StructuredOutput (or *output*) tool_use input in that JSONL — the final retry
usually carries the most complete data. Also scan the agent's last assistant text blocks for a
plain-language summary it wrote before/after the failed emits.import json
f = ".../subagents/workflows/wf_<runid>/agent-<id>.jsonl"
last_struct, texts = None, []
for line in open(f):
try: d = json.loads(line)
except: continue
msg = d.get("message") or d
for b in (msg.get("content") or []) if isinstance(msg, dict) else []:
if not isinstance(b, dict): continue
if b.get("type") == "tool_use" and ("output" in b.get("name","").lower()
or "structured" in b.get("name","").lower()):
last_struct = b.get("input") # the data it tried to submit
if b.get("type") == "text":
texts.append(b["text"]) # its own summary/reasoning
print(json.dumps(last_struct, indent=1)[:4000])
print("\n".join(texts[-2:]))
input is usually near-complete (a truncated tail array is common) — enough to use
directly. Only re-run if the specific missing tail matters.2. Prevent it on the next dispatch — shrink the payload, don't raise the cap.
additionalProperties:false, and prune optional fields.
Cut long free-text per row (a one-line note instead of paragraphs; a sql field only if truly needed).input/text contains the real findings (numbers, SQL, verdicts) — confirm against what
the agent was asked to produce.In one run: a 4-agent verification workflow returned 3-of-4; the failure line was parallel[1] failed: agent({schema}): StructuredOutput retry cap (5) exceeded. The failed agent (a per-item
spot-check) had actually run every BQ probe; its transcript's last StructuredOutput input held the
full summary + most of a large findings array, and its own text said "payload is too large… stray
` after the ] corrupted the JSON." Recovered the findings from disk (no re-run). The next
two workflows used compact schemas + capped arrays and both returned clean full sets.
workflow-schema-agents-empty-loop-under-ratelimit: there the args are empty and
the cause is a server-side rate-limit storm; recovery is journal.jsonl for completed agents +
re-dispatch as free-text. Here the args are full/oversized; recovery is the agent's own transcript.workflow-standalone-schema-agent-crash-and-args-string: a standalone (non-parallel)
schema agent that fails throws and kills the whole run; inside parallel() it degrades to null.resumeFromRunId replays completed agents from cache but re-runs the failed one — only useful if you
first shrank its schema (otherwise it fails the same way).parallel() null-on-error semantics.workflow-schema-agents-empty-loop-under-ratelimit, workflow-standalone-schema-agent-crash-and-args-string, cjk-structured-llm-output-truncates-json-needs-2x-tokens, claude-code-workflow-subagent-tokens-nested-undercount (same nested transcript layout).What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub wan-huiyan/agent-traffic-control --plugin agent-traffic-control118 skills in this plugin
/agent-refusal-with-evidence-beats-literal-complianceA dispatched agent that does exactly what you asked can ship a defect you would
have stopped yourself, because it can see something at the worksite that you
could not see when you wrote the brief. Use when: (1) you are writing a brief
that prescribes a specific fix, threshold, wording or value rather than the
outcome you want; (2) an agent reports that it did not do what you asked and
you are deciding whether that is insubordination or judgement; (3) an agent
asserts "this is fine" or "not needed" with no measurement behind it; (4) you
are reviewing overnight output and want to know which decisions were checked
and which were assumed. Two halves, and both are needed: give the agent
explicit permission to satisfy the INTENT of an instruction while refusing its
letter, and REQUIRE the evidence with the refusal — what it built or measured,
what that showed, what it did instead. Evidence is the whole difference between
a refusal you can bank and one you have to re-litigate. Four agents correctly
declined an instruction in a single run; one built the suggested fix, measured
that it turned a silent safe refusal into a permanently red pipeline, and
reverted it unpushed.
/auto-merge-rearms-while-agent-live-kill-then-disarm-verifyDisarming auto-merge on a PR whose agent is still running does not hold it —
the agent re-arms within minutes and the PR merges, because arming is a step in
the agent's brief and disarming is not an instruction to the agent at all. Use
when: (1) you want to STOP a pull request from merging that an agent opened and
armed, for review, for a rethink, or because it is landing into a queue you are
trying to drain; (2) a PR you disarmed merged anyway; (3) you are telling agents
which PRs are on hold and want the hold to be enforced rather than announced;
(4) you are about to run `gh pr merge --disable-auto` and have not decided what
to do about the agent. The order is KILL THE AGENT FIRST, THEN DISARM, THEN
VERIFY the disarm by reading `autoMergeRequest` back — a disarm you did not read
back is not a hold. The stronger form needs no ordering at all: convert the PR
to a draft with `gh pr ready --undo`. A draft cannot merge whatever any agent
does to it, so the hold survives an agent you missed, an agent that restarts,
and an agent you did not know about.
/batch-member-cites-a-path-only-a-non-member-addsYou wrote something correct that the default reader cannot reach: a batch member citing a
path only a NON-member adds, or a rule, ruling or ledger sitting on an unlanded branch.
/batch-merge-subject-is-not-evidence-a-member-landedYou are about to close, delete the branch of, or mark as landed a pull
request because a batch, roll-up or merge-train commit on the target branch
names it in the subject line, and because the member's own commits all
predate that merge by wall clock. Neither of those is evidence. A batch
branch is assembled at some moment BEFORE it merges, so anything the member
pushed after assembly is outside it, and the subject records INTENT at
assembly time rather than CONTENT at merge time. Use before closing a
member, when an ancestry check against a squashed batch says no, or when a
member's branch still shows commits ahead of the target. Compare file
content against the target branch instead, expecting exactly one legitimate
difference: the shared aggregate file every member appends to.
/check-a-stale-branch-is-not-undoing-newer-main-workA branch built on an out-of-date main is about to merge, or has merged, and may undo work
that landed since. Use when a green, conflict-free PR deletes files you never touched,
newer values or a whole redesign vanish after a sibling PR merged, rows of a shared ledger
(tracker, registry, CHANGELOG) disappear or revert, or when `git diff main...HEAD` or a
reviewer says your small PR touches dozens of files you did not change.
/ci-leg-skipping-moves-minutes-it-does-not-remove-themYou are about to propose, price or approve a CI cost saving that works by
making a job or matrix leg SKIP on pull requests — a path filter, a safe
list, a changed-files gate, an exemption list. Check first whether the
pipeline runs a complement or backstop on merge, on push, or nightly:
many do, and then the legs a pull request skipped are exactly the legs some
later run executes, so a branch that goes green once and merges bills the
same total either way and the wall clock does not move at all. Use when
pricing a filter change, when a percentage saving is quoted with no basis,
or when choosing between filtering legs and batching pull requests. The
question that separates money from bookkeeping is whether the change
removes RUNS or merely moves LEGS.